Re: [oi-dev] What to do with python module dependancies?
On Sun, Jul 18, 2021 at 4:47 PM Nona Hansel wrote: > Hello Gary, > > I believe that when you have a packages that has dependencies, these > dependencies must be added as individual packages themselves. After > incorporating them (which means create a folder, Makefile, .p5m file and > separate PR), your python package would find them. > > As for knowing in advance how many dependencies a package has, I usually > check the package in Fedora and Suse and see their spec files: > https://src.fedoraproject.org/ > https://build.opensuse.org/ > Also you can have a look at the pypi website. To verify a posteriori if the dependencies are satisfied you can use the pipdeptree command, it is packaged at: https://github.com/OpenIndiana/oi-userland/tree/oi/hipster/components/python/pipdeptree > > I hope this was helpful. > Best regards, > Nona > > -- Původní e-mail -- > Od: Gary Mills > Komu: oi-dev@openindiana.org > Datum: 18. 7. 2021 16:02:07 > Předmět: [oi-dev] What to do with python module dependancies? > > I'm working on a python package that imports many other python > modules. So far I've discovered two python modules that don't have > corresponding packages in OI. There should be dependancies on these > two packages, but the automatic mechanism seems not to add them. > How can I add them myself? Do I do it directly in the P5M file? > > The original package builds and installs with the setup.py method. > It doesn't check for dependancies at all. I don't notice missing > dependancies until I test the module and get an error message when > an "import" fails. I'd like to be able to build a package that does > not have this problem. > > > -- > -Gary Mills- -refurb- -Winnipeg, Manitoba, Canada- > > ___ > oi-dev mailing list > oi-dev@openindiana.org > https://openindiana.org/mailman/listinfo/oi-dev > > ___ > oi-dev mailing list > oi-dev@openindiana.org > https://openindiana.org/mailman/listinfo/oi-dev > -- --- Praise the Caffeine embeddings ___ oi-dev mailing list oi-dev@openindiana.org https://openindiana.org/mailman/listinfo/oi-dev
Re: [oi-dev] What to do with python module dependancies?
Hey Gary There is two ways for a IPS package to have dependencies. One manual in the .p5m file in the folder. Simply define a dependency action to the FMRI and set the conditional level. Two automatically. The .p5m file in the folder is taken as input to the Packaging process, so everything you put there is run through pkgmogrify and pkgdepend utilities. These modify the file with transforms and automatically detected dependencies in turn. Have a look at the pkgdepend man page for details how that utility works. So anyhting pkgdepend does not detect has to be added to the .p5m file to assist the process. Another thing you can do is to add the package FMRI's to the REQUIRED_PACKAGES variable in the Makefile which will install the packages in the system during packaging. This can help the pkgdepend utility to detect dependencies if they are conditional. Also note that there have been problems in the past for pkgdepend to detect conditional imports in python. So Adding them manually to the .p5m file may be required. Greetings Till On 18.07.21 13:01, Gary Mills wrote: On Sun, Jul 18, 2021 at 03:08:38PM +0100, Peter Tribble wrote: I've also noticed the setup.py builds quite happily whether dependencies are present or not. All I do is look at the requires.txt file. Usually present in the .egg-info directory, which may be present in the source or in the build tree. (Some modules are smart enough to handle the fact that dependencies vary between python versions, too.) Thanks for the information; it was quite helpful. I found the file that you mentioned. It lists the two modules that I've already discovered, and two others conditionally. Do I need to create the IPS dependancies myself, or does this happen automatically? ___ oi-dev mailing list oi-dev@openindiana.org https://openindiana.org/mailman/listinfo/oi-dev
Re: [oi-dev] What to do with python module dependancies?
On Sun, Jul 18, 2021 at 03:08:38PM +0100, Peter Tribble wrote: > >I've also noticed the setup.py builds quite happily whether >dependencies >are present or not. >All I do is look at the requires.txt file. Usually present in the >.egg-info >directory, which may be present in the source or in the build tree. >(Some modules are smart enough to handle the fact that dependencies >vary between python versions, too.) Thanks for the information; it was quite helpful. I found the file that you mentioned. It lists the two modules that I've already discovered, and two others conditionally. Do I need to create the IPS dependancies myself, or does this happen automatically? -- -Gary Mills--refurb--Winnipeg, Manitoba, Canada- ___ oi-dev mailing list oi-dev@openindiana.org https://openindiana.org/mailman/listinfo/oi-dev
Re: [oi-dev] What to do with python module dependancies?
Hello Gary, I believe that when you have a packages that has dependencies, these dependencies must be added as individual packages themselves. After incorporating them (which means create a folder, Makefile, .p5m file and separate PR), your python package would find them. As for knowing in advance how many dependencies a package has, I usually check the package in Fedora and Suse and see their spec files: https://src.fedoraproject.org/ https://build.opensuse.org/ I hope this was helpful. Best regards, Nona -- Původní e-mail -- Od: Gary Mills Komu: oi-dev@openindiana.org Datum: 18. 7. 2021 16:02:07 Předmět: [oi-dev] What to do with python module dependancies? "I'm working on a python package that imports many other python modules. So far I've discovered two python modules that don't have corresponding packages in OI. There should be dependancies on these two packages, but the automatic mechanism seems not to add them. How can I add them myself? Do I do it directly in the P5M file? The original package builds and installs with the setup.py method. It doesn't check for dependancies at all. I don't notice missing dependancies until I test the module and get an error message when an "import" fails. I'd like to be able to build a package that does not have this problem. -- -Gary Mills- -refurb- -Winnipeg, Manitoba, Canada- ___ oi-dev mailing list oi-dev@openindiana.org https://openindiana.org/mailman/listinfo/oi-dev "___ oi-dev mailing list oi-dev@openindiana.org https://openindiana.org/mailman/listinfo/oi-dev
Re: [oi-dev] What to do with python module dependancies?
On Sun, Jul 18, 2021 at 2:59 PM Gary Mills wrote: > I'm working on a python package that imports many other python > modules. So far I've discovered two python modules that don't have > corresponding packages in OI. There should be dependancies on these > two packages, but the automatic mechanism seems not to add them. > How can I add them myself? Do I do it directly in the P5M file? > > The original package builds and installs with the setup.py method. > It doesn't check for dependancies at all. I don't notice missing > dependancies until I test the module and get an error message when > an "import" fails. I'd like to be able to build a package that does > not have this problem. > I've also noticed the setup.py builds quite happily whether dependencies are present or not. All I do is look at the requires.txt file. Usually present in the .egg-info directory, which may be present in the source or in the build tree. (Some modules are smart enough to handle the fact that dependencies vary between python versions, too.) -- -Peter Tribble http://www.petertribble.co.uk/ - http://ptribble.blogspot.com/ ___ oi-dev mailing list oi-dev@openindiana.org https://openindiana.org/mailman/listinfo/oi-dev
[oi-dev] What to do with python module dependancies?
I'm working on a python package that imports many other python modules. So far I've discovered two python modules that don't have corresponding packages in OI. There should be dependancies on these two packages, but the automatic mechanism seems not to add them. How can I add them myself? Do I do it directly in the P5M file? The original package builds and installs with the setup.py method. It doesn't check for dependancies at all. I don't notice missing dependancies until I test the module and get an error message when an "import" fails. I'd like to be able to build a package that does not have this problem. -- -Gary Mills--refurb--Winnipeg, Manitoba, Canada- ___ oi-dev mailing list oi-dev@openindiana.org https://openindiana.org/mailman/listinfo/oi-dev