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

setuptools_scm 7.0.0 fails with Python 3.7 #718

Closed
hagenw opened this issue Jun 21, 2022 · 4 comments · Fixed by #719
Closed

setuptools_scm 7.0.0 fails with Python 3.7 #718

hagenw opened this issue Jun 21, 2022 · 4 comments · Fixed by #719
Assignees

Comments

@hagenw
Copy link

hagenw commented Jun 21, 2022

When using setuptools_scm in a CI pipeline to install a package I'm getting:

ModuleNotFoundError: No module named 'importlib.metadata'

compare https://github.com/audeering/audonnx/runs/6985662108?check_suite_focus=true

which is a common importlib bug described for example at https://github.com/newville/asteval/issues/93

@olasd
Copy link

olasd commented Jun 21, 2022

Here's a slightly more complete traceback:

16:03:49  ================================== log start ===================================
16:03:49  Processing ./.tox/.tmp/package/1/swh.dataset-0.3.2.dev3+ge31bdb2.zip
16:03:49    Installing build dependencies: started
16:03:49    Installing build dependencies: finished with status 'done'
16:03:49    Getting requirements to build wheel: started
16:03:49    Getting requirements to build wheel: finished with status 'done'
16:03:49    Installing backend dependencies: started
16:03:49    Installing backend dependencies: finished with status 'done'
16:03:49    Preparing metadata (pyproject.toml): started
16:03:49    Preparing metadata (pyproject.toml): finished with status 'error'
16:03:49    error: subprocess-exited-with-error
16:03:49    
16:03:49    × Preparing metadata (pyproject.toml) did not run successfully.
16:03:49    │ exit code: 1
16:03:49    ╰─> [53 lines of output]
16:03:49        Traceback (most recent call last):
16:03:49          File "/tmp/pip-build-env-flt_2moh/normal/lib/python3.7/site-packages/setuptools_scm/_entrypoints.py", line 72, in <module>
16:03:49            from importlib.metadata import entry_points  # type: ignore
16:03:49        ModuleNotFoundError: No module named 'importlib.metadata'
16:03:49        
16:03:49        During handling of the above exception, another exception occurred:
16:03:49        
16:03:49        Traceback (most recent call last):
16:03:49          File "/var/lib/jenkins/workspace/DDATASET/tests/.tox/mypy/lib/python3.7/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 363, in <module>
16:03:49            main()
16:03:49          File "/var/lib/jenkins/workspace/DDATASET/tests/.tox/mypy/lib/python3.7/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 345, in main
16:03:49            json_out['return_val'] = hook(**hook_input['kwargs'])
16:03:49          File "/var/lib/jenkins/workspace/DDATASET/tests/.tox/mypy/lib/python3.7/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 164, in prepare_metadata_for_build_wheel
16:03:49            return hook(metadata_directory, config_settings)
16:03:49          File "/tmp/pip-build-env-flt_2moh/overlay/lib/python3.7/site-packages/setuptools/build_meta.py", line 188, in prepare_metadata_for_build_wheel
16:03:49            self.run_setup()
16:03:49          File "/tmp/pip-build-env-flt_2moh/overlay/lib/python3.7/site-packages/setuptools/build_meta.py", line 282, in run_setup
16:03:49            self).run_setup(setup_script=setup_script)
16:03:49          File "/tmp/pip-build-env-flt_2moh/overlay/lib/python3.7/site-packages/setuptools/build_meta.py", line 174, in run_setup
16:03:49            exec(compile(code, __file__, 'exec'), locals())
16:03:49          File "setup.py", line 71, in <module>
16:03:49            "Documentation": "https://docs.softwareheritage.org/devel/swh-dataset/",
16:03:49          File "/tmp/pip-build-env-flt_2moh/overlay/lib/python3.7/site-packages/setuptools/__init__.py", line 87, in setup
16:03:49            return distutils.core.setup(**attrs)
16:03:49          File "/tmp/pip-build-env-flt_2moh/overlay/lib/python3.7/site-packages/setuptools/_distutils/core.py", line 139, in setup
16:03:49            _setup_distribution = dist = klass(attrs)
16:03:49          File "/tmp/pip-build-env-flt_2moh/overlay/lib/python3.7/site-packages/setuptools/dist.py", line 481, in __init__
16:03:49            for k, v in attrs.items()
16:03:49          File "/tmp/pip-build-env-flt_2moh/overlay/lib/python3.7/site-packages/setuptools/_distutils/dist.py", line 275, in __init__
16:03:49            self.finalize_options()
16:03:49          File "/tmp/pip-build-env-flt_2moh/overlay/lib/python3.7/site-packages/setuptools/dist.py", line 900, in finalize_options
16:03:49            for ep in sorted(loaded, key=by_order):
16:03:49          File "/tmp/pip-build-env-flt_2moh/overlay/lib/python3.7/site-packages/setuptools/dist.py", line 899, in <lambda>
16:03:49            loaded = map(lambda e: e.load(), filtered)
16:03:49          File "/tmp/pip-build-env-flt_2moh/overlay/lib/python3.7/site-packages/setuptools/_vendor/importlib_metadata/__init__.py", line 194, in load
16:03:49            module = import_module(match.group('module'))
16:03:49          File "/usr/lib/python3.7/importlib/__init__.py", line 127, in import_module
16:03:49            return _bootstrap._gcd_import(name[level:], package, level)
16:03:49          File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
16:03:49          File "<frozen importlib._bootstrap>", line 983, in _find_and_load
16:03:49          File "<frozen importlib._bootstrap>", line 953, in _find_and_load_unlocked
16:03:49          File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
16:03:49          File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
16:03:49          File "<frozen importlib._bootstrap>", line 983, in _find_and_load
16:03:49          File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
16:03:49          File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
16:03:49          File "<frozen importlib._bootstrap_external>", line 728, in exec_module
16:03:49          File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
16:03:49          File "/tmp/pip-build-env-flt_2moh/normal/lib/python3.7/site-packages/setuptools_scm/__init__.py", line 14, in <module>
16:03:49            from ._entrypoints import _call_entrypoint_fn
16:03:49          File "/tmp/pip-build-env-flt_2moh/normal/lib/python3.7/site-packages/setuptools_scm/_entrypoints.py", line 74, in <module>
16:03:49            from importlib_metadata import entry_points
16:03:49        ModuleNotFoundError: No module named 'importlib_metadata'
16:03:49        [end of output]

Looks like the importlib_metadata dependency is missing from the setup.cfg install_requires for python3.7.

@RonnyPfannschmidt
Copy link
Contributor

the version is yanked, will release a bugfix as soon as i get to it

the test dependencies did hide the missing runtime dependency

@ntravis
Copy link

ntravis commented Jun 21, 2022

@RonnyPfannschmidt are you planning to go through the release process (i.e. tag a 7.0.1 release) now that you've merged in the change? we're looking our mitigation options (commits across 10s of package repos to limit the 7.0.0 release), but the release of 7.0.1 would make that unnecessary

@RonnyPfannschmidt
Copy link
Contributor

The old release is yanked since hours, the release happens when I get back to the computer

erikmansson added a commit to acconeer/acconeer-python-exploration that referenced this issue Jun 22, 2022
Incompatible with Python 3.7. See:
pypa/setuptools-scm#718

Change-Id: I563c4c8b019e64caca32a251d3606af81f3e4c53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants