Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit9499f7c

Browse files
committed
Use distutils provided by setuptools
The distutils module provided by the stdlib has been deprecated inPython 3.10. This PR sets an env var that is read by setuptools whichwill shim its vendored copy of distutils if present avoiding a failureonce distutils is removed from the stdlib.Signed-off-by: Jordan Borean <jborean93@gmail.com>
1 parent2bde020 commit9499f7c

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

‎setup.py‎

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
#!/usr/bin/env python
22
from __future__importprint_function
33

4-
fromsetuptoolsimportsetup
5-
fromsetuptoolsimportDistribution
6-
fromsetuptools.command.sdistimportsdist
7-
fromsetuptools.extensionimportExtension
84
importsubprocess
95
importplatform
106
importre
@@ -13,6 +9,16 @@
139
importshutil
1410
importshlex
1511

12+
# Enables the vendored distutils in setuptools over the stdlib one to avoid the derpecation warning.
13+
# Must be done before importing setuptools (setuptools also must be imported before distutils).
14+
# https://github.com/pypa/setuptools/blob/main/docs/deprecated/distutils-legacy.rst
15+
os.environ['SETUPTOOLS_USE_DISTUTILS']='local'
16+
17+
fromsetuptoolsimportsetup# noqa: E402
18+
fromsetuptoolsimportDistribution# noqa: E402
19+
fromsetuptools.command.sdistimportsdist# noqa: E402
20+
fromsetuptools.extensionimportExtension# noqa: E402
21+
1622

1723
SKIP_CYTHON_FILE='__dont_use_cython__.txt'
1824

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp