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

Python 3.12/PEP 632 compatibility (distutils removal) #89

Open
twm opened this issue Jul 1, 2024 · 0 comments
Open

Python 3.12/PEP 632 compatibility (distutils removal) #89

twm opened this issue Jul 1, 2024 · 0 comments

Comments

@twm
Copy link
Contributor

twm commented Jul 1, 2024

The distutils package was removed in Python 3.12, per PEP 632. It is transitionally provided by setuptools, but this is deprecated.

Incremental contains distutils imports. Its tests fail on Python 3.12 when setuptools' vendored distutils is disabled:

$ SETUPTOOLS_USE_DISTUTILS=stdlib TOX_TESTENV_PASSENV=SETUPTOOLS_USE_DISTUTILS tox -e tests-py312
...
tests-py312 run-test: commands[5] | coverage run -p examplesetup.py install
Traceback (most recent call last):
  File ".../incremental/examplesetup.py", line 1, in <module>
    from setuptools import setup
  File ".../incremental/.tox/tests-py312/lib/python3.12/site-packages/setuptools/__init__.py", line 9, in <module>
    import distutils.core
ModuleNotFoundError: No module named 'distutils'
.../incremental/.tox/tests-py312/lib/python3.12/site-packages/coverage/inorout.py:503: CoverageWarning: Module incremental was never imported. (module-not-imported)
  self.warn(f"Module {pkg} was never imported.", slug="module-not-imported")
.../incremental/.tox/tests-py312/lib/python3.12/site-packages/coverage/control.py:888: CoverageWarning: No data was collected. (no-data-collected)
  self._warn("No data was collected.", slug="no-data-collected")
ERROR: InvocationError for command .../incremental/.tox/tests-py312/bin/coverage run -p examplesetup.py install (exited with code 1)
__________________________________________________________________ summary ___________________________________________________________________
ERROR:   tests-py312: commands failed

The imports should be updated to reference the equivalent bits of setuptools.

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

1 participant