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
31bd37c6
Commit
31bd37c6
authored
Oct 18, 2016
by
stepshal
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix quantity of blank lines.
parent
f774a0be
Changes
45
Show whitespace changes
Inline
Side-by-side
Showing
45 changed files
with
48 additions
and
88 deletions
+48
-88
bootstrap.py
bootstrap.py
+0
-1
docs/conf.py
docs/conf.py
+0
-2
pkg_resources/__init__.py
pkg_resources/__init__.py
+2
-7
pkg_resources/tests/test_pkg_resources.py
pkg_resources/tests/test_pkg_resources.py
+1
-4
pkg_resources/tests/test_resources.py
pkg_resources/tests/test_resources.py
+2
-5
setup.py
setup.py
+0
-7
setuptools/__init__.py
setuptools/__init__.py
+0
-1
setuptools/archive_util.py
setuptools/archive_util.py
+0
-1
setuptools/command/__init__.py
setuptools/command/__init__.py
+0
-1
setuptools/command/bdist_egg.py
setuptools/command/bdist_egg.py
+1
-1
setuptools/command/bdist_wininst.py
setuptools/command/bdist_wininst.py
+0
-1
setuptools/command/build_ext.py
setuptools/command/build_ext.py
+0
-2
setuptools/command/easy_install.py
setuptools/command/easy_install.py
+3
-4
setuptools/command/sdist.py
setuptools/command/sdist.py
+2
-0
setuptools/command/setopt.py
setuptools/command/setopt.py
+0
-1
setuptools/command/test.py
setuptools/command/test.py
+0
-2
setuptools/extension.py
setuptools/extension.py
+0
-1
setuptools/extern/__init__.py
setuptools/extern/__init__.py
+0
-1
setuptools/glob.py
setuptools/glob.py
+11
-0
setuptools/lib2to3_ex.py
setuptools/lib2to3_ex.py
+0
-2
setuptools/monkey.py
setuptools/monkey.py
+0
-1
setuptools/msvc.py
setuptools/msvc.py
+3
-0
setuptools/package_index.py
setuptools/package_index.py
+5
-2
setuptools/py26compat.py
setuptools/py26compat.py
+1
-1
setuptools/py27compat.py
setuptools/py27compat.py
+1
-0
setuptools/py31compat.py
setuptools/py31compat.py
+1
-0
setuptools/sandbox.py
setuptools/sandbox.py
+6
-0
setuptools/ssl_support.py
setuptools/ssl_support.py
+3
-2
setuptools/tests/__init__.py
setuptools/tests/__init__.py
+0
-4
setuptools/tests/server.py
setuptools/tests/server.py
+0
-1
setuptools/tests/test_bdist_egg.py
setuptools/tests/test_bdist_egg.py
+0
-2
setuptools/tests/test_build_ext.py
setuptools/tests/test_build_ext.py
+0
-1
setuptools/tests/test_develop.py
setuptools/tests/test_develop.py
+0
-1
setuptools/tests/test_easy_install.py
setuptools/tests/test_easy_install.py
+0
-8
setuptools/tests/test_egg_info.py
setuptools/tests/test_egg_info.py
+0
-1
setuptools/tests/test_find_packages.py
setuptools/tests/test_find_packages.py
+0
-1
setuptools/tests/test_integration.py
setuptools/tests/test_integration.py
+1
-0
setuptools/tests/test_manifest.py
setuptools/tests/test_manifest.py
+0
-4
setuptools/tests/test_packageindex.py
setuptools/tests/test_packageindex.py
+0
-3
setuptools/tests/test_sandbox.py
setuptools/tests/test_sandbox.py
+4
-2
setuptools/tests/test_sdist.py
setuptools/tests/test_sdist.py
+0
-5
setuptools/tests/test_test.py
setuptools/tests/test_test.py
+0
-1
setuptools/tests/test_upload_docs.py
setuptools/tests/test_upload_docs.py
+0
-2
setuptools/tests/test_windows_wrappers.py
setuptools/tests/test_windows_wrappers.py
+0
-2
tests/manual_test.py
tests/manual_test.py
+1
-0
No files found.
bootstrap.py
View file @
31bd37c6
...
@@ -10,7 +10,6 @@ import sys
...
@@ -10,7 +10,6 @@ import sys
import
textwrap
import
textwrap
import
subprocess
import
subprocess
minimal_egg_info
=
textwrap
.
dedent
(
"""
minimal_egg_info
=
textwrap
.
dedent
(
"""
[distutils.commands]
[distutils.commands]
egg_info = setuptools.command.egg_info:egg_info
egg_info = setuptools.command.egg_info:egg_info
...
...
docs/conf.py
View file @
31bd37c6
...
@@ -60,7 +60,6 @@ exclude_trees = []
...
@@ -60,7 +60,6 @@ exclude_trees = []
# The name of the Pygments (syntax highlighting) style to use.
# The name of the Pygments (syntax highlighting) style to use.
pygments_style
=
'sphinx'
pygments_style
=
'sphinx'
# -- Options for HTML output ---------------------------------------------------
# -- Options for HTML output ---------------------------------------------------
# The theme to use for HTML and HTML Help pages. Major themes that come with
# The theme to use for HTML and HTML Help pages. Major themes that come with
...
@@ -93,7 +92,6 @@ html_use_index = False
...
@@ -93,7 +92,6 @@ html_use_index = False
# Output file base name for HTML help builder.
# Output file base name for HTML help builder.
htmlhelp_basename
=
'Setuptoolsdoc'
htmlhelp_basename
=
'Setuptoolsdoc'
# -- Options for LaTeX output --------------------------------------------------
# -- Options for LaTeX output --------------------------------------------------
# Grouping the document tree into LaTeX files. List of tuples
# Grouping the document tree into LaTeX files. List of tuples
...
...
pkg_resources/__init__.py
View file @
31bd37c6
# coding: utf-8
# coding: utf-8
"""
"""
Package resource API
Package resource API
--------------------
--------------------
...
@@ -74,7 +73,6 @@ __import__('pkg_resources.extern.packaging.specifiers')
...
@@ -74,7 +73,6 @@ __import__('pkg_resources.extern.packaging.specifiers')
__import__
(
'pkg_resources.extern.packaging.requirements'
)
__import__
(
'pkg_resources.extern.packaging.requirements'
)
__import__
(
'pkg_resources.extern.packaging.markers'
)
__import__
(
'pkg_resources.extern.packaging.markers'
)
if
(
3
,
0
)
<
sys
.
version_info
<
(
3
,
3
):
if
(
3
,
0
)
<
sys
.
version_info
<
(
3
,
3
):
msg
=
(
msg
=
(
"Support for Python 3.0-3.2 has been dropped. Future versions "
"Support for Python 3.0-3.2 has been dropped. Future versions "
...
@@ -96,7 +94,6 @@ class PEP440Warning(RuntimeWarning):
...
@@ -96,7 +94,6 @@ class PEP440Warning(RuntimeWarning):
class
_SetuptoolsVersionMixin
(
object
):
class
_SetuptoolsVersionMixin
(
object
):
def
__hash__
(
self
):
def
__hash__
(
self
):
return
super
(
_SetuptoolsVersionMixin
,
self
).
__hash__
()
return
super
(
_SetuptoolsVersionMixin
,
self
).
__hash__
()
...
@@ -578,7 +575,6 @@ def get_entry_info(dist, group, name):
...
@@ -578,7 +575,6 @@ def get_entry_info(dist, group, name):
class IMetadataProvider:
class IMetadataProvider:
def has_metadata(name):
def has_metadata(name):
"""
Does
the
package
's distribution contain the named metadata?"""
"""
Does
the
package
's distribution contain the named metadata?"""
...
@@ -2738,7 +2734,6 @@ class Distribution(object):
...
@@ -2738,7 +2734,6 @@ class Distribution(object):
class
EggInfoDistribution
(
Distribution
):
class
EggInfoDistribution
(
Distribution
):
def
_reload_version
(
self
):
def
_reload_version
(
self
):
"""
"""
Packages installed by distutils (e.g. numpy or scipy),
Packages installed by distutils (e.g. numpy or scipy),
...
@@ -2825,7 +2820,6 @@ def issue_warning(*args, **kw):
...
@@ -2825,7 +2820,6 @@ def issue_warning(*args, **kw):
class RequirementParseError(ValueError):
class RequirementParseError(ValueError):
def __str__(self):
def __str__(self):
return ' '.join(self.args)
return ' '.join(self.args)
...
@@ -2850,7 +2844,6 @@ def parse_requirements(strs):
...
@@ -2850,7 +2844,6 @@ def parse_requirements(strs):
class Requirement(packaging.requirements.Requirement):
class Requirement(packaging.requirements.Requirement):
def __init__(self, requirement_string):
def __init__(self, requirement_string):
"""DO NOT CALL THIS UNDOCUMENTED METHOD; use Requirement.parse()!"""
"""DO NOT CALL THIS UNDOCUMENTED METHOD; use Requirement.parse()!"""
try:
try:
...
@@ -2906,8 +2899,10 @@ class Requirement(packaging.requirements.Requirement):
...
@@ -2906,8 +2899,10 @@ class Requirement(packaging.requirements.Requirement):
def _get_mro(cls):
def _get_mro(cls):
"""Get an mro for a type or classic class"""
"""Get an mro for a type or classic class"""
if not isinstance(cls, type):
if not isinstance(cls, type):
class cls(cls, object):
class cls(cls, object):
pass
pass
return cls.__mro__[1:]
return cls.__mro__[1:]
return cls.__mro__
return cls.__mro__
...
...
pkg_resources/tests/test_pkg_resources.py
View file @
31bd37c6
...
@@ -18,7 +18,6 @@ import pytest
...
@@ -18,7 +18,6 @@ import pytest
import
pkg_resources
import
pkg_resources
try
:
try
:
unicode
unicode
except
NameError
:
except
NameError
:
...
@@ -37,7 +36,6 @@ def timestamp(dt):
...
@@ -37,7 +36,6 @@ def timestamp(dt):
class
EggRemover
(
unicode
):
class
EggRemover
(
unicode
):
def
__call__
(
self
):
def
__call__
(
self
):
if
self
in
sys
.
path
:
if
self
in
sys
.
path
:
sys
.
path
.
remove
(
self
)
sys
.
path
.
remove
(
self
)
...
@@ -100,7 +98,6 @@ class TestZipProvider(object):
...
@@ -100,7 +98,6 @@ class TestZipProvider(object):
class
TestResourceManager
(
object
):
class
TestResourceManager
(
object
):
def
test_get_cache_path
(
self
):
def
test_get_cache_path
(
self
):
mgr
=
pkg_resources
.
ResourceManager
()
mgr
=
pkg_resources
.
ResourceManager
()
path
=
mgr
.
get_cache_path
(
'foo'
)
path
=
mgr
.
get_cache_path
(
'foo'
)
...
@@ -130,13 +127,13 @@ class TestIndependence:
...
@@ -130,13 +127,13 @@ class TestIndependence:
class
TestDeepVersionLookupDistutils
(
object
):
class
TestDeepVersionLookupDistutils
(
object
):
@
pytest
.
fixture
@
pytest
.
fixture
def
env
(
self
,
tmpdir
):
def
env
(
self
,
tmpdir
):
"""
"""
Create a package environment, similar to a virtualenv,
Create a package environment, similar to a virtualenv,
in which packages are installed.
in which packages are installed.
"""
"""
class
Environment
(
str
):
class
Environment
(
str
):
pass
pass
...
...
pkg_resources/tests/test_resources.py
View file @
31bd37c6
...
@@ -36,7 +36,6 @@ dist_from_fn = pkg_resources.Distribution.from_filename
...
@@ -36,7 +36,6 @@ dist_from_fn = pkg_resources.Distribution.from_filename
class
TestDistro
:
class
TestDistro
:
def
testCollection
(
self
):
def
testCollection
(
self
):
# empty path should produce no distributions
# empty path should produce no distributions
ad
=
pkg_resources
.
Environment
([],
platform
=
None
,
python
=
None
)
ad
=
pkg_resources
.
Environment
([],
platform
=
None
,
python
=
None
)
...
@@ -313,7 +312,6 @@ class TestDistro:
...
@@ -313,7 +312,6 @@ class TestDistro:
class
TestWorkingSet
:
class
TestWorkingSet
:
def
test_find_conflicting
(
self
):
def
test_find_conflicting
(
self
):
ws
=
WorkingSet
([])
ws
=
WorkingSet
([])
Foo
=
Distribution
.
from_filename
(
"/foo_dir/Foo-1.2.egg"
)
Foo
=
Distribution
.
from_filename
(
"/foo_dir/Foo-1.2.egg"
)
...
@@ -356,7 +354,6 @@ class TestWorkingSet:
...
@@ -356,7 +354,6 @@ class TestWorkingSet:
class
TestEntryPoints
:
class
TestEntryPoints
:
def
assertfields
(
self
,
ep
):
def
assertfields
(
self
,
ep
):
assert
ep
.
name
==
"foo"
assert
ep
.
name
==
"foo"
assert
ep
.
module_name
==
"pkg_resources.tests.test_resources"
assert
ep
.
module_name
==
"pkg_resources.tests.test_resources"
...
@@ -457,7 +454,6 @@ class TestEntryPoints:
...
@@ -457,7 +454,6 @@ class TestEntryPoints:
class
TestRequirements
:
class
TestRequirements
:
def
testBasics
(
self
):
def
testBasics
(
self
):
r
=
Requirement
.
parse
(
"Twisted>=1.2"
)
r
=
Requirement
.
parse
(
"Twisted>=1.2"
)
assert
str
(
r
)
==
"Twisted>=1.2"
assert
str
(
r
)
==
"Twisted>=1.2"
...
@@ -538,7 +534,6 @@ class TestRequirements:
...
@@ -538,7 +534,6 @@ class TestRequirements:
class
TestParsing
:
class
TestParsing
:
def
testEmptyParse
(
self
):
def
testEmptyParse
(
self
):
assert
list
(
parse_requirements
(
''
))
==
[]
assert
list
(
parse_requirements
(
''
))
==
[]
...
@@ -701,6 +696,7 @@ class TestParsing:
...
@@ -701,6 +696,7 @@ class TestParsing:
value of parse_version. The new parse_version returns a Version class
value of parse_version. The new parse_version returns a Version class
which needs to support this behavior, at least for now.
which needs to support this behavior, at least for now.
"""
"""
def
buildout
(
parsed_version
):
def
buildout
(
parsed_version
):
_final_parts
=
'*final-'
,
'*final'
_final_parts
=
'*final-'
,
'*final'
...
@@ -709,6 +705,7 @@ class TestParsing:
...
@@ -709,6 +705,7 @@ class TestParsing:
if
(
part
[:
1
]
==
'*'
)
and
(
part
not
in
_final_parts
):
if
(
part
[:
1
]
==
'*'
)
and
(
part
not
in
_final_parts
):
return
False
return
False
return
True
return
True
return
_final_version
(
parsed_version
)
return
_final_version
(
parsed_version
)
assert
buildout
(
parse_version
(
"1.0"
))
assert
buildout
(
parse_version
(
"1.0"
))
...
...
setup.py
View file @
31bd37c6
...
@@ -10,7 +10,6 @@ import textwrap
...
@@ -10,7 +10,6 @@ import textwrap
import
setuptools
import
setuptools
here
=
os
.
path
.
dirname
(
__file__
)
here
=
os
.
path
.
dirname
(
__file__
)
...
@@ -97,11 +96,8 @@ setup_params = dict(
...
@@ -97,11 +96,8 @@ setup_params = dict(
src_root
=
None
,
src_root
=
None
,
packages
=
setuptools
.
find_packages
(
exclude
=
[
'*.tests'
]),
packages
=
setuptools
.
find_packages
(
exclude
=
[
'*.tests'
]),
package_data
=
package_data
,
package_data
=
package_data
,
py_modules
=
[
'easy_install'
],
py_modules
=
[
'easy_install'
],
zip_safe
=
True
,
zip_safe
=
True
,
entry_points
=
{
entry_points
=
{
"distutils.commands"
:
[
"distutils.commands"
:
[
"%(cmd)s = setuptools.command.%(cmd)s:%(cmd)s"
%
locals
()
"%(cmd)s = setuptools.command.%(cmd)s:%(cmd)s"
%
locals
()
...
@@ -141,12 +137,9 @@ setup_params = dict(
...
@@ -141,12 +137,9 @@ setup_params = dict(
"dependency_links.txt = setuptools.command.egg_info:overwrite_arg"
,
"dependency_links.txt = setuptools.command.egg_info:overwrite_arg"
,
],
],
"console_scripts"
:
list
(
_gen_console_scripts
()),
"console_scripts"
:
list
(
_gen_console_scripts
()),
"setuptools.installation"
:
"setuptools.installation"
:
[
'eggsecutable = setuptools.command.easy_install:bootstrap'
],
[
'eggsecutable = setuptools.command.easy_install:bootstrap'
],
},
},
classifiers
=
textwrap
.
dedent
(
"""
classifiers
=
textwrap
.
dedent
(
"""
Development Status :: 5 - Production/Stable
Development Status :: 5 - Production/Stable
Intended Audience :: Developers
Intended Audience :: Developers
...
...
setuptools/__init__.py
View file @
31bd37c6
...
@@ -102,7 +102,6 @@ class PackageFinder(object):
...
@@ -102,7 +102,6 @@ class PackageFinder(object):
class
PEP420PackageFinder
(
PackageFinder
):
class
PEP420PackageFinder
(
PackageFinder
):
@
staticmethod
@
staticmethod
def
_looks_like_package
(
path
):
def
_looks_like_package
(
path
):
return
True
return
True
...
...
setuptools/archive_util.py
View file @
31bd37c6
...
@@ -10,7 +10,6 @@ from distutils.errors import DistutilsError
...
@@ -10,7 +10,6 @@ from distutils.errors import DistutilsError
from
pkg_resources
import
ensure_directory
,
ContextualZipFile
from
pkg_resources
import
ensure_directory
,
ContextualZipFile
__all__
=
[
__all__
=
[
"unpack_archive"
,
"unpack_zipfile"
,
"unpack_tarfile"
,
"default_filter"
,
"unpack_archive"
,
"unpack_zipfile"
,
"unpack_tarfile"
,
"default_filter"
,
"UnrecognizedFormat"
,
"extraction_drivers"
,
"unpack_directory"
,
"UnrecognizedFormat"
,
"extraction_drivers"
,
"unpack_directory"
,
...
...
setuptools/command/__init__.py
View file @
31bd37c6
...
@@ -10,7 +10,6 @@ import sys
...
@@ -10,7 +10,6 @@ import sys
from
setuptools.command
import
install_scripts
from
setuptools.command
import
install_scripts
if
'egg'
not
in
bdist
.
format_commands
:
if
'egg'
not
in
bdist
.
format_commands
:
bdist
.
format_command
[
'egg'
]
=
(
'bdist_egg'
,
"Python .egg file"
)
bdist
.
format_command
[
'egg'
]
=
(
'bdist_egg'
,
"Python .egg file"
)
bdist
.
format_commands
.
append
(
'egg'
)
bdist
.
format_commands
.
append
(
'egg'
)
...
...
setuptools/command/bdist_egg.py
View file @
31bd37c6
...
@@ -429,10 +429,10 @@ def can_scan():
...
@@ -429,10 +429,10 @@ def can_scan():
log
.
warn
(
"Please ask the author to include a 'zip_safe'"
log
.
warn
(
"Please ask the author to include a 'zip_safe'"
" setting (either True or False) in the package's setup.py"
)
" setting (either True or False) in the package's setup.py"
)
# Attribute names of options for commands that might need to be convinced to
# Attribute names of options for commands that might need to be convinced to
# install to the egg build directory
# install to the egg build directory
INSTALL_DIRECTORY_ATTRS
=
[
INSTALL_DIRECTORY_ATTRS
=
[
'install_lib'
,
'install_dir'
,
'install_data'
,
'install_base'
'install_lib'
,
'install_dir'
,
'install_data'
,
'install_base'
]
]
...
...
setuptools/command/bdist_wininst.py
View file @
31bd37c6
...
@@ -2,7 +2,6 @@ import distutils.command.bdist_wininst as orig
...
@@ -2,7 +2,6 @@ import distutils.command.bdist_wininst as orig
class
bdist_wininst
(
orig
.
bdist_wininst
):
class
bdist_wininst
(
orig
.
bdist_wininst
):
def
reinitialize_command
(
self
,
command
,
reinit_subcommands
=
0
):
def
reinitialize_command
(
self
,
command
,
reinit_subcommands
=
0
):
"""
"""
Supplement reinitialize_command to work around
Supplement reinitialize_command to work around
...
...
setuptools/command/build_ext.py
View file @
31bd37c6
...
@@ -56,7 +56,6 @@ elif os.name != 'nt':
...
@@ -56,7 +56,6 @@ elif os.name != 'nt':
except
ImportError
:
except
ImportError
:
pass
pass
if_dl
=
lambda
s
:
s
if
have_rtld
else
''
if_dl
=
lambda
s
:
s
if
have_rtld
else
''
...
@@ -70,7 +69,6 @@ def get_abi3_suffix():
...
@@ -70,7 +69,6 @@ def get_abi3_suffix():
class
build_ext
(
_build_ext
):
class
build_ext
(
_build_ext
):
def
run
(
self
):
def
run
(
self
):
"""Build extensions in build directory, then copy if --inplace"""
"""Build extensions in build directory, then copy if --inplace"""
old_inplace
,
self
.
inplace
=
self
.
inplace
,
0
old_inplace
,
self
.
inplace
=
self
.
inplace
,
0
...
...
setuptools/command/easy_install.py
View file @
31bd37c6
#!/usr/bin/env python
#!/usr/bin/env python
"""
"""
Easy Install
Easy Install
------------
------------
...
@@ -64,7 +63,6 @@ import pkg_resources
...
@@ -64,7 +63,6 @@ import pkg_resources
# Turn on PEP440Warnings
# Turn on PEP440Warnings
warnings
.
filterwarnings
(
"default"
,
category
=
pkg_resources
.
PEP440Warning
)
warnings
.
filterwarnings
(
"default"
,
category
=
pkg_resources
.
PEP440Warning
)
__all__
=
[
__all__
=
[
'samefile'
,
'easy_install'
,
'PthDistributions'
,
'extract_wininst_cfg'
,
'samefile'
,
'easy_install'
,
'PthDistributions'
,
'extract_wininst_cfg'
,
'main'
,
'get_exe_prefixes'
,
'main'
,
'get_exe_prefixes'
,
...
@@ -92,6 +90,7 @@ def samefile(p1, p2):
...
@@ -92,6 +90,7 @@ def samefile(p1, p2):
if
six
.
PY2
:
if
six
.
PY2
:
def
_to_ascii
(
s
):
def
_to_ascii
(
s
):
return
s
return
s
...
@@ -102,6 +101,7 @@ if six.PY2:
...
@@ -102,6 +101,7 @@ if six.PY2:
except
UnicodeError
:
except
UnicodeError
:
return
False
return
False
else
:
else
:
def
_to_ascii
(
s
):
def
_to_ascii
(
s
):
return
s
.
encode
(
'ascii'
)
return
s
.
encode
(
'ascii'
)
...
@@ -1632,7 +1632,6 @@ class PthDistributions(Environment):
...
@@ -1632,7 +1632,6 @@ class PthDistributions(Environment):
class
RewritePthDistributions
(
PthDistributions
):
class
RewritePthDistributions
(
PthDistributions
):
@
classmethod
@
classmethod
def
_wrap_lines
(
cls
,
lines
):
def
_wrap_lines
(
cls
,
lines
):
yield
cls
.
prelude
yield
cls
.
prelude
...
@@ -1837,6 +1836,7 @@ if '__pypy__' in sys.builtin_module_names:
...
@@ -1837,6 +1836,7 @@ if '__pypy__' in sys.builtin_module_names:
_replace_zip_directory_cache_data
=
\
_replace_zip_directory_cache_data
=
\
_remove_and_clear_zip_directory_cache_data
_remove_and_clear_zip_directory_cache_data
else
:
else
:
def
_replace_zip_directory_cache_data
(
normalized_path
):
def
_replace_zip_directory_cache_data
(
normalized_path
):
def
replace_cached_zip_archive_directory_data
(
path
,
old_entry
):
def
replace_cached_zip_archive_directory_data
(
path
,
old_entry
):
# N.B. In theory, we could load the zip directory information just
# N.B. In theory, we could load the zip directory information just
...
@@ -2164,7 +2164,6 @@ class WindowsScriptWriter(ScriptWriter):
...
@@ -2164,7 +2164,6 @@ class WindowsScriptWriter(ScriptWriter):
class
WindowsExecutableLauncherWriter
(
WindowsScriptWriter
):
class
WindowsExecutableLauncherWriter
(
WindowsScriptWriter
):
@
classmethod
@
classmethod
def
_get_script_args
(
cls
,
type_
,
name
,
header
,
script_text
):
def
_get_script_args
(
cls
,
type_
,
name
,
header
,
script_text
):
"""
"""
...
...
setuptools/command/sdist.py
View file @
31bd37c6
...
@@ -89,8 +89,10 @@ class sdist(sdist_add_defaults, orig.sdist):
...
@@ -89,8 +89,10 @@ class sdist(sdist_add_defaults, orig.sdist):
"""
"""
In a context, remove and restore os.link if it exists
In a context, remove and restore os.link if it exists
"""
"""
class
NoValue
:
class
NoValue
:
pass
pass
orig_val
=
getattr
(
os
,
'link'
,
NoValue
)
orig_val
=
getattr
(
os
,
'link'
,
NoValue
)
try
:
try
:
del
os
.
link
del
os
.
link
...
...
setuptools/command/setopt.py
View file @
31bd37c6
...
@@ -8,7 +8,6 @@ from setuptools.extern.six.moves import configparser
...
@@ -8,7 +8,6 @@ from setuptools.extern.six.moves import configparser
from
setuptools
import
Command
from
setuptools
import
Command
__all__
=
[
'config_file'
,
'edit_config'
,
'option_base'
,
'setopt'
]
__all__
=
[
'config_file'
,
'edit_config'
,
'option_base'
,
'setopt'
]
...
...
setuptools/command/test.py
View file @
31bd37c6
...
@@ -17,7 +17,6 @@ from setuptools.py31compat import unittest_main
...
@@ -17,7 +17,6 @@ from setuptools.py31compat import unittest_main
class
ScanningLoader
(
TestLoader
):
class
ScanningLoader
(
TestLoader
):
def
loadTestsFromModule
(
self
,
module
,
pattern
=
None
):
def
loadTestsFromModule
(
self
,
module
,
pattern
=
None
):
"""Return a suite of all tests cases contained in the given module
"""Return a suite of all tests cases contained in the given module
...
@@ -50,7 +49,6 @@ class ScanningLoader(TestLoader):
...
@@ -50,7 +49,6 @@ class ScanningLoader(TestLoader):
# adapted from jaraco.classes.properties:NonDataProperty
# adapted from jaraco.classes.properties:NonDataProperty
class
NonDataProperty
(
object
):
class
NonDataProperty
(
object
):
def
__init__
(
self
,
fget
):
def
__init__
(
self
,
fget
):
self
.
fget
=
fget
self
.
fget
=
fget
...
...
setuptools/extension.py
View file @
31bd37c6
...
@@ -26,7 +26,6 @@ def _have_cython():
...
@@ -26,7 +26,6 @@ def _have_cython():
# for compatibility
# for compatibility
have_pyrex
=
_have_cython
have_pyrex
=
_have_cython
_Extension
=
get_unpatched
(
distutils
.
core
.
Extension
)
_Extension
=
get_unpatched
(
distutils
.
core
.
Extension
)
...
...
setuptools/extern/__init__.py
View file @
31bd37c6
from
pkg_resources.extern
import
VendorImporter
from
pkg_resources.extern
import
VendorImporter
names
=
'six'
,
names
=
'six'
,
VendorImporter
(
__name__
,
names
,
'pkg_resources._vendor'
).
install
()
VendorImporter
(
__name__
,
names
,
'pkg_resources._vendor'
).
install
()
setuptools/glob.py
View file @
31bd37c6
...
@@ -14,6 +14,7 @@ from setuptools.extern.six import binary_type
...
@@ -14,6 +14,7 @@ from setuptools.extern.six import binary_type
__all__
=
[
"glob"
,
"iglob"
,
"escape"
]
__all__
=
[
"glob"
,
"iglob"
,
"escape"
]
def
glob
(
pathname
,
recursive
=
False
):
def
glob
(
pathname
,
recursive
=
False
):
"""Return a list of paths matching a pathname pattern.
"""Return a list of paths matching a pathname pattern.
...
@@ -27,6 +28,7 @@ def glob(pathname, recursive=False):
...
@@ -27,6 +28,7 @@ def glob(pathname, recursive=False):
"""
"""
return
list
(
iglob
(
pathname
,
recursive
=
recursive
))
return
list
(
iglob
(
pathname
,
recursive
=
recursive
))
def
iglob
(
pathname
,
recursive
=
False
):
def
iglob
(
pathname
,
recursive
=
False
):
"""Return an iterator which yields the paths matching a pathname pattern.
"""Return an iterator which yields the paths matching a pathname pattern.
...
@@ -44,6 +46,7 @@ def iglob(pathname, recursive=False):
...
@@ -44,6 +46,7 @@ def iglob(pathname, recursive=False):
assert
not
s
assert
not
s
return
it
return
it
def
_iglob
(
pathname
,
recursive
):
def
_iglob
(
pathname
,
recursive
):
dirname
,
basename
=
os
.
path
.
split
(
pathname
)
dirname
,
basename
=
os
.
path
.
split
(
pathname
)
if
not
has_magic
(
pathname
):
if
not
has_magic
(
pathname
):
...
@@ -81,10 +84,12 @@ def _iglob(pathname, recursive):
...
@@ -81,10 +84,12 @@ def _iglob(pathname, recursive):
for
name
in
glob_in_dir
(
dirname
,
basename
):
for
name
in
glob_in_dir
(
dirname
,
basename
):
yield
os
.
path
.
join
(
dirname
,
name
)
yield
os
.
path
.
join
(
dirname
,
name
)
# These 2 helper functions non-recursively glob inside a literal directory.
# These 2 helper functions non-recursively glob inside a literal directory.
# They return a list of basenames. `glob1` accepts a pattern while `glob0`
# They return a list of basenames. `glob1` accepts a pattern while `glob0`
# takes a literal basename (so it only has to check for its existence).
# takes a literal basename (so it only has to check for its existence).
def
glob1
(
dirname
,
pattern
):
def
glob1
(
dirname
,
pattern
):
if
not
dirname
:
if
not
dirname
:
if
isinstance
(
pattern
,
binary_type
):
if
isinstance
(
pattern
,
binary_type
):
...
@@ -97,6 +102,7 @@ def glob1(dirname, pattern):
...
@@ -97,6 +102,7 @@ def glob1(dirname, pattern):
return
[]
return
[]
return
fnmatch
.
filter
(
names
,
pattern
)
return
fnmatch
.
filter
(
names
,
pattern
)
def
glob0
(
dirname
,
basename
):
def
glob0
(
dirname
,
basename
):
if
not
basename
:
if
not
basename
:
# `os.path.split()` returns an empty basename for paths ending with a
# `os.path.split()` returns an empty basename for paths ending with a
...
@@ -108,9 +114,11 @@ def glob0(dirname, basename):
...
@@ -108,9 +114,11 @@ def glob0(dirname, basename):
return
[
basename
]
return
[
basename
]
return
[]
return
[]
# This helper function recursively yields relative pathnames inside a literal
# This helper function recursively yields relative pathnames inside a literal
# directory.
# directory.
def
glob2
(
dirname
,
pattern
):
def
glob2
(
dirname
,
pattern
):
assert
_isrecursive
(
pattern
)
assert
_isrecursive
(
pattern
)
yield
pattern
[:
0
]
yield
pattern
[:
0
]
...
@@ -139,6 +147,7 @@ def _rlistdir(dirname):
...
@@ -139,6 +147,7 @@ def _rlistdir(dirname):
magic_check
=
re
.
compile
(
'([*?[])'
)
magic_check
=
re
.
compile
(
'([*?[])'
)
magic_check_bytes
=
re
.
compile
(
b'([*?[])'
)
magic_check_bytes
=
re
.
compile
(
b'([*?[])'
)
def
has_magic
(
s
):
def
has_magic
(
s
):
if
isinstance
(
s
,
binary_type
):
if
isinstance
(
s
,
binary_type
):
match
=
magic_check_bytes
.
search
(
s
)
match
=
magic_check_bytes
.
search
(
s
)
...
@@ -146,12 +155,14 @@ def has_magic(s):
...
@@ -146,12 +155,14 @@ def has_magic(s):
match
=
magic_check
.
search
(
s
)
match
=
magic_check
.
search
(
s
)
return
match
is
not
None
return
match
is
not
None
def
_isrecursive
(
pattern
):
def
_isrecursive
(
pattern
):
if
isinstance
(
pattern
,
binary_type
):
if
isinstance
(
pattern
,
binary_type
):
return
pattern
==
b'**'
return
pattern
==
b'**'
else
:
else
:
return
pattern
==
'**'
return
pattern
==
'**'
def
escape
(
pathname
):
def
escape
(
pathname
):
"""Escape all special characters.
"""Escape all special characters.
"""
"""
...
...
setuptools/lib2to3_ex.py
View file @
31bd37c6
...
@@ -15,7 +15,6 @@ import setuptools
...
@@ -15,7 +15,6 @@ import setuptools
class
DistutilsRefactoringTool
(
RefactoringTool
):
class
DistutilsRefactoringTool
(
RefactoringTool
):
def
log_error
(
self
,
msg
,
*
args
,
**
kw
):
def
log_error
(
self
,
msg
,
*
args
,
**
kw
):
log
.
error
(
msg
,
*
args
)
log
.
error
(
msg
,
*
args
)
...
@@ -27,7 +26,6 @@ class DistutilsRefactoringTool(RefactoringTool):
...
@@ -27,7 +26,6 @@ class DistutilsRefactoringTool(RefactoringTool):
class
Mixin2to3
(
_Mixin2to3
):
class
Mixin2to3
(
_Mixin2to3
):
def
run_2to3
(
self
,
files
,
doctests
=
False
):
def
run_2to3
(
self
,
files
,
doctests
=
False
):
# See of the distribution option has been set, otherwise check the
# See of the distribution option has been set, otherwise check the
# setuptools default.
# setuptools default.
...
...
setuptools/monkey.py
View file @
31bd37c6
...
@@ -13,7 +13,6 @@ from setuptools.extern import six
...
@@ -13,7 +13,6 @@ from setuptools.extern import six
import
setuptools
import
setuptools
__all__
=
[]
__all__
=
[]
"""
"""
Everything is private. Contact the project team
Everything is private. Contact the project team
...
...
setuptools/msvc.py
View file @
31bd37c6
...
@@ -34,11 +34,13 @@ else:
...
@@ -34,11 +34,13 @@ else:
Mock winreg and environ so the module can be imported
Mock winreg and environ so the module can be imported
on this platform.
on this platform.
"""
"""
class
winreg
:
class
winreg
:
HKEY_USERS
=
None
HKEY_USERS
=
None
HKEY_CURRENT_USER
=
None
HKEY_CURRENT_USER
=
None
HKEY_LOCAL_MACHINE
=
None
HKEY_LOCAL_MACHINE
=
None
HKEY_CLASSES_ROOT
=
None
HKEY_CLASSES_ROOT
=
None
safe_env
=
dict
()
safe_env
=
dict
()
try
:
try
:
...
@@ -458,6 +460,7 @@ class SystemInfo:
...
@@ -458,6 +460,7 @@ class SystemInfo:
vc_ver: float
vc_ver: float
Required Microsoft Visual C++ version.
Required Microsoft Visual C++ version.
"""
"""
# Variables and properties in this class use originals CamelCase variables
# Variables and properties in this class use originals CamelCase variables
# names from Microsoft source files for more easy comparaison.
# names from Microsoft source files for more easy comparaison.
WinDir = safe_env.get('
WinDir
', '')
WinDir = safe_env.get('
WinDir
', '')
...
...
setuptools/package_index.py
View file @
31bd37c6
...
@@ -47,7 +47,6 @@ __all__ = [
...
@@ -47,7 +47,6 @@ __all__ = [
_SOCKET_TIMEOUT = 15
_SOCKET_TIMEOUT = 15
_tmpl = "setuptools/{setuptools.__version__} Python-urllib/{py_major}"
_tmpl = "setuptools/{setuptools.__version__} Python-urllib/{py_major}"
user_agent = _tmpl.format(py_major=sys.version[:3], **globals())
user_agent = _tmpl.format(py_major=sys.version[:3], **globals())
...
@@ -198,9 +197,11 @@ def unique_values(func):
...
@@ -198,9 +197,11 @@ def unique_values(func):
Wrap a function returning an iterable such that the resulting iterable
Wrap a function returning an iterable such that the resulting iterable
only ever yields unique items.
only ever yields unique items.
"""
"""
@wraps(func)
@wraps(func)
def wrapper(*args, **kwargs):
def wrapper(*args, **kwargs):
return unique_everseen(func(*args, **kwargs))
return unique_everseen(func(*args, **kwargs))
return wrapper
return wrapper
...
@@ -415,6 +416,7 @@ class PackageIndex(Environment):
...
@@ -415,6 +416,7 @@ class PackageIndex(Environment):
def process_index(self, url, page):
def process_index(self, url, page):
"""
Process
the
contents
of
a
PyPI
page
"""
"""
Process
the
contents
of
a
PyPI
page
"""
def scan(link):
def scan(link):
# Process a URL to see if it's for a package page
# Process a URL to see if it's for a package page
if link.startswith(self.index_url):
if link.startswith(self.index_url):
...
@@ -946,7 +948,9 @@ def socket_timeout(timeout=15):
...
@@ -946,7 +948,9 @@ def socket_timeout(timeout=15):
return func(*args, **kwargs)
return func(*args, **kwargs)
finally:
finally:
socket.setdefaulttimeout(old_timeout)
socket.setdefaulttimeout(old_timeout)
return _socket_timeout
return _socket_timeout
return _socket_timeout
return _socket_timeout
...
@@ -991,7 +995,6 @@ class Credential(object):
...
@@ -991,7 +995,6 @@ class Credential(object):
class PyPIConfig(configparser.RawConfigParser):
class PyPIConfig(configparser.RawConfigParser):
def __init__(self):
def __init__(self):
"""
"""
Load
from
~/
.
pypirc
Load
from
~/
.
pypirc
...
...
setuptools/py26compat.py
View file @
31bd37c6
...
@@ -23,9 +23,9 @@ def strip_fragment(url):
...
@@ -23,9 +23,9 @@ def strip_fragment(url):
if
sys
.
version_info
>=
(
2
,
7
):
if
sys
.
version_info
>=
(
2
,
7
):
strip_fragment
=
lambda
x
:
x
strip_fragment
=
lambda
x
:
x
try
:
try
:
from
importlib
import
import_module
from
importlib
import
import_module
except
ImportError
:
except
ImportError
:
def
import_module
(
module_name
):
def
import_module
(
module_name
):
return
__import__
(
module_name
,
fromlist
=
[
'__name__'
])
return
__import__
(
module_name
,
fromlist
=
[
'__name__'
])
setuptools/py27compat.py
View file @
31bd37c6
...
@@ -13,5 +13,6 @@ def get_all_headers(message, key):
...
@@ -13,5 +13,6 @@ def get_all_headers(message, key):
if
sys
.
version_info
<
(
3
,):
if
sys
.
version_info
<
(
3
,):
def
get_all_headers
(
message
,
key
):
def
get_all_headers
(
message
,
key
):
return
message
.
getheaders
(
key
)
return
message
.
getheaders
(
key
)
setuptools/py31compat.py
View file @
31bd37c6
...
@@ -14,6 +14,7 @@ except ImportError:
...
@@ -14,6 +14,7 @@ except ImportError:
raise
ValueError
(
"Name must be purelib or platlib"
)
raise
ValueError
(
"Name must be purelib or platlib"
)
return
get_python_lib
(
name
==
'platlib'
)
return
get_python_lib
(
name
==
'platlib'
)
try
:
try
:
# Python >=3.2
# Python >=3.2
from
tempfile
import
TemporaryDirectory
from
tempfile
import
TemporaryDirectory
...
...
setuptools/sandbox.py
View file @
31bd37c6
...
@@ -99,6 +99,7 @@ class UnpickleableException(Exception):
...
@@ -99,6 +99,7 @@ class UnpickleableException(Exception):
"""
"""
An exception representing another Exception that could not be pickled.
An exception representing another Exception that could not be pickled.
"""
"""
@
staticmethod
@
staticmethod
def
dump
(
type
,
exc
):
def
dump
(
type
,
exc
):
"""
"""
...
@@ -243,6 +244,7 @@ def run_setup(setup_script, args):
...
@@ -243,6 +244,7 @@ def run_setup(setup_script, args):
def runner():
def runner():
ns = dict(__file__=setup_script, __name__='__main__')
ns = dict(__file__=setup_script, __name__='__main__')
_execfile(setup_script, ns)
_execfile(setup_script, ns)
DirectorySandbox(setup_dir).run(runner)
DirectorySandbox(setup_dir).run(runner)
except SystemExit as v:
except SystemExit as v:
if v.args and v.args[0]:
if v.args and v.args[0]:
...
@@ -301,6 +303,7 @@ class AbstractSandbox:
...
@@ -301,6 +303,7 @@ class AbstractSandbox:
if self._active:
if self._active:
path = self._remap_input(name, path, *args, **kw)
path = self._remap_input(name, path, *args, **kw)
return original(path, *args, **kw)
return original(path, *args, **kw)
return wrap
return wrap
if _file:
if _file:
...
@@ -322,6 +325,7 @@ class AbstractSandbox:
...
@@ -322,6 +325,7 @@ class AbstractSandbox:
path = self._remap_input(name, path, *args, **kw)
path = self._remap_input(name, path, *args, **kw)
return self._remap_output(name, original(path, *args, **kw))
return self._remap_output(name, original(path, *args, **kw))
return original(path, *args, **kw)
return original(path, *args, **kw)
return wrap
return wrap
for name in ['readlink', 'tempnam']:
for name in ['readlink', 'tempnam']:
...
@@ -336,6 +340,7 @@ class AbstractSandbox:
...
@@ -336,6 +340,7 @@ class AbstractSandbox:
if self._active:
if self._active:
return self._remap_output(name, retval)
return self._remap_output(name, retval)
return retval
return retval
return wrap
return wrap
for name in ['getcwd', 'tmpnam']:
for name in ['getcwd', 'tmpnam']:
...
@@ -404,6 +409,7 @@ class DirectorySandbox(AbstractSandbox):
...
@@ -404,6 +409,7 @@ class DirectorySandbox(AbstractSandbox):
raise SandboxViolation(operation, args, kw)
raise SandboxViolation(operation, args, kw)
if _file:
if _file:
def _file(self, path, mode='r', *args, **kw):
def _file(self, path, mode='r', *args, **kw):
if mode not in ('r', 'rt', 'rb', 'rU', 'U') and not self._ok(path):
if mode not in ('r', 'rt', 'rb', 'rU', 'U') and not self._ok(path):
self._violation("file", path, mode, *args, **kw)
self._violation("file", path, mode, *args, **kw)
...
...
setuptools/ssl_support.py
View file @
31bd37c6
...
@@ -29,7 +29,6 @@ cert_paths = """
...
@@ -29,7 +29,6 @@ cert_paths = """
/etc/ssl/ca-bundle.pem
/etc/ssl/ca-bundle.pem
"""
.
strip
().
split
()
"""
.
strip
().
split
()
try
:
try
:
HTTPSHandler
=
urllib
.
request
.
HTTPSHandler
HTTPSHandler
=
urllib
.
request
.
HTTPSHandler
HTTPSConnection
=
http_client
.
HTTPSConnection
HTTPSConnection
=
http_client
.
HTTPSConnection
...
@@ -50,10 +49,13 @@ except ImportError:
...
@@ -50,10 +49,13 @@ except ImportError:
match_hostname
=
None
match_hostname
=
None
if
not
CertificateError
:
if
not
CertificateError
:
class
CertificateError
(
ValueError
):
class
CertificateError
(
ValueError
):
pass
pass
if
not
match_hostname
:
if
not
match_hostname
:
def
_dnsname_match
(
dn
,
hostname
,
max_wildcards
=
1
):
def
_dnsname_match
(
dn
,
hostname
,
max_wildcards
=
1
):
"""Matching according to RFC 6125, section 6.4.3
"""Matching according to RFC 6125, section 6.4.3
...
@@ -216,7 +218,6 @@ def get_win_certfile():
...
@@ -216,7 +218,6 @@ def get_win_certfile():
return None
return None
class MyCertFile(CertFile):
class MyCertFile(CertFile):
def __init__(self, stores=(), certs=()):
def __init__(self, stores=(), certs=()):
CertFile.__init__(self)
CertFile.__init__(self)
for store in stores:
for store in stores:
...
...
setuptools/tests/__init__.py
View file @
31bd37c6
...
@@ -42,7 +42,6 @@ needs_bytecode = pytest.mark.skipif(
...
@@ -42,7 +42,6 @@ needs_bytecode = pytest.mark.skipif(
class
TestDepends
:
class
TestDepends
:
def
testExtractConst
(
self
):
def
testExtractConst
(
self
):
if
not
hasattr
(
dep
,
'extract_constant'
):
if
not
hasattr
(
dep
,
'extract_constant'
):
# skip on non-bytecode platforms
# skip on non-bytecode platforms
...
@@ -123,7 +122,6 @@ class TestDepends:
...
@@ -123,7 +122,6 @@ class TestDepends:
class
TestDistro
:
class
TestDistro
:
def
setup_method
(
self
,
method
):
def
setup_method
(
self
,
method
):
self
.
e1
=
Extension
(
'bar.ext'
,
[
'bar.c'
])
self
.
e1
=
Extension
(
'bar.ext'
,
[
'bar.c'
])
self
.
e2
=
Extension
(
'c.y'
,
[
'y.c'
])
self
.
e2
=
Extension
(
'c.y'
,
[
'y.c'
])
...
@@ -214,7 +212,6 @@ class TestDistro:
...
@@ -214,7 +212,6 @@ class TestDistro:
class
TestFeatures
:
class
TestFeatures
:
def
setup_method
(
self
,
method
):
def
setup_method
(
self
,
method
):
self
.
req
=
Require
(
'Distutils'
,
'1.0.3'
,
'distutils'
)
self
.
req
=
Require
(
'Distutils'
,
'1.0.3'
,
'distutils'
)
self
.
dist
=
makeSetup
(
self
.
dist
=
makeSetup
(
...
@@ -292,7 +289,6 @@ class TestFeatures:
...
@@ -292,7 +289,6 @@ class TestFeatures:
class
TestCommandTests
:
class
TestCommandTests
:
def
testTestIsCommand
(
self
):
def
testTestIsCommand
(
self
):
test_cmd
=
makeSetup
().
get_command_obj
(
'test'
)
test_cmd
=
makeSetup
().
get_command_obj
(
'test'
)
assert
(
isinstance
(
test_cmd
,
distutils
.
cmd
.
Command
))
assert
(
isinstance
(
test_cmd
,
distutils
.
cmd
.
Command
))
...
...
setuptools/tests/server.py
View file @
31bd37c6
...
@@ -45,7 +45,6 @@ class IndexServer(BaseHTTPServer.HTTPServer):
...
@@ -45,7 +45,6 @@ class IndexServer(BaseHTTPServer.HTTPServer):
class
RequestRecorder
(
BaseHTTPServer
.
BaseHTTPRequestHandler
):
class
RequestRecorder
(
BaseHTTPServer
.
BaseHTTPRequestHandler
):
def
do_GET
(
self
):
def
do_GET
(
self
):
requests
=
vars
(
self
.
server
).
setdefault
(
'requests'
,
[])
requests
=
vars
(
self
.
server
).
setdefault
(
'requests'
,
[])
requests
.
append
(
self
)
requests
.
append
(
self
)
...
...
setuptools/tests/test_bdist_egg.py
View file @
31bd37c6
...
@@ -9,7 +9,6 @@ from setuptools.dist import Distribution
...
@@ -9,7 +9,6 @@ from setuptools.dist import Distribution
from
.
import
contexts
from
.
import
contexts
SETUP_PY
=
"""
\
SETUP_PY
=
"""
\
from setuptools import setup
from setuptools import setup
...
@@ -28,7 +27,6 @@ def setup_context(tmpdir):
...
@@ -28,7 +27,6 @@ def setup_context(tmpdir):
class
Test
:
class
Test
:
def
test_bdist_egg
(
self
,
setup_context
,
user_override
):
def
test_bdist_egg
(
self
,
setup_context
,
user_override
):
dist
=
Distribution
(
dict
(
dist
=
Distribution
(
dict
(
script_name
=
'setup.py'
,
script_name
=
'setup.py'
,
...
...
setuptools/tests/test_build_ext.py
View file @
31bd37c6
...
@@ -10,7 +10,6 @@ from setuptools.extension import Extension
...
@@ -10,7 +10,6 @@ from setuptools.extension import Extension
class
TestBuildExt
:
class
TestBuildExt
:
def
test_get_ext_filename
(
self
):
def
test_get_ext_filename
(
self
):
"""
"""
Setuptools needs to give back the same
Setuptools needs to give back the same
...
...
setuptools/tests/test_develop.py
View file @
31bd37c6
...
@@ -13,7 +13,6 @@ from setuptools.command.develop import develop
...
@@ -13,7 +13,6 @@ from setuptools.command.develop import develop
from
setuptools.dist
import
Distribution
from
setuptools.dist
import
Distribution
from
.
import
contexts
from
.
import
contexts
SETUP_PY
=
"""
\
SETUP_PY
=
"""
\
from setuptools import setup
from setuptools import setup
...
...
setuptools/tests/test_easy_install.py
View file @
31bd37c6
# -*- coding: utf-8 -*-
# -*- coding: utf-8 -*-
"""Easy install Tests
"""Easy install Tests
"""
"""
from
__future__
import
absolute_import
from
__future__
import
absolute_import
...
@@ -42,7 +41,6 @@ from .textwrap import DALS
...
@@ -42,7 +41,6 @@ from .textwrap import DALS
class
FakeDist
(
object
):
class
FakeDist
(
object
):
def
get_entry_map
(
self
,
group
):
def
get_entry_map
(
self
,
group
):
if
group
!=
'console_scripts'
:
if
group
!=
'console_scripts'
:
return
{}
return
{}
...
@@ -60,7 +58,6 @@ SETUP_PY = DALS("""
...
@@ -60,7 +58,6 @@ SETUP_PY = DALS("""
class
TestEasyInstallTest
:
class
TestEasyInstallTest
:
def
test_install_site_py
(
self
,
tmpdir
):
def
test_install_site_py
(
self
,
tmpdir
):
dist
=
Distribution
()
dist
=
Distribution
()
cmd
=
ei
.
easy_install
(
dist
)
cmd
=
ei
.
easy_install
(
dist
)
...
@@ -194,7 +191,6 @@ class TestEasyInstallTest:
...
@@ -194,7 +191,6 @@ class TestEasyInstallTest:
class
TestPTHFileWriter
:
class
TestPTHFileWriter
:
def
test_add_from_cwd_site_sets_dirty
(
self
):
def
test_add_from_cwd_site_sets_dirty
(
self
):
'''a pth file manager should set dirty
'''a pth file manager should set dirty
if a distribution is in site but also the cwd
if a distribution is in site but also the cwd
...
@@ -328,13 +324,11 @@ def distutils_package():
...
@@ -328,13 +324,11 @@ def distutils_package():
class
TestDistutilsPackage
:
class
TestDistutilsPackage
:
def
test_bdist_egg_available_on_distutils_pkg
(
self
,
distutils_package
):
def
test_bdist_egg_available_on_distutils_pkg
(
self
,
distutils_package
):
run_setup
(
'setup.py'
,
[
'bdist_egg'
])
run_setup
(
'setup.py'
,
[
'bdist_egg'
])
class
TestSetupRequires
:
class
TestSetupRequires
:
def
test_setup_requires_honors_fetch_params
(
self
):
def
test_setup_requires_honors_fetch_params
(
self
):
"""
"""
When easy_install installs a source distribution which specifies
When easy_install installs a source distribution which specifies
...
@@ -623,7 +617,6 @@ class TestScriptHeader:
...
@@ -623,7 +617,6 @@ class TestScriptHeader:
class
TestCommandSpec
:
class
TestCommandSpec
:
def
test_custom_launch_command
(
self
):
def
test_custom_launch_command
(
self
):
"""
"""
Show how a custom CommandSpec could be used to specify a #! executable
Show how a custom CommandSpec could be used to specify a #! executable
...
@@ -659,7 +652,6 @@ class TestCommandSpec:
...
@@ -659,7 +652,6 @@ class TestCommandSpec:
class
TestWindowsScriptWriter
:
class
TestWindowsScriptWriter
:
def
test_header
(
self
):
def
test_header
(
self
):
hdr
=
ei
.
WindowsScriptWriter
.
get_script_header
(
''
)
hdr
=
ei
.
WindowsScriptWriter
.
get_script_header
(
''
)
assert
hdr
.
startswith
(
'#!'
)
assert
hdr
.
startswith
(
'#!'
)
...
...
setuptools/tests/test_egg_info.py
View file @
31bd37c6
...
@@ -262,7 +262,6 @@ class TestEggInfo(object):
...
@@ -262,7 +262,6 @@ class TestEggInfo(object):
def
_find_egg_info_files
(
self
,
root
):
def
_find_egg_info_files
(
self
,
root
):
class
DirList
(
list
):
class
DirList
(
list
):
def
__init__
(
self
,
files
,
base
):
def
__init__
(
self
,
files
,
base
):
super
(
DirList
,
self
).
__init__
(
files
)
super
(
DirList
,
self
).
__init__
(
files
)
self
.
base
=
base
self
.
base
=
base
...
...
setuptools/tests/test_find_packages.py
View file @
31bd37c6
...
@@ -38,7 +38,6 @@ def has_symlink():
...
@@ -38,7 +38,6 @@ def has_symlink():
class
TestFindPackages
:
class
TestFindPackages
:
def
setup_method
(
self
,
method
):
def
setup_method
(
self
,
method
):
self
.
dist_dir
=
tempfile
.
mkdtemp
()
self
.
dist_dir
=
tempfile
.
mkdtemp
()
self
.
_make_pkg_structure
()
self
.
_make_pkg_structure
()
...
...
setuptools/tests/test_integration.py
View file @
31bd37c6
...
@@ -49,6 +49,7 @@ def install_context(request, tmpdir, monkeypatch):
...
@@ -49,6 +49,7 @@ def install_context(request, tmpdir, monkeypatch):
user_base
.
remove
()
user_base
.
remove
()
user_site
.
remove
()
user_site
.
remove
()
install_dir
.
remove
()
install_dir
.
remove
()
request
.
addfinalizer
(
fin
)
request
.
addfinalizer
(
fin
)
# Change the environment and site settings to control where the
# Change the environment and site settings to control where the
...
...
setuptools/tests/test_manifest.py
View file @
31bd37c6
...
@@ -30,7 +30,6 @@ SETUP_ATTRS = {
...
@@ -30,7 +30,6 @@ SETUP_ATTRS = {
'packages'
:
[
'app'
],
'packages'
:
[
'app'
],
}
}
SETUP_PY
=
"""
\
SETUP_PY
=
"""
\
from setuptools import setup
from setuptools import setup
...
@@ -95,7 +94,6 @@ def test_translated_pattern_test():
...
@@ -95,7 +94,6 @@ def test_translated_pattern_test():
class TempDirTestCase(object):
class TempDirTestCase(object):
def setup_method(self, method):
def setup_method(self, method):
self.temp_dir = tempfile.mkdtemp()
self.temp_dir = tempfile.mkdtemp()
self.old_cwd = os.getcwd()
self.old_cwd = os.getcwd()
...
@@ -107,14 +105,12 @@ class TempDirTestCase(object):
...
@@ -107,14 +105,12 @@ class TempDirTestCase(object):
class TestManifestTest(TempDirTestCase):
class TestManifestTest(TempDirTestCase):
def setup_method(self, method):
def setup_method(self, method):
super(TestManifestTest, self).setup_method(method)
super(TestManifestTest, self).setup_method(method)
f = open(os.path.join(self.temp_dir, '
setup
.
py
'), '
w
')
f = open(os.path.join(self.temp_dir, '
setup
.
py
'), '
w
')
f.write(SETUP_PY)
f.write(SETUP_PY)
f.close()
f.close()
"""
"""
Create a file tree like:
Create a file tree like:
- LICENSE
- LICENSE
...
...
setuptools/tests/test_packageindex.py
View file @
31bd37c6
...
@@ -14,7 +14,6 @@ from .textwrap import DALS
...
@@ -14,7 +14,6 @@ from .textwrap import DALS
class
TestPackageIndex
:
class
TestPackageIndex
:
def
test_regex
(
self
):
def
test_regex
(
self
):
hash_url
=
'http://other_url?:action=show_md5&'
hash_url
=
'http://other_url?:action=show_md5&'
hash_url
+=
'digest=0123456789abcdef0123456789abcdef'
hash_url
+=
'digest=0123456789abcdef0123456789abcdef'
...
@@ -184,7 +183,6 @@ class TestPackageIndex:
...
@@ -184,7 +183,6 @@ class TestPackageIndex:
class
TestContentCheckers
:
class
TestContentCheckers
:
def
test_md5
(
self
):
def
test_md5
(
self
):
checker
=
setuptools
.
package_index
.
HashChecker
.
from_url
(
checker
=
setuptools
.
package_index
.
HashChecker
.
from_url
(
'http://foo/bar#md5=f12895fdffbd45007040d2e44df98478'
)
'http://foo/bar#md5=f12895fdffbd45007040d2e44df98478'
)
...
@@ -219,7 +217,6 @@ class TestContentCheckers:
...
@@ -219,7 +217,6 @@ class TestContentCheckers:
class
TestPyPIConfig
:
class
TestPyPIConfig
:
def
test_percent_in_password
(
self
,
tmpdir
,
monkeypatch
):
def
test_percent_in_password
(
self
,
tmpdir
,
monkeypatch
):
monkeypatch
.
setitem
(
os
.
environ
,
'HOME'
,
str
(
tmpdir
))
monkeypatch
.
setitem
(
os
.
environ
,
'HOME'
,
str
(
tmpdir
))
pypirc
=
tmpdir
/
'.pypirc'
pypirc
=
tmpdir
/
'.pypirc'
...
...
setuptools/tests/test_sandbox.py
View file @
31bd37c6
...
@@ -11,7 +11,6 @@ from setuptools.sandbox import DirectorySandbox
...
@@ -11,7 +11,6 @@ from setuptools.sandbox import DirectorySandbox
class
TestSandbox
:
class
TestSandbox
:
def
test_devnull
(
self
,
tmpdir
):
def
test_devnull
(
self
,
tmpdir
):
sandbox
=
DirectorySandbox
(
str
(
tmpdir
))
sandbox
=
DirectorySandbox
(
str
(
tmpdir
))
sandbox
.
run
(
self
.
_file_writer
(
os
.
devnull
))
sandbox
.
run
(
self
.
_file_writer
(
os
.
devnull
))
...
@@ -21,6 +20,7 @@ class TestSandbox:
...
@@ -21,6 +20,7 @@ class TestSandbox:
def
do_write
():
def
do_write
():
with
open
(
path
,
'w'
)
as
f
:
with
open
(
path
,
'w'
)
as
f
:
f
.
write
(
'xxx'
)
f
.
write
(
'xxx'
)
return
do_write
return
do_write
def
test_win32com
(
self
,
tmpdir
):
def
test_win32com
(
self
,
tmpdir
):
...
@@ -57,7 +57,6 @@ class TestSandbox:
...
@@ -57,7 +57,6 @@ class TestSandbox:
class
TestExceptionSaver
:
class
TestExceptionSaver
:
def
test_exception_trapped
(
self
):
def
test_exception_trapped
(
self
):
with
setuptools
.
sandbox
.
ExceptionSaver
():
with
setuptools
.
sandbox
.
ExceptionSaver
():
raise
ValueError
(
"details"
)
raise
ValueError
(
"details"
)
...
@@ -107,6 +106,7 @@ class TestExceptionSaver:
...
@@ -107,6 +106,7 @@ class TestExceptionSaver:
As revealed in #440, an infinite recursion can occur if an unpickleable
As revealed in #440, an infinite recursion can occur if an unpickleable
exception while setuptools is hidden. Ensure this doesn't happen.
exception while setuptools is hidden. Ensure this doesn't happen.
"""
"""
class
ExceptionUnderTest
(
Exception
):
class
ExceptionUnderTest
(
Exception
):
"""
"""
An unpickleable exception (not in globals).
An unpickleable exception (not in globals).
...
@@ -126,10 +126,12 @@ class TestExceptionSaver:
...
@@ -126,10 +126,12 @@ class TestExceptionSaver:
should reflect a proper exception and not be wrapped in
should reflect a proper exception and not be wrapped in
an UnpickleableException.
an UnpickleableException.
"""
"""
def
write_file
():
def
write_file
():
"Trigger a SandboxViolation by writing outside the sandbox"
"Trigger a SandboxViolation by writing outside the sandbox"
with
open
(
'/etc/foo'
,
'w'
):
with
open
(
'/etc/foo'
,
'w'
):
pass
pass
sandbox
=
DirectorySandbox
(
str
(
tmpdir
))
sandbox
=
DirectorySandbox
(
str
(
tmpdir
))
with
pytest
.
raises
(
setuptools
.
sandbox
.
SandboxViolation
)
as
caught
:
with
pytest
.
raises
(
setuptools
.
sandbox
.
SandboxViolation
)
as
caught
:
with
setuptools
.
sandbox
.
save_modules
():
with
setuptools
.
sandbox
.
save_modules
():
...
...
setuptools/tests/test_sdist.py
View file @
31bd37c6
...
@@ -20,10 +20,8 @@ from setuptools.command.egg_info import manifest_maker
...
@@ -20,10 +20,8 @@ from setuptools.command.egg_info import manifest_maker
from
setuptools.dist
import
Distribution
from
setuptools.dist
import
Distribution
from
setuptools.tests
import
fail_on_ascii
from
setuptools.tests
import
fail_on_ascii
py3_only
=
pytest
.
mark
.
xfail
(
six
.
PY2
,
reason
=
"Test runs on Python 3 only"
)
py3_only
=
pytest
.
mark
.
xfail
(
six
.
PY2
,
reason
=
"Test runs on Python 3 only"
)
SETUP_ATTRS
=
{
SETUP_ATTRS
=
{
'name'
:
'sdist_test'
,
'name'
:
'sdist_test'
,
'version'
:
'0.0'
,
'version'
:
'0.0'
,
...
@@ -31,14 +29,12 @@ SETUP_ATTRS = {
...
@@ -31,14 +29,12 @@ SETUP_ATTRS = {
'package_data'
:
{
'sdist_test'
:
[
'*.txt'
]}
'package_data'
:
{
'sdist_test'
:
[
'*.txt'
]}
}
}
SETUP_PY
=
"""
\
SETUP_PY
=
"""
\
from setuptools import setup
from setuptools import setup
setup(**%r)
setup(**%r)
"""
%
SETUP_ATTRS
"""
%
SETUP_ATTRS
if
six
.
PY3
:
if
six
.
PY3
:
LATIN1_FILENAME
=
'smörbröd.py'
.
encode
(
'latin-1'
)
LATIN1_FILENAME
=
'smörbröd.py'
.
encode
(
'latin-1'
)
else
:
else
:
...
@@ -90,7 +86,6 @@ def read_all_bytes(filename):
...
@@ -90,7 +86,6 @@ def read_all_bytes(filename):
class
TestSdistTest
:
class
TestSdistTest
:
def
setup_method
(
self
,
method
):
def
setup_method
(
self
,
method
):
self
.
temp_dir
=
tempfile
.
mkdtemp
()
self
.
temp_dir
=
tempfile
.
mkdtemp
()
f
=
open
(
os
.
path
.
join
(
self
.
temp_dir
,
'setup.py'
),
'w'
)
f
=
open
(
os
.
path
.
join
(
self
.
temp_dir
,
'setup.py'
),
'w'
)
...
...
setuptools/tests/test_test.py
View file @
31bd37c6
...
@@ -70,7 +70,6 @@ def sample_test(tmpdir_cwd):
...
@@ -70,7 +70,6 @@ def sample_test(tmpdir_cwd):
@
pytest
.
mark
.
usefixtures
(
'user_override'
)
@
pytest
.
mark
.
usefixtures
(
'user_override'
)
@
pytest
.
mark
.
usefixtures
(
'sample_test'
)
@
pytest
.
mark
.
usefixtures
(
'sample_test'
)
class
TestTestTest
:
class
TestTestTest
:
def
test_test
(
self
):
def
test_test
(
self
):
params
=
dict
(
params
=
dict
(
name
=
'foo'
,
name
=
'foo'
,
...
...
setuptools/tests/test_upload_docs.py
View file @
31bd37c6
...
@@ -10,7 +10,6 @@ from setuptools.dist import Distribution
...
@@ -10,7 +10,6 @@ from setuptools.dist import Distribution
from
.textwrap
import
DALS
from
.textwrap
import
DALS
from
.
import
contexts
from
.
import
contexts
SETUP_PY
=
DALS
(
SETUP_PY
=
DALS
(
"""
"""
from setuptools import setup
from setuptools import setup
...
@@ -38,7 +37,6 @@ def sample_project(tmpdir_cwd):
...
@@ -38,7 +37,6 @@ def sample_project(tmpdir_cwd):
@
pytest
.
mark
.
usefixtures
(
'sample_project'
)
@
pytest
.
mark
.
usefixtures
(
'sample_project'
)
@
pytest
.
mark
.
usefixtures
(
'user_override'
)
@
pytest
.
mark
.
usefixtures
(
'user_override'
)
class
TestUploadDocsTest
:
class
TestUploadDocsTest
:
def
test_create_zipfile
(
self
):
def
test_create_zipfile
(
self
):
"""
"""
Ensure zipfile creation handles common cases, including a folder
Ensure zipfile creation handles common cases, including a folder
...
...
setuptools/tests/test_windows_wrappers.py
View file @
31bd37c6
...
@@ -23,12 +23,10 @@ import pytest
...
@@ -23,12 +23,10 @@ import pytest
from
setuptools.command.easy_install
import
nt_quote_arg
from
setuptools.command.easy_install
import
nt_quote_arg
import
pkg_resources
import
pkg_resources
pytestmark
=
pytest
.
mark
.
skipif
(
sys
.
platform
!=
'win32'
,
reason
=
"Windows only"
)
pytestmark
=
pytest
.
mark
.
skipif
(
sys
.
platform
!=
'win32'
,
reason
=
"Windows only"
)
class
WrapperTester
:
class
WrapperTester
:
@
classmethod
@
classmethod
def
prep_script
(
cls
,
template
):
def
prep_script
(
cls
,
template
):
python_exe
=
nt_quote_arg
(
sys
.
executable
)
python_exe
=
nt_quote_arg
(
sys
.
executable
)
...
...
tests/manual_test.py
View file @
31bd37c6
...
@@ -25,6 +25,7 @@ def tempdir(func):
...
@@ -25,6 +25,7 @@ def tempdir(func):
finally
:
finally
:
os
.
chdir
(
old_dir
)
os
.
chdir
(
old_dir
)
shutil
.
rmtree
(
test_dir
)
shutil
.
rmtree
(
test_dir
)
return
_tempdir
return
_tempdir
...
...
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