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
961387fb
Commit
961387fb
authored
Jul 11, 2018
by
Daniele Esposti
Committed by
Paul Ganssle
Aug 17, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added test for scripts with unicode
parent
8d887526
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
52 additions
and
0 deletions
+52
-0
setuptools/tests/test_easy_install.py
setuptools/tests/test_easy_install.py
+52
-0
No files found.
setuptools/tests/test_easy_install.py
View file @
961387fb
...
...
@@ -185,6 +185,58 @@ class TestEasyInstallTest:
cmd
.
ensure_finalized
()
cmd
.
easy_install
(
sdist_unicode
)
@
pytest
.
fixture
def
sdist_unicode_in_script
(
self
,
tmpdir
):
files
=
[
(
"setup.py"
,
DALS
(
"""
import setuptools
setuptools.setup(
name="setuptools-test-unicode",
version="1.0",
packages=["mypkg"],
include_package_data=True,
scripts=['mypkg/unicode_in_script'],
)
"""
),
),
(
"mypkg/__init__.py"
,
""
),
(
"mypkg/unicode_in_script"
,
DALS
(
"""
#!/bin/sh
#
\
xc3
\
xa1
non_python_fn() {
}
"""
),
),
]
sdist_name
=
"setuptools-test-unicode-script-1.0.zip"
sdist
=
tmpdir
/
sdist_name
# can't use make_sdist, because the issue only occurs
# with zip sdists.
sdist_zip
=
zipfile
.
ZipFile
(
str
(
sdist
),
"w"
)
for
filename
,
content
in
files
:
sdist_zip
.
writestr
(
filename
,
content
)
sdist_zip
.
close
()
return
str
(
sdist
)
@
fail_on_ascii
def
test_unicode_content_in_sdist
(
self
,
sdist_unicode_in_script
,
tmpdir
,
monkeypatch
):
"""
The install command should execute correctly even if
the package has unicode in scripts.
"""
dist
=
Distribution
({
"script_args"
:
[
"easy_install"
]})
target
=
(
tmpdir
/
"target"
).
ensure_dir
()
cmd
=
ei
.
easy_install
(
dist
,
install_dir
=
str
(
target
),
args
=
[
"x"
])
monkeypatch
.
setitem
(
os
.
environ
,
"PYTHONPATH"
,
str
(
target
))
cmd
.
ensure_finalized
()
cmd
.
easy_install
(
sdist_unicode_in_script
)
@
pytest
.
fixture
def
sdist_script
(
self
,
tmpdir
):
files
=
[
...
...
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