Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
setuptools
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jérome Perrin
setuptools
Commits
57a5c05e
Commit
57a5c05e
authored
Sep 04, 2016
by
Jason R. Coombs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move monkeypatching in package module into monkey.
parent
d6efc942
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
41 additions
and
35 deletions
+41
-35
setuptools/__init__.py
setuptools/__init__.py
+3
-35
setuptools/monkey.py
setuptools/monkey.py
+38
-0
No files found.
setuptools/__init__.py
View file @
57a5c05e
"""Extensions to the 'distutils' for large or complex distributions"""
import
os
import
sys
import
functools
import
distutils.core
import
distutils.filelist
...
...
@@ -13,8 +12,8 @@ from setuptools.extern.six.moves import filterfalse, map
import
setuptools.version
from
setuptools.extension
import
Extension
from
setuptools.dist
import
Distribution
,
Feature
from
setuptools.monkey
import
_get_unpatched
from
setuptools.depends
import
Require
from
.
import
monkey
__all__
=
[
'setup'
,
'Distribution'
,
'Feature'
,
'Command'
,
'Extension'
,
'Require'
,
...
...
@@ -122,7 +121,7 @@ find_packages = PackageFinder.find
setup
=
distutils
.
core
.
setup
_Command
=
_get_unpatched
(
distutils
.
core
.
Command
)
_Command
=
monkey
.
_get_unpatched
(
distutils
.
core
.
Command
)
class
Command
(
_Command
):
...
...
@@ -144,10 +143,6 @@ class Command(_Command):
return
cmd
# we can't patch distutils.cmd, alas
distutils
.
core
.
Command
=
Command
def
_find_all_simple
(
path
):
"""
Find all files under 'path'
...
...
@@ -172,31 +167,4 @@ def findall(dir=os.curdir):
return
list
(
files
)
has_issue_12885
=
(
sys
.
version_info
<
(
3
,
4
,
6
)
or
(
3
,
5
)
<
sys
.
version_info
<=
(
3
,
5
,
3
)
or
(
3
,
6
)
<
sys
.
version_info
)
if
has_issue_12885
:
# fix findall bug in distutils (http://bugs.python.org/issue12885)
distutils
.
filelist
.
findall
=
findall
needs_warehouse
=
(
sys
.
version_info
<
(
2
,
7
,
13
)
or
(
3
,
0
)
<
sys
.
version_info
<
(
3
,
3
,
7
)
or
(
3
,
4
)
<
sys
.
version_info
<
(
3
,
4
,
6
)
or
(
3
,
5
)
<
sys
.
version_info
<=
(
3
,
5
,
3
)
or
(
3
,
6
)
<
sys
.
version_info
)
if
needs_warehouse
:
warehouse
=
'https://upload.pypi.org/legacy/'
distutils
.
config
.
PyPIRCCommand
.
DEFAULT_REPOSITORY
=
warehouse
monkey
.
patch_all
()
setuptools/monkey.py
View file @
57a5c05e
...
...
@@ -2,6 +2,11 @@
Monkey patching of distutils.
"""
import
sys
import
distutils.filelist
import
setuptools
__all__
=
[]
"everything is private"
...
...
@@ -20,3 +25,36 @@ def _get_unpatched(cls):
"distutils has already been patched by %r"
%
cls
)
return
cls
def
patch_all
():
# we can't patch distutils.cmd, alas
distutils
.
core
.
Command
=
setuptools
.
Command
has_issue_12885
=
(
sys
.
version_info
<
(
3
,
4
,
6
)
or
(
3
,
5
)
<
sys
.
version_info
<=
(
3
,
5
,
3
)
or
(
3
,
6
)
<
sys
.
version_info
)
if
has_issue_12885
:
# fix findall bug in distutils (http://bugs.python.org/issue12885)
distutils
.
filelist
.
findall
=
setuptools
.
findall
needs_warehouse
=
(
sys
.
version_info
<
(
2
,
7
,
13
)
or
(
3
,
0
)
<
sys
.
version_info
<
(
3
,
3
,
7
)
or
(
3
,
4
)
<
sys
.
version_info
<
(
3
,
4
,
6
)
or
(
3
,
5
)
<
sys
.
version_info
<=
(
3
,
5
,
3
)
or
(
3
,
6
)
<
sys
.
version_info
)
if
needs_warehouse
:
warehouse
=
'https://upload.pypi.org/legacy/'
distutils
.
config
.
PyPIRCCommand
.
DEFAULT_REPOSITORY
=
warehouse
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment