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

[rosdep] no more distutils as of Python 3.12 #43500

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mikaelarguedas
Copy link
Member

As per PEP 632 https://peps.python.org/pep-0632/ distutils has been deprecated from Python 3.10 and is not distributed as of Python 3.12.

The package cannot be installed on newer platforms.

Distro packaging links:

Links to Distribution Packages

This PR mark explicitly past distros as providing the package and defaults to null for all other distros.

Not sure how to deal with other distros that juste reference python standard library

@mikaelarguedas mikaelarguedas requested a review from a team as a code owner November 14, 2024 07:51
@github-actions github-actions bot added the rosdep Issue/PR is for a rosdep key label Nov 14, 2024
Copy link
Contributor

@clalancette clalancette left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, hm. I'm not sure what to do here.

For Fedora, Gentoo, and nixOS, it looks like we set this to "python" long ago (2020, it looks like). But that is actually a lie.

What I'd be in favor of here is removing all stanzas here except for the Ubuntu versions it can still be installed on, and the Debian versions it can still be installed on. That way we'll be consistent everywhere. In other words, remove fedora, gentoo, and nixos stanzas as well.

@cottsay
Copy link
Member

cottsay commented Nov 18, 2024

But that is actually a lie.

It wasn't at the time. Python 3.11 and older provide distutils as part of the stdlib. Debian decided to pull it into a separate package for whatever reason, but that rule was right for platforms which didn't split it out.

I do however agree that platforms targeting Python >= 3.12 should drop rules now, which includes Fedora.

@cottsay
Copy link
Member

cottsay commented Nov 18, 2024

Also note that '*': null has no effect on rosdep resolution. The only reason to include it is to serve as a hint to humans reading the rules.

@mikaelarguedas
Copy link
Member Author

Also note that '*': null has no effect on rosdep resolution. The only reason to include it is to serve as a hint to humans reading the rules.

oh I forgot about that, thanks for the info!

@mikaelarguedas
Copy link
Member Author

So to move forward on this I should identify which version of fedora ship what version of python and just keep the non-EOL anes and update the rules ?

not familiar with gentoo and nixOS so I may need assistance finding out what to do there

@clalancette
Copy link
Contributor

It wasn't at the time. Python 3.11 and older provide distutils as part of the stdlib. Debian decided to pull it into a separate package for whatever reason, but that rule was right for platforms which didn't split it out.

I see, thanks for the info.

I do however agree that platforms targeting Python >= 3.12 should drop rules now, which includes Fedora.

Hm, though now I think it might be provided by setuptools? At least if I go on my Ubuntu 24.04 container (with Python 3.12), I can run:

$ python3.12 -c "import distutils ; print(distutils.__file__)"
/usr/lib/python3/dist-packages/setuptools/_distutils/__init__.py

@cottsay
Copy link
Member

cottsay commented Nov 18, 2024

Hm, though now I think it might be provided by setuptools?

It might on some platforms, yes. On Fedora, a distutils-precedence.pth file is created that conditionally injects the bundled distutils from setuptools into Python's module search path. If that sort of injection happens by default, I think you could say that python3-setuptools provides this.

@nuclearsandwich
Copy link
Member

It might on some platforms, yes. On Fedora, a distutils-precedence.pth file is created that conditionally injects the bundled distutils from setuptools into Python's module search path. If that sort of injection happens by default, I think you could say that python3-setuptools provides this.

I think we should decide whether or not we want to seamlessly transition to the setuptools shim (which will doubtless get dropped in some major version unceremoniously, possibly even in the near future) or if we think that people depending on setuptools to provide distutils should update their dependency declaration explicitly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
rosdep Issue/PR is for a rosdep key
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants