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
a4d8518c
Commit
a4d8518c
authored
Jun 15, 2020
by
Jason R. Coombs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make a few assertions about the entry point script rather than keeping a fully-rendered copy.
parent
9befd913
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
31 deletions
+7
-31
setuptools/tests/test_easy_install.py
setuptools/tests/test_easy_install.py
+7
-31
No files found.
setuptools/tests/test_easy_install.py
View file @
a4d8518c
...
@@ -16,6 +16,7 @@ import io
...
@@ -16,6 +16,7 @@ import io
import
zipfile
import
zipfile
import
mock
import
mock
import
time
import
time
import
re
from
setuptools.extern
import
six
from
setuptools.extern
import
six
...
@@ -71,40 +72,15 @@ class TestEasyInstallTest:
...
@@ -71,40 +72,15 @@ class TestEasyInstallTest:
def
test_get_script_args
(
self
):
def
test_get_script_args
(
self
):
header
=
ei
.
CommandSpec
.
best
().
from_environment
().
as_header
()
header
=
ei
.
CommandSpec
.
best
().
from_environment
().
as_header
()
if
sys
.
version_info
>=
(
3
,
8
):
expected
=
header
+
DALS
(
r"""
# EASY-INSTALL-ENTRY-SCRIPT: 'spec','console_scripts','name'
import re
import sys
from importlib.metadata import distribution
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\
.pyw?|
\.exe)?$', '', sys.argv[0])
for entry_point in distribution('spec').entry_points:
if entry_point.group == 'console_scripts' and entry_point.name == 'name':
sys.exit(entry_point.load()())
"""
)
# noqa: E501
else
:
expected
=
header
+
DALS
(
r"""
# EASY-INSTALL-ENTRY-SCRIPT: 'spec','console_scripts','name'
__requires__ = 'spec'
import re
import sys
from pkg_resources import load_entry_point
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\
.pyw?|
\.exe)?$', '', sys.argv[0])
sys.exit(
load_entry_point('spec', 'console_scripts', 'name')()
)
"""
)
# noqa: E501
dist
=
FakeDist
()
dist
=
FakeDist
()
args
=
next
(
ei
.
ScriptWriter
.
get_args
(
dist
))
args
=
next
(
ei
.
ScriptWriter
.
get_args
(
dist
))
name
,
script
=
itertools
.
islice
(
args
,
2
)
name
,
script
=
itertools
.
islice
(
args
,
2
)
assert
script
.
startswith
(
header
)
assert
script
==
expected
assert
"'spec'"
in
script
assert
"'console_scripts'"
in
script
assert
"'name'"
in
script
assert
re
.
search
(
'^# EASY-INSTALL-ENTRY-SCRIPT'
,
script
,
flags
=
re
.
MULTILINE
)
def
test_no_find_links
(
self
):
def
test_no_find_links
(
self
):
# new option '--no-find-links', that blocks find-links added at
# new option '--no-find-links', that blocks find-links added at
...
...
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