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
173c8617
Commit
173c8617
authored
Dec 18, 2016
by
Jason R. Coombs
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'issue-704'
parents
127dcab5
cd2a519c
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
11 deletions
+20
-11
setuptools/command/easy_install.py
setuptools/command/easy_install.py
+10
-6
setuptools/sandbox.py
setuptools/sandbox.py
+8
-1
setuptools/tests/test_easy_install.py
setuptools/tests/test_easy_install.py
+2
-4
No files found.
setuptools/command/easy_install.py
View file @
173c8617
...
@@ -627,12 +627,20 @@ class easy_install(Command):
...
@@ -627,12 +627,20 @@ class easy_install(Command):
(
spec
.
key
,
self
.
build_directory
)
(
spec
.
key
,
self
.
build_directory
)
)
)
@
contextlib
.
contextmanager
def
_tmpdir
(
self
):
tmpdir
=
tempfile
.
mkdtemp
(
prefix
=
six
.
u
(
"easy_install-"
))
try
:
# cast to str as workaround for #709 and #710 and #712
yield
str
(
tmpdir
)
finally
:
os
.
path
.
exists
(
tmpdir
)
and
rmtree
(
tmpdir
)
def
easy_install
(
self
,
spec
,
deps
=
False
):
def
easy_install
(
self
,
spec
,
deps
=
False
):
tmpdir
=
tempfile
.
mkdtemp
(
prefix
=
"easy_install-"
)
if
not
self
.
editable
:
if
not
self
.
editable
:
self
.
install_site_py
()
self
.
install_site_py
()
try
:
with
self
.
_tmpdir
()
as
tmpdir
:
if
not
isinstance
(
spec
,
Requirement
):
if
not
isinstance
(
spec
,
Requirement
):
if
URL_SCHEME
(
spec
):
if
URL_SCHEME
(
spec
):
# It's a url, download it to tmpdir and process
# It's a url, download it to tmpdir and process
...
@@ -664,10 +672,6 @@ class easy_install(Command):
...
@@ -664,10 +672,6 @@ class easy_install(Command):
else
:
else
:
return
self
.
install_item
(
spec
,
dist
.
location
,
tmpdir
,
deps
)
return
self
.
install_item
(
spec
,
dist
.
location
,
tmpdir
,
deps
)
finally
:
if
os
.
path
.
exists
(
tmpdir
):
rmtree
(
tmpdir
)
def
install_item
(
self
,
spec
,
download
,
tmpdir
,
deps
,
install_needed
=
False
):
def
install_item
(
self
,
spec
,
download
,
tmpdir
,
deps
,
install_needed
=
False
):
# Installation is also needed if file in tmpdir or is not an egg
# Installation is also needed if file in tmpdir or is not an egg
...
...
setuptools/sandbox.py
View file @
173c8617
...
@@ -241,8 +241,15 @@ def run_setup(setup_script, args):
...
@@ -241,8 +241,15 @@ def run_setup(setup_script, args):
working_set.__init__()
working_set.__init__()
working_set.callbacks.append(lambda dist: dist.activate())
working_set.callbacks.append(lambda dist: dist.activate())
# __file__ should be a byte string on Python 2 (#712)
dunder_file = (
setup_script
if isinstance(setup_script, str) else
setup_script.encode(sys.getfilesystemencoding())
)
def runner():
def runner():
ns = dict(__file__=
setup_script
, __name__='__main__')
ns = dict(__file__=
dunder_file
, __name__='__main__')
_execfile(setup_script, ns)
_execfile(setup_script, ns)
DirectorySandbox(setup_dir).run(runner)
DirectorySandbox(setup_dir).run(runner)
...
...
setuptools/tests/test_easy_install.py
View file @
173c8617
...
@@ -169,10 +169,8 @@ class TestEasyInstallTest:
...
@@ -169,10 +169,8 @@ class TestEasyInstallTest:
sdist_zip
.
close
()
sdist_zip
.
close
()
return
str
(
sdist
)
return
str
(
sdist
)
@
pytest
.
mark
.
xfail
(
reason
=
"#709 and #710"
)
@
pytest
.
mark
.
xfail
(
setuptools
.
tests
.
is_ascii
,
# also
reason
=
"https://github.com/pypa/setuptools/issues/706"
)
#@pytest.mark.xfail(setuptools.tests.is_ascii,
# reason="https://github.com/pypa/setuptools/issues/706")
def
test_unicode_filename_in_sdist
(
self
,
sdist_unicode
,
tmpdir
,
monkeypatch
):
def
test_unicode_filename_in_sdist
(
self
,
sdist_unicode
,
tmpdir
,
monkeypatch
):
"""
"""
The install command should execute correctly even if
The install command should execute correctly even if
...
...
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