-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
40.1.0 breaks version detection on some packages #1462
Comments
You'll have to give more information than that: environment? Python version? What command are you using? What are the exact errors? |
@aduskett Is it possible that this is actually an issue with your local environment and that "downgrading" to version 40.0.0 actually upgraded some version on your python path from something < 18.5? I can't reproduce this - I cloned cryptography and had no problem with either |
Python 3.7.0 is the version: Here is the command used by BuildRoot with python-cryptography-2.3.1 and setuptools 40.1.0:
Here is the output:
I am more than happy to make a github project with a defconfig so anybody who wishes to test the output could do so. |
In [1]: import pkg_resources, setuptools
In [2]: pkg_resources.parse_version(setuptools.__version__)
Out[2]: <Version('40.0.0')>
In [3]: pkg_resources.parse_version(setuptools.__version__) < pkg_resources.parse_version("18.5")
Out[3]: False It's unfortunate the error message does not show the version of setuptools available, but simplest explanation is that an older version get picked up. A buildroot (configuration?) bug? How did you update setuptools to |
Setuptools is installed directly. It's never upgraded. if ( raise RuntimeError(
|
I don't understand, I've not used buildroot in a while, and not with Python packages, but isn't setuptools itself supposed to be provided (built/installed) first by buildroot (maybe be with both a host and a build version if cross-compiling)? As for the version of setuptools you're getting, I've to ask where you got it, because that's certainly not a PEP 440 compliant version number (which explains why the comparison is failing). |
Yes, setuptools is provided by buildroot itself. Setup tools are grabbed from this repository in fact! PYTHON_SETUPTOOLS_VERSION = v40.1.0 |
OK, so you did upgrade the setuptools version by patching the buildroot package for setuptools. What version of buildroot is that? I've not looked at the particular of the |
Indeed, it's the latest next branch. It ends up downloading from this url: |
Interesting fact, If I downgrade to 40.0, this is the output for cryptography: |
I still don't see what's happening, can you give some verbose traces for setuptools' build? Maybe add an additional trace with the output of |
So even with '40.0.0', the version is not right. |
Do you have a minimal buildroot configuration to reproduce the problem? |
Yes I do: and run That should reproduce the issue. |
OK, so I can't reproduce the issue because the build fails earlier; when building host-m4:
Anyway, package/python-setuptools/python-setuptools.mk | 1 +
1 file changed, 1 insertion(+)
diff --git i/package/python-setuptools/python-setuptools.mk w/package/python-setuptools/python-setuptools.mk
index 590e9829..e3980a40 100644
--- i/package/python-setuptools/python-setuptools.mk
+++ w/package/python-setuptools/python-setuptools.mk
@@ -14,6 +14,7 @@ PYTHON_SETUPTOOLS_SETUP_TYPE = setuptools
# before the standard setup process.
define PYTHON_SETUPTOOLS_RUN_BOOTSTRAP
cd $(@D) && $(HOST_DIR)/bin/python ./bootstrap.py
+ cd $(@D) && $(HOST_DIR)/bin/python ./setup.py --version
endef
PYTHON_SETUPTOOLS_PRE_CONFIGURE_HOOKS = PYTHON_SETUPTOOLS_RUN_BOOTSTRAP ? |
Also, what's the exact command line used to call |
host-python-setuptools v40.1.0 Extracting host-python-setuptools v40.1.0 Patching host-python-setuptools v40.1.0 Configuring host-python-setuptools v40.1.0 Building host-python-setuptools v40.1.0 Installing to host directory Installed /home/vagrant/Downloads/br/output/host/lib/python3.7/site-packages/setuptools-40.1.0.post20180820.post_20180820-py3.7.egg |
OK, so
|
No idea why with 40.1.0, we're getting 2 post/date added yet... |
IMHO, buildroot should really use the source distributions from PyPI, rather then Github releases (which are not proper source distributions). This would also mean there's no need to run |
And would fix the version number, even if it works with 40.0.0, the version number is not right, and confusing, considering your installing an official release, and not a development version. |
Culprit is e9bdeda. |
Yeah, I will try with the pypi version. Would it be possible to upload a tar.gz to pypi as well? If not, that's fine, but it would make my life much easier, as BuildRoot handles tar.gz files much easier. |
It does look like using the package from pypi does indeed install as 40.1.0, so that should fix the issue in the intermittent. I'm not sure if I genuinely found a bug, but if the package on pypi had a tar.gz version, it would make my life a ton easier. |
There's definitively a bug in 40.1.0, but I also think not using the PyPI source distributions is a mistake. Can you create a new issue asking for tar.gz source distributions to be added to PyPI releases please? |
Done. Thank you for all of your help today! |
Oy. Sorry about that. Any idea what the cause is? I looked at the commit, and it's not obvious to me how that change causes the issue (though I fully believe it's the proximate cause). |
Yes, the fact that # Set package version for the benefit of dumber commands
# (e.g. sdist, bdist_wininst, etc.)
#
self.distribution.metadata.version = self.egg_version Tentative patch: setuptools/command/egg_info.py | 12 ++++--------
1 file changed, 4 insertions(+), 8 deletions(-)
diff --git i/setuptools/command/egg_info.py w/setuptools/command/egg_info.py
index 5fd6c888..aba9ac6e 100644
--- i/setuptools/command/egg_info.py
+++ w/setuptools/command/egg_info.py
@@ -160,7 +160,9 @@ class egg_info(InfoCommon, Command):
def initialize_options(self):
self.egg_base = None
+ self.egg_name = None
self.egg_info = None
+ self.egg_version = None
self.broken_egg_info = False
####################################
@@ -188,15 +190,9 @@ def save_version_info(self, filename):
egg_info['tag_date'] = 0
edit_config(filename, dict(egg_info=egg_info))
- @property
- def egg_name(self):
- return self.name
-
- @property
- def egg_version(self):
- return self.tagged_version()
-
def finalize_options(self):
+ self.egg_name = self.name
+ self.egg_version = self.tagged_version()
parsed_version = parse_version(self.egg_version)
try: |
The releases on Github produces a setuptools version that isn't PEP518 compliant because a .post number is attached to the .egg file (IE: 40.0.0.post20180820) which can cause a python package using setuptools to fail if looking for a setuptools version. Instead, using the official release from pypi is recommended as it does not produce a .post version on the egg file. Another benefit is not having to run bootstrap.py either. See pypa/setuptools#1462 for more details about the issue Signed-off-by: Adam Duskett <[email protected]> Signed-off-by: Thomas Petazzoni <[email protected]>
Hello;
I tried updating setuptools to 40.1.0 in the BuildRoot project, only to find a few packages such as
python-cryptography no longer seem to think setuptools is a version high enough to work.
Another package that has the same issue is python-funcsigs as well.
Downgrading to 40.0.0 fixes the issue. Any idea as to what could be going on?
Thanks!
The text was updated successfully, but these errors were encountered: