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
c3beddd0
Commit
c3beddd0
authored
Jan 04, 2015
by
Jason R. Coombs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Deprecate and remove usage of easy_install.get_script_header.
parent
390e64c3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
6 deletions
+10
-6
setuptools/command/easy_install.py
setuptools/command/easy_install.py
+8
-4
setuptools/command/install_scripts.py
setuptools/command/install_scripts.py
+2
-2
No files found.
setuptools/command/easy_install.py
View file @
c3beddd0
...
...
@@ -754,7 +754,7 @@ Please make the appropriate changes for your system and try again.
is_script
=
is_python_script
(
script_text
,
script_name
)
if
is_script
:
script_text
=
(
get_scrip
t_header
(
script_text
)
+
script_text
=
(
ScriptWriter
.
ge
t_header
(
script_text
)
+
self
.
_load_template
(
dev_path
)
%
locals
())
self
.
write_script
(
script_name
,
_to_ascii
(
script_text
),
'b'
)
...
...
@@ -1878,11 +1878,13 @@ class ScriptWriter(object):
# for backward compatibility
warnings
.
warn
(
"Use _gen_args"
,
DeprecationWarning
)
writer
=
cls
.
get_writer
(
wininst
)
header
=
get_script_header
(
""
,
executable
,
wininst
)
header
=
cls
.
get_script_header
(
""
,
executable
,
wininst
)
return
writer
.
_gen_args
(
dist
,
header
)
@
classmethod
def
get_script_header
(
cls
,
script_text
,
executable
=
sys_executable
,
wininst
=
False
):
# for backward compatibility
warnings
.
warn
(
"Use get_header"
,
DeprecationWarning
)
executable
=
"python.exe"
if
wininst
else
nt_quote_arg
(
executable
)
return
cls
.
get_header
(
script_text
,
executable
)
...
...
@@ -1892,7 +1894,7 @@ class ScriptWriter(object):
Yield write_script() argument tuples for a distribution's entrypoints
"""
if
header
is
None
:
header
=
get_script_header
(
""
,
sys_executable
)
header
=
cls
.
get_header
(
)
spec
=
str
(
dist
.
as_requirement
())
for
type_
in
'console'
,
'gui'
:
group
=
type_
+
'_scripts'
...
...
@@ -1914,8 +1916,10 @@ class ScriptWriter(object):
yield
(
name
,
header
+
script_text
)
@
classmethod
def
get_header
(
cls
,
script_text
,
executabl
e
):
def
get_header
(
cls
,
script_text
=
""
,
executable
=
Non
e
):
"""Create a #! line, getting options (if any) from script_text"""
if
executable
is
None
:
executable
=
nt_quote_arg
(
sys_executable
)
first
=
(
script_text
+
'
\
n
'
).
splitlines
()[
0
]
match
=
_first_line_re
().
match
(
first
)
options
=
''
...
...
setuptools/command/install_scripts.py
View file @
c3beddd0
...
...
@@ -14,7 +14,7 @@ class install_scripts(orig.install_scripts):
def
run
(
self
):
from
setuptools.command.easy_install
import
(
ScriptWriter
,
sys_executable
,
get_script_header
,
ScriptWriter
,
sys_executable
,
nt_quote_arg
,
)
self
.
run_command
(
"egg_info"
)
if
self
.
distribution
.
scripts
:
...
...
@@ -38,7 +38,7 @@ class install_scripts(orig.install_scripts):
if
is_wininst
:
executable
=
"python.exe"
writer
=
ScriptWriter
.
get_writer
(
force_windows
=
is_wininst
)
header
=
get_script_header
(
""
,
executable
)
header
=
ScriptWriter
.
get_header
(
""
,
nt_quote_arg
(
executable
)
)
for
args
in
writer
.
_gen_args
(
dist
,
header
):
self
.
write_script
(
*
args
)
...
...
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