Skip to content
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

build failure against setuptools 66+ #907

Closed
stanislavlevin opened this issue Feb 7, 2023 · 8 comments
Closed

build failure against setuptools 66+ #907

stanislavlevin opened this issue Feb 7, 2023 · 8 comments

Comments

@stanislavlevin
Copy link

setuptools 66+ no longer supports LegacyVersion:
https://setuptools.pypa.io/en/stable/history.html#v66-0-0

#2497: Support for PEP 440 non-conforming versions has been removed. Environments containing packages with non-conforming versions may fail or the packages may not be recognized.

Build fails with:

[builder@localhost Nagstamon]$ python3 -m build 
* Creating venv isolated environment...
* Installing packages in isolated environment... (keyring, psutil, setuptools==66.0.0)
* Getting build dependencies for sdist...
/usr/src/tmp/build-env-_up3l8v8/lib64/python3/site-packages/setuptools/dist.py:543: UserWarning: The version specified ('3.11.20230126.altlinux10.1') is an invalid version, this may not work as expected with newer versions of setuptools, pip, and PyPI. Please see PEP 440 for more details.
  warnings.warn(
running egg_info
Traceback (most recent call last):
  File "/usr/src/.local/lib/python3/site-packages/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
    main()
  File "/usr/src/.local/lib/python3/site-packages/pyproject_hooks/_in_process/_in_process.py", line 335, in main
    json_out['return_val'] = hook(**hook_input['kwargs'])
  File "/usr/src/.local/lib/python3/site-packages/pyproject_hooks/_in_process/_in_process.py", line 287, in get_requires_for_build_sdist
    return hook(config_settings)
  File "/usr/src/tmp/build-env-_up3l8v8/lib64/python3/site-packages/setuptools/build_meta.py", line 341, in get_requires_for_build_sdist
    return self._get_build_requires(config_settings, requirements=[])
  File "/usr/src/tmp/build-env-_up3l8v8/lib64/python3/site-packages/setuptools/build_meta.py", line 320, in _get_build_requires
    self.run_setup()
  File "/usr/src/tmp/build-env-_up3l8v8/lib64/python3/site-packages/setuptools/build_meta.py", line 484, in run_setup
    super(_BuildMetaLegacyBackend,
  File "/usr/src/tmp/build-env-_up3l8v8/lib64/python3/site-packages/setuptools/build_meta.py", line 335, in run_setup
    exec(code, locals())
  File "<string>", line 124, in <module>
  File "/usr/src/tmp/build-env-_up3l8v8/lib64/python3/site-packages/setuptools/__init__.py", line 87, in setup
    return distutils.core.setup(**attrs)
  File "/usr/src/tmp/build-env-_up3l8v8/lib64/python3/site-packages/setuptools/_distutils/core.py", line 185, in setup
    return run_commands(dist)
  File "/usr/src/tmp/build-env-_up3l8v8/lib64/python3/site-packages/setuptools/_distutils/core.py", line 201, in run_commands
    dist.run_commands()
  File "/usr/src/tmp/build-env-_up3l8v8/lib64/python3/site-packages/setuptools/_distutils/dist.py", line 969, in run_commands
    self.run_command(cmd)
  File "/usr/src/tmp/build-env-_up3l8v8/lib64/python3/site-packages/setuptools/dist.py", line 1208, in run_command
    super().run_command(command)
  File "/usr/src/tmp/build-env-_up3l8v8/lib64/python3/site-packages/setuptools/_distutils/dist.py", line 987, in run_command
    cmd_obj.ensure_finalized()
  File "/usr/src/tmp/build-env-_up3l8v8/lib64/python3/site-packages/setuptools/_distutils/cmd.py", line 111, in ensure_finalized
    self.finalize_options()
  File "/usr/src/tmp/build-env-_up3l8v8/lib64/python3/site-packages/setuptools/command/egg_info.py", line 219, in finalize_options
    parsed_version = parse_version(self.egg_version)
  File "/usr/src/tmp/build-env-_up3l8v8/lib64/python3/site-packages/pkg_resources/_vendor/packaging/version.py", line 266, in __init__
    raise InvalidVersion(f"Invalid version: '{version}'")
pkg_resources.extern.packaging.version.InvalidVersion: Invalid version: '3.11.20230126.altlinux10.1'
@HenriWahl
Copy link
Owner

What is the purpose of that build?

@stanislavlevin
Copy link
Author

This is just a reproducer. Though distros are in process of switching to PEP517 builds.
Exactly the same behavior can be observed with setuptools(66+) installed with distro package manager, pip, etc.

@s3v-
Copy link

s3v- commented Feb 12, 2023

Same failure in Debian:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1030407.
after setuptools 66.1.1 entered in archive.

Kind Regards

@HenriWahl
Copy link
Owner

So this is getting urgent.

@HenriWahl
Copy link
Owner

HenriWahl commented Feb 12, 2023

What will be a valid version?

Edit: I traced it down to https://github.com/HenriWahl/Nagstamon/blob/master/setup.py#L48. Apparently intended to have the OS + version in the resulting package filename.

@HenriWahl
Copy link
Owner

Should look better now with latest changes.

@stanislavlevin
Copy link
Author

The fix a1a3516 is verified.
Thank you!

@HenriWahl
Copy link
Owner

Thanks for the notice 😃

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants