setup.cfg wrongly mentions setuptools in install_requires?
jsmolic opened this issue · comments
cairocffi does not seem to be using setuptools at runtime, but it's mentioned in install_requires
in setup.cfg
, so perhaps it should be removed from there
cairocffi does not seem to be using setuptools at runtime, but it's mentioned in
install_requires
insetup.cfg
, so perhaps it should be removed from there
It was actually needed for the installation, I’m not sure that having it in install_requires
is needed, so you’re probably right.
Ok, thanks. I can prepare a quick PR for removing it. Since it is not needed at runtime, having it in install_requires
can confuse downstream packagers when determining whether setuptools is a build-time dependency vs run-time dependency
Ok, thanks. I can prepare a quick PR for removing it. Since it is not needed at runtime, having it in
install_requires
can confuse downstream packagers when determining whether setuptools is a build-time dependency vs run-time dependency
OK. I’m just a bit confused about how pip is supposed to install setuptools when it wants to install cairocffi, as it’s needed by setup.py
. Having setuptools as a dependency of pip is probably enough. Does it mean that setuptools is installed with Python, now that pip is provided by the vanilla install?
(Oh, important note: I’m really grateful for your work on Gentoo. I’m a Gentoo user since … something like 2005 (OMG), and I’m so happy to have some of my projects in the official repository 💓)
Ok, thanks. I can prepare a quick PR for removing it. Since it is not needed at runtime, having it in
install_requires
can confuse downstream packagers when determining whether setuptools is a build-time dependency vs run-time dependencyOK. I’m just a bit confused about how pip is supposed to install setuptools when it wants to install cairocffi, as it’s needed by
setup.py
. Having setuptools as a dependency of pip is probably enough.
I guess so, I mean I'm fairly new with python packaging, but I don't see how you could use setup.py in this case without setuptools as it imports it in the beggining.
And I don't think pip can actually parse setup.cfg
file so it should not break with removing setuptools
from there.
Does it mean that setuptools is installed with Python, now that pip is provided by the vanilla install?
(Oh, important note: I’m really grateful for your work on Gentoo. I’m a Gentoo user since … something like 2005 (OMG), and I’m so happy to have some of my projects in the official repository heartbeat)
Thank you ;)
I guess so, I mean I'm fairly new with python packaging, but I don't see how you could use setup.py in this case without setuptools as it imports it in the beggining.
Sure, it was a rhetorical question 😉.
And I don't think pip can actually parse
setup.cfg
file so it should not break with removingsetuptools
from there.
Removing it from setup.cfg
will remove it from the package metadata, and thus pip won’t install it.
But we don’t care. There’s no reasonable way someone has pip without setuptools installed. And even if we ask for a minimal version of setuptools, installing cairocffi with an older version will use this older version to install a recent version of setuptools … but will continue to use the old one of the current process to install cairocffi. So… Having setuptools listed in the dependencies in the documentation and not in setup.cfg
is enough.
But… Doesn’t Gentoo launch setup.py
to install the package?
Thanks you!
Yes, Gentoo uses setup.py
for installing python pacakges. It actually has reusable code packaged in the so-called eclasses to ease installing of Python packages. As it distigushes dependencies into several categories, it has various checks for determining e.g. whether setuptools is used at build-time or at run-time, which actually brought me to open this issue :)
As it distigushes dependencies into several categories, it has various checks for determining e.g. whether setuptools is used at build-time or at run-time, which actually brought me to open this issue :)
OK :). Thanks!
We ran into a problem with an old Docker base image (Ubuntu 18.04) which had an outdated setuptools
as well.
Collecting cairocffi>=0.9.0 Downloading cairocffi-1.2.0.tar.gz (70 kB) WARNING: Requested cairocffi>=0.9.0 from https://files.pythonhosted.org/packages/84/ca/0bffed5116d21251469df200448667e90acaa5131edea869b44a3fbc73d0/cairocffi-1.2.0.tar.gz#sha256=9a979b500c64c8179fec286f337e8fe644eca2f2cd05860ce0b62d25f22ea140 (from weasyprint->-r requirements.txt (line 25)), but installing version file-.cairocffi-VERSION ERROR: Requested cairocffi>=0.9.0 from https://files.pythonhosted.org/packages/84/ca/0bffed5116d21251469df200448667e90acaa5131edea869b44a3fbc73d0/cairocffi-1.2.0.tar.gz#sha256=9a979b500c64c8179fec286f337e8fe644eca2f2cd05860ce0b62d25f22ea140 (from weasyprint->-r requirements.txt (line 25)) has different version in metadata: 'file-.cairocffi-VERSION'
After upgrading setuptools
it worked fine.
So some version requirement is necessary.
So some version requirement is necessary.
Adding the version requirement in the package doesn’t help, because when pip is launched, it installs setuptools as a dependency but keeps using the previous version while installing cairocffi.
We could add some information in the documentation, if you want.
@liZe thanks for the quick reply. We now better understand the issue. In my opinion it is not necessary to explicitly point this out in the documentation. I believe most people use setuptools in a more up to date version. If not they will find this ticket :)