Re: [RFC] RPM's Python dependency generator
On 12/01/2016 02:42 PM, Neal Gompa wrote: On Thu, Dec 1, 2016 at 8:36 AM, Igor Gnatenko wrote: On Wed, Nov 30, 2016 at 2:53 PM, Tomas Orsava wrote: On 11/30/2016 02:44 PM, Neal Gompa wrote: On Wed, Nov 30, 2016 at 8:41 AM, Tomas Orsava wrote: I don't think the depgen should be enabled by default, at least not in the foreseeable future. IIRC it's not that well implemented—e.g. I believe it doesn't read requirements.txt for example (but I might be wrong). There will be a lot of cases where the generated requirements are incomplete, or contain unnecessary entries, etc. I think it should remain an opt-in. According to various Python people, we're not actually supposed to read requirements.txt. That file is explicitly designed for people to individualized deployments. The proper place to get this information is from the egg-info/dist-info data, which is what we read. The fact that some people abuse requirements.txt and have it read in by their setup.py is beside the point. Whatever the setup.py (thus pip/easy_install/etc.) says it needs, the generator will dutifully report. The fact remains in too many cases it will need to be manually adjusted, it won't be foolproof. Therefore I argue it would be better for it to be an opt-in so that new packagers don't immediately have to jump in into debugging a depgen they have no clue how really works. We'll see how it will go. we have depgen for pkgconfig, libraries, etc. for many years and people don't go and debug it immediately, but for many of packages it will help a lot. Anyhow, we'll see after couple of releases. Neal suggested to have: %__python_requires %{_rpmconfigdir}/%{?pythondistdeps_enable:pythondistdeps.py}%{!?pythondistdeps_enable:pythondeps.sh} --requires in python.attr inside RPM. I tested it and it just works once I specify `%global pythondistdeps_enable 1` in spec. Can you help me to get this included? With RPM part it's clear how to get this, but updating guidelines and other stuff... This will also drastically simplify the work of tools like pyp2rpm, since instead of having to do crazy processing of module names, it can just use the appropriate pypi provides/requires. If the macro template enables the requires generator, it won't even need to specify requires at all, as they'll be generated from the wheel data anyway. +1, ideally that'll leave us with only one automatic dependency generator. Problems with upstreams getting setup.py wrong should be treated as upstream bugs and treated accordingly: reported as pull requests, or, as the last resort, by a Fedora-specific patch to setup.py. CCing Michal from the pyp2rpm project, so that everyone knows he's aware of the discussion here. -- Petr Viktorin ___ python-devel mailing list -- python-devel@lists.fedoraproject.org To unsubscribe send an email to python-devel-le...@lists.fedoraproject.org
Re: [RFC] RPM's Python dependency generator
On 12/01/2016 02:36 PM, Igor Gnatenko wrote: We'll see how it will go. we have depgen for pkgconfig, libraries, etc. for many years and people don't go and debug it immediately, but for many of packages it will help a lot. Anyhow, we'll see after couple of releases. Yeah, absolutely. When it's battle-tested and solid, it will make packaging that much easier. Neal suggested to have: %__python_requires %{_rpmconfigdir}/%{?pythondistdeps_enable:pythondistdeps.py}%{!?pythondistdeps_enable:pythondeps.sh} --requires in python.attr inside RPM. Oh that's clever, I was wondering how things like that are done! I tested it and it just works once I specify `%global pythondistdeps_enable 1` in spec. Can you help me to get this included? With RPM part it's clear how to get this, but updating guidelines and other stuff... AFAIK the best way to get the guidelines updated is to create an accompanying Fedora Change. [0] I sadly don't have free cycles to take that on, as I'm currently involved in 2 upcoming Fedora Changes, nevertheless I will gladly provide any help and guidance you might need! [0] https://fedoraproject.org/wiki/Changes/Policy ___ python-devel mailing list -- python-devel@lists.fedoraproject.org To unsubscribe send an email to python-devel-le...@lists.fedoraproject.org
Re: [RFC] RPM's Python dependency generator
On Thu, Dec 1, 2016 at 8:36 AM, Igor Gnatenko wrote: > On Wed, Nov 30, 2016 at 2:53 PM, Tomas Orsava wrote: >> On 11/30/2016 02:44 PM, Neal Gompa wrote: >>> >>> On Wed, Nov 30, 2016 at 8:41 AM, Tomas Orsava wrote: I don't think the depgen should be enabled by default, at least not in the foreseeable future. IIRC it's not that well implemented—e.g. I believe it doesn't read requirements.txt for example (but I might be wrong). There will be a lot of cases where the generated requirements are incomplete, or contain unnecessary entries, etc. I think it should remain an opt-in. >>> According to various Python people, we're not actually supposed to >>> read requirements.txt. That file is explicitly designed for people to >>> individualized deployments. The proper place to get this information >>> is from the egg-info/dist-info data, which is what we read. The fact >>> that some people abuse requirements.txt and have it read in by their >>> setup.py is beside the point. Whatever the setup.py (thus >>> pip/easy_install/etc.) says it needs, the generator will dutifully >>> report. >> >> >> The fact remains in too many cases it will need to be manually adjusted, it >> won't be foolproof. >> Therefore I argue it would be better for it to be an opt-in so that new >> packagers don't immediately have to jump in into debugging a depgen they >> have no clue how really works. > We'll see how it will go. we have depgen for pkgconfig, libraries, > etc. for many years and people don't go and debug it immediately, but > for many of packages it will help a lot. Anyhow, we'll see after > couple of releases. > > Neal suggested to have: > %__python_requires > %{_rpmconfigdir}/%{?pythondistdeps_enable:pythondistdeps.py}%{!?pythondistdeps_enable:pythondeps.sh} > --requires > in python.attr inside RPM. > > I tested it and it just works once I specify `%global > pythondistdeps_enable 1` in spec. Can you help me to get this > included? With RPM part it's clear how to get this, but updating > guidelines and other stuff... This will also drastically simplify the work of tools like pyp2rpm, since instead of having to do crazy processing of module names, it can just use the appropriate pypi provides/requires. If the macro template enables the requires generator, it won't even need to specify requires at all, as they'll be generated from the wheel data anyway. -- 真実はいつも一つ!/ Always, there's only one truth! ___ python-devel mailing list -- python-devel@lists.fedoraproject.org To unsubscribe send an email to python-devel-le...@lists.fedoraproject.org
Re: [RFC] RPM's Python dependency generator
On Wed, Nov 30, 2016 at 2:53 PM, Tomas Orsava wrote: > On 11/30/2016 02:44 PM, Neal Gompa wrote: >> >> On Wed, Nov 30, 2016 at 8:41 AM, Tomas Orsava wrote: >>> >>> I don't think the depgen should be enabled by default, at least not in >>> the >>> foreseeable future. IIRC it's not that well implemented—e.g. I believe it >>> doesn't read requirements.txt for example (but I might be wrong). >>> There will be a lot of cases where the generated requirements are >>> incomplete, or contain unnecessary entries, etc. I think it should remain >>> an >>> opt-in. >>> >> According to various Python people, we're not actually supposed to >> read requirements.txt. That file is explicitly designed for people to >> individualized deployments. The proper place to get this information >> is from the egg-info/dist-info data, which is what we read. The fact >> that some people abuse requirements.txt and have it read in by their >> setup.py is beside the point. Whatever the setup.py (thus >> pip/easy_install/etc.) says it needs, the generator will dutifully >> report. > > > The fact remains in too many cases it will need to be manually adjusted, it > won't be foolproof. > Therefore I argue it would be better for it to be an opt-in so that new > packagers don't immediately have to jump in into debugging a depgen they > have no clue how really works. We'll see how it will go. we have depgen for pkgconfig, libraries, etc. for many years and people don't go and debug it immediately, but for many of packages it will help a lot. Anyhow, we'll see after couple of releases. Neal suggested to have: %__python_requires %{_rpmconfigdir}/%{?pythondistdeps_enable:pythondistdeps.py}%{!?pythondistdeps_enable:pythondeps.sh} --requires in python.attr inside RPM. I tested it and it just works once I specify `%global pythondistdeps_enable 1` in spec. Can you help me to get this included? With RPM part it's clear how to get this, but updating guidelines and other stuff... > > ___ > python-devel mailing list -- python-devel@lists.fedoraproject.org > To unsubscribe send an email to python-devel-le...@lists.fedoraproject.org -- -Igor Gnatenko ___ python-devel mailing list -- python-devel@lists.fedoraproject.org To unsubscribe send an email to python-devel-le...@lists.fedoraproject.org