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
fbb70540
Commit
fbb70540
authored
Jan 17, 2021
by
Jason R. Coombs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove support for easy_install-based downloads for fetch_build_eggs (setup_requires).
parent
6b44f948
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
56 deletions
+5
-56
setuptools/installer.py
setuptools/installer.py
+1
-45
setuptools/tests/test_easy_install.py
setuptools/tests/test_easy_install.py
+4
-6
setuptools/tests/test_virtualenv.py
setuptools/tests/test_virtualenv.py
+0
-5
No files found.
setuptools/installer.py
View file @
fbb70540
...
...
@@ -7,7 +7,6 @@ from distutils import log
from
distutils.errors
import
DistutilsError
import
pkg_resources
from
setuptools.command.easy_install
import
easy_install
from
setuptools.wheel
import
Wheel
...
...
@@ -19,54 +18,11 @@ def _fixup_find_links(find_links):
return
find_links
def
_legacy_fetch_build_egg
(
dist
,
req
):
"""Fetch an egg needed for building.
Legacy path using EasyInstall.
"""
tmp_dist
=
dist
.
__class__
({
'script_args'
:
[
'easy_install'
]})
opts
=
tmp_dist
.
get_option_dict
(
'easy_install'
)
opts
.
clear
()
opts
.
update
(
(
k
,
v
)
for
k
,
v
in
dist
.
get_option_dict
(
'easy_install'
).
items
()
if
k
in
(
# don't use any other settings
'find_links'
,
'site_dirs'
,
'index_url'
,
'optimize'
,
'site_dirs'
,
'allow_hosts'
,
))
if
dist
.
dependency_links
:
links
=
dist
.
dependency_links
[:]
if
'find_links'
in
opts
:
links
=
_fixup_find_links
(
opts
[
'find_links'
][
1
])
+
links
opts
[
'find_links'
]
=
(
'setup'
,
links
)
install_dir
=
dist
.
get_egg_cache_dir
()
cmd
=
easy_install
(
tmp_dist
,
args
=
[
"x"
],
install_dir
=
install_dir
,
exclude_scripts
=
True
,
always_copy
=
False
,
build_directory
=
None
,
editable
=
False
,
upgrade
=
False
,
multi_version
=
True
,
no_report
=
True
,
user
=
False
)
cmd
.
ensure_finalized
()
return
cmd
.
easy_install
(
req
)
def
fetch_build_egg
(
dist
,
req
):
# noqa: C901 # is too complex (16) # FIXME
"""Fetch an egg needed for building.
Use pip/wheel to fetch/build a wheel."""
# Check pip is available.
try
:
pkg_resources
.
get_distribution
(
'pip'
)
except
pkg_resources
.
DistributionNotFound
:
dist
.
announce
(
'WARNING: The pip package is not available, falling back '
'to EasyInstall for handling setup_requires/test_requires; '
'this is deprecated and will be removed in a future version.'
,
log
.
WARN
)
return
_legacy_fetch_build_egg
(
dist
,
req
)
# Warn if wheel is not.
# Warn if wheel is not available
try
:
pkg_resources
.
get_distribution
(
'wheel'
)
except
pkg_resources
.
DistributionNotFound
:
...
...
setuptools/tests/test_easy_install.py
View file @
fbb70540
...
...
@@ -742,10 +742,10 @@ class TestSetupRequires:
assert
eggs
==
[
'dep 1.0'
]
@
pytest
.
mark
.
parametrize
(
'
use_legacy_installer,
with_dependency_links_in_setup_py'
,
itertools
.
product
((
False
,
True
),
(
False
,
True
)
))
'with_dependency_links_in_setup_py'
,
(
False
,
True
))
def
test_setup_requires_with_find_links_in_setup_cfg
(
self
,
monkeypatch
,
use_legacy_installer
,
self
,
monkeypatch
,
with_dependency_links_in_setup_py
):
monkeypatch
.
setenv
(
str
(
'PIP_RETRIES'
),
str
(
'0'
))
monkeypatch
.
setenv
(
str
(
'PIP_TIMEOUT'
),
str
(
'0'
))
...
...
@@ -767,11 +767,9 @@ class TestSetupRequires:
fp
.
write
(
DALS
(
'''
from setuptools import installer, setup
if {use_legacy_installer}:
installer.fetch_build_egg = installer._legacy_fetch_build_egg
setup(setup_requires='python-xlib==42',
dependency_links={dependency_links!r})
'''
).
format
(
use_legacy_installer
=
use_legacy_installer
,
# noqa
'''
).
format
(
dependency_links
=
dependency_links
))
with
open
(
test_setup_cfg
,
'w'
)
as
fp
:
fp
.
write
(
DALS
(
...
...
setuptools/tests/test_virtualenv.py
View file @
fbb70540
...
...
@@ -186,11 +186,6 @@ def test_test_command_install_requirements(virtualenv, tmpdir):
_check_test_command_install_requirements
(
virtualenv
,
tmpdir
)
def
test_test_command_install_requirements_when_using_easy_install
(
bare_virtualenv
,
tmpdir
):
_check_test_command_install_requirements
(
bare_virtualenv
,
tmpdir
)
def
test_no_missing_dependencies
(
bare_virtualenv
):
"""
Quick and dirty test to ensure all external dependencies are vendored.
...
...
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