8000 Switch selected uses of distutils to setuptools by jwodder · Pull Request #276 · python-versioneer/python-versioneer · GitHub
[go: up one dir, main page]

Skip to content

Switch selected uses of distutils to setuptools #276

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

Merged
merged 2 commits into from
Feb 19, 2022
Merged

Switch selected uses of distutils to setuptools #276

merged 2 commits into from
Feb 19, 2022

Conversation

jwodder
Copy link
Contributor
@jwodder jwodder commented Oct 25, 2021

See #275.

Note that this PR does not completely remove all uses of distutils:

  • Imports that use setuptools if available and then fall back to distutils if it's not are kept, as they should be harmless going forwards.
  • The import of distutils.command.build_scripts.build_scripts in test/demoapp-script-only/setup.py is kept, along with the reference to distutils.command.build_scripts in INSTALL.md, as setuptools proper does not seem to have an equivalent class. You may want to ask on pypa/setuptools about the preferred way to update this import.

src/cmdclass.py Outdated
@@ -31,7 +31,7 @@ def get_cmdclass(cmdclass=None):
cmds = {} if cmdclass is None else cmdclass.copy()

# we add "version" to both distutils and setuptools
from distutils.core import Command
from setuptools import Command
Copy link
Contributor

Choose a reason for hiding this comment

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

IIUC setuptools monkey-patches distutils.core? I think to maintain current behavior while bypassing the deprecation:

Suggested change
from setuptools import Command
try:
from setuptools import Command
except ImportError:
from distutils.core import Command

@@ -1,5 +1,5 @@

from distutils.core import setup
from setuptools import setup
Copy link
Contributor

Choose a reason for hiding this comment

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

This and the other is specifically a distutils test.

@jwodder
Copy link
Contributor Author
jwodder commented Jan 11, 2022

@effigies Review comments addressed.

mslw added a commit to mslw/datalad-neuroimaging that referenced this pull request Feb 11, 2022
@effigies effigies merged commit 82b194d into python-versioneer:master Feb 19, 2022
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

Successfully merging this pull request may close these issues.

2 participants
0