setuptools-scm: 8.0.4 fails to install with Python 3.8/3.9 (but works fine with Python 3.10+)

Is it even supported for Python <= 3.9?

It fails for me:

--->  Configuring py38-setuptools_scm
--->  Building py38-setuptools_scm
Executing:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_python_py-setuptools_scm/py38-setuptools_scm/work/setuptools-scm-8.0.4" && /opt/local/Library/Frameworks/Python.framework/Versions/3.8/bin/python3.8 -m build --no-isolation --wheel --outdir /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_python_py-setuptools_scm/py38-setuptools_scm/work 
* Getting build dependencies for wheel...
running egg_info
writing src/setuptools_scm.egg-info/PKG-INFO
writing dependency_links to src/setuptools_scm.egg-info/dependency_links.txt
writing entry points to src/setuptools_scm.egg-info/entry_points.txt
writing requirements to src/setuptools_scm.egg-info/requires.txt
writing top-level names to src/setuptools_scm.egg-info/top_level.txt
ERROR setuptools_scm._file_finders.git listing git files failed - pretending there aren't any
Traceback (most recent call last):
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
    main()
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/pyproject_hooks/_in_process/_in_process.py", line 335, in main
    json_out['return_val'] = hook(**hook_input['kwargs'])
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/pyproject_hooks/_in_process/_in_process.py", line 118, in get_requires_for_build_wheel
    return hook(config_settings)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/setuptools/build_meta.py", line 355, in get_requires_for_build_wheel
    return self._get_build_requires(config_settings, requirements=['wheel'])
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/setuptools/build_meta.py", line 325, in _get_build_requires
    self.run_setup()
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/setuptools/build_meta.py", line 341, in run_setup
    exec(code, locals())
  File "<string>", line 1, in <module>
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/setuptools/__init__.py", line 103, in setup
    return distutils.core.setup(**attrs)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/setuptools/_distutils/core.py", line 185, in setup
    return run_commands(dist)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/setuptools/_distutils/core.py", line 201, in run_commands
    dist.run_commands()
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/setuptools/_distutils/dist.py", line 969, in run_commands
    self.run_command(cmd)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/setuptools/dist.py", line 989, in run_command
    super().run_command(command)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
    cmd_obj.run()
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/setuptools/command/egg_info.py", line 318, in run
    self.find_sources()
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/setuptools/command/egg_info.py", line 326, in find_sources
    mm.run()
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/setuptools/command/egg_info.py", line 548, in run
    self.add_defaults()
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/setuptools/command/egg_info.py", line 589, in add_defaults
    rcfiles = list(walk_revctrl())
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/setuptools/command/sdist.py", line 18, in walk_revctrl
    for item in ep.load()(dirname):
  File "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_python_py-setuptools_scm/py38-setuptools_scm/work/setuptools-scm-8.0.4/src/setuptools_scm/_file_finders/__init__.py", line 102, in find_files
    command: Callable[[_t.PathT], list[str]] = ep.load()
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/setuptools/_vendor/importlib_metadata/__init__.py", line 208, in load
    module = import_module(match.group('module'))
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 973, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'setuptools_scm.file_finder_git'

ERROR Backend subprocess exited when trying to invoke get_requires_for_build_wheel
Command failed:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_python_py-setuptools_scm/py38-setuptools_scm/work/setuptools-scm-8.0.4" && /opt/local/Library/Frameworks/Python.framework/Versions/3.8/bin/python3.8 -m build --no-isolation --wheel --outdir /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_python_py-setuptools_scm/py38-setuptools_scm/work 
Exit code: 1

But py310-setuptools_scm installs fine.

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 21 (13 by maintainers)

Commits related to this issue

Most upvoted comments

Thanks! setuptools-scm 8.3.0 builds and appears to be working as intended now on python3.9. Will report back if I find any other issues with my testing.

I’m going to have to disagree with that assertion. In my case I can replicate the issue and the problem is related to setuptools-scm not honoring PYTHONPATH. 8.0.2 is the only version >=8.0 that does build and work properly. This is on Slackware 15.0 with python3.9.

I’m the maintainer of python3-setuptools-scm-opt on slackbuilds.org. As a workaround for newer versions for some python packages that ship with 15.0 we install them to /opt and use PYTHONPATH in the slackbuilds that require it.

This has worked well except for upgrading setuptools-scm to the versions stated above. With 8.2.1 installed and PYTHONPATH set it should, imho, find that version first and ignore the system installed version (6.3.2) but it does not and one gets the same ModuleNotFoundError: No module named 'setuptools_scm.file_finder_git' error. Note that everything does work fine if the 6.3.2 version is uninstalled from the system, but our policy is to not mess with the base operating system.

I hope that helps narrow down the issue so that it can be fixed. Let me know if you have any questions or testing I can do to help.

I’m not familiar with ports, but my guess is, the proposed mechanism should work