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
2885ca26
Commit
2885ca26
authored
Jan 23, 2021
by
Jason R. Coombs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove 'main' function from 'easy_install'.
parent
4b0408a1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
52 deletions
+7
-52
setuptools/command/easy_install.py
setuptools/command/easy_install.py
+1
-45
setuptools/tests/test_easy_install.py
setuptools/tests/test_easy_install.py
+6
-7
No files found.
setuptools/command/easy_install.py
View file @
2885ca26
...
...
@@ -67,7 +67,7 @@ warnings.filterwarnings("default", category=pkg_resources.PEP440Warning)
__all__
=
[
'samefile'
,
'easy_install'
,
'PthDistributions'
,
'extract_wininst_cfg'
,
'
main'
,
'
get_exe_prefixes'
,
'get_exe_prefixes'
,
]
...
...
@@ -2284,50 +2284,6 @@ def current_umask():
return
tmp
def
main
(
argv
=
None
,
**
kw
):
from
setuptools
import
setup
from
setuptools.dist
import
Distribution
class
DistributionWithoutHelpCommands
(
Distribution
):
common_usage
=
""
def
_show_help
(
self
,
*
args
,
**
kw
):
with
_patch_usage
():
Distribution
.
_show_help
(
self
,
*
args
,
**
kw
)
if
argv
is
None
:
argv
=
sys
.
argv
[
1
:]
with
_patch_usage
():
setup
(
script_args
=
[
'-q'
,
'easy_install'
,
'-v'
]
+
argv
,
script_name
=
sys
.
argv
[
0
]
or
'easy_install'
,
distclass
=
DistributionWithoutHelpCommands
,
**
kw
)
@
contextlib
.
contextmanager
def
_patch_usage
():
import
distutils.core
USAGE
=
textwrap
.
dedent
(
"""
usage: %(script)s [options] requirement_or_url ...
or: %(script)s --help
"""
).
lstrip
()
def
gen_usage
(
script_name
):
return
USAGE
%
dict
(
script
=
os
.
path
.
basename
(
script_name
),
)
saved
=
distutils
.
core
.
gen_usage
distutils
.
core
.
gen_usage
=
gen_usage
try
:
yield
finally
:
distutils
.
core
.
gen_usage
=
saved
class
EasyInstallDeprecationWarning
(
SetuptoolsDeprecationWarning
):
"""
Warning for EasyInstall deprecations, bypassing suppression.
...
...
setuptools/tests/test_easy_install.py
View file @
2885ca26
...
...
@@ -15,6 +15,7 @@ import zipfile
import
mock
import
time
import
re
import
subprocess
import
pytest
...
...
@@ -25,7 +26,6 @@ from setuptools.command.easy_install import (
EasyInstallDeprecationWarning
,
ScriptWriter
,
PthDistributions
,
WindowsScriptWriter
,
)
from
setuptools.command
import
easy_install
as
easy_install_pkg
from
setuptools.dist
import
Distribution
from
pkg_resources
import
normalize_path
,
working_set
from
pkg_resources
import
Distribution
as
PRDistribution
...
...
@@ -461,17 +461,16 @@ class TestSetupRequires:
with
TestSetupRequires
.
create_sdist
()
as
dist_file
:
with
contexts
.
tempdir
()
as
temp_install_dir
:
with
contexts
.
environment
(
PYTHONPATH
=
temp_install_dir
):
ei_params
=
[
cmd
=
[
sys
.
executable
,
'-m'
,
'setup'
,
'easy_install'
,
'--index-url'
,
mock_index
.
url
,
'--exclude-scripts'
,
'--install-dir'
,
temp_install_dir
,
dist_file
,
]
with
sandbox
.
save_argv
([
'easy_install'
]):
# attempt to install the dist. It should
# fail because it doesn't exist.
with
pytest
.
raises
(
SystemExit
):
easy_install_pkg
.
main
(
ei_params
)
subprocess
.
Popen
(
cmd
).
wait
()
# there should have been one requests to the server
assert
[
r
.
path
for
r
in
mock_index
.
requests
]
==
[
'/does-not-exist/'
]
...
...
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