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

Deprecate SETUPTOOLS_USE_DISTUTILS=stdlib #3625

Open
jaraco opened this issue Oct 6, 2022 · 5 comments
Open

Deprecate SETUPTOOLS_USE_DISTUTILS=stdlib #3625

jaraco opened this issue Oct 6, 2022 · 5 comments

Comments

@jaraco
Copy link
Member

jaraco commented Oct 6, 2022

Soon, as Python 3.12 starts to roll out, users will be unable to use SETUPTOOLS_USE_DISTUTILS=stdlib. Moreover, Setuptools supporting this mode also adds complexity to the project and reduces the ability of distutils/setuptools to evolve to consolidate behaviors. Let's deprecate this mode.

@kiorky
Copy link

kiorky commented Oct 6, 2022

If i am correct, this will break the workaround needed on #3301 on old pythons on Debian based systems.

@jaraco
Copy link
Member Author

jaraco commented Oct 6, 2022

Yes, perhaps. The deprecation wouldn't, but the subsequent removal probably would. There are different ways we could possibly ameliorate the situation:

  • those environments would pin to older Setuptools (maybe by way of pip constraints?).
  • extend distutils to support those environments.
  • wait for those environments to drop support
  • ??

I've added that bug to the project for consideration.

@kiorky
Copy link

kiorky commented Oct 7, 2022

  • wait for those environments to drop support

This will lead up to 2027+5=2032 at least (ubuntu 22.04LTS end ESM support).

Maybe the simpler would be to make sure that downstream vendor patches handle the new setuptools flawlessly, even on old packaged pythons which are in the official tree (eg python38 on ubuntu 20.04 (support 'til 2030) or python37 on ubuntu18.04 (support 'til 2027) which even does not have the _distutils_system_mod.py file. I think everybody would be happy of that.

hroncok added a commit to hroncok/setuptools that referenced this issue Oct 13, 2022
This is an imperfect way to make the tests pass on Python 3.12.

Long-term goal is to deprecate the stdlib option,
see pypa#3625
@hroncok
Copy link
Contributor

hroncok commented Oct 13, 2022

I've been proactively building Fedora packages without distutils to see what breaks. Figured out some setuptools tests fail. Hence: #3636

hroncok added a commit to hroncok/setuptools that referenced this issue Oct 13, 2022
This is an imperfect way to make the tests pass on Python 3.12.

Long-term goal is to deprecate the stdlib option,
see pypa#3625
manthey added a commit to girder/girder that referenced this issue Feb 1, 2023
The issue appears when doing 'pip install -e <package>', the package
does not show up when doing 'pip freeze'.  This is caused by Ubuntu
installing a patched version of distutils (see pypa/distutils/issues/17
and pypa/setuptools/issues/3301; see also pypa/setuptools/issues/3625
for when this will stop working).

This adds a workaround.  Better would be to create a virtualenv and
install into that and be insulated from odd OS upstream choices.
@culler
Copy link

culler commented Mar 19, 2023

I don't think that Python 3.11.2 is considered old. However, I am unable to import setuptools without setting the environment variable that you want to remove. Wouldn't it be better to fix setuptools first?

This is what I am seeing:

Python 3.11.2 (v3.11.2:878ead1ac1, Feb 7 2023, 10:02:41) [Clang 13.0.0 (clang-1300.0.29.30)] on darwin
Type "help", "copyright", "credits" or "license" for more information.

import setuptools
Traceback (most recent call last):
File "", line 1, in
File "/Users/culler/Library/Python/3.11/lib/python/site-packages/setuptools/init.py", line 8, in
import _distutils_hack.override # noqa: F401
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/culler/Library/Python/3.11/lib/python/site-packages/_distutils_hack/override.py", line 1, in
import('_distutils_hack').do_override()
File "/Users/culler/Library/Python/3.11/lib/python/site-packages/_distutils_hack/init.py", line 77, in do_override
ensure_local_distutils()
File "/Users/culler/Library/Python/3.11/lib/python/site-packages/_distutils_hack/init.py", line 64, in ensure_local_distutils
assert '_distutils' in core.file, core.file
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/distutils/core.py
import os
os.environ['SETUPTOOLS_USE_DISTUTILS'] = 'stdlib'
import setuptools
setuptools.version
'67.6.0'

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

No branches or pull requests

4 participants