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
322472e4
Commit
322472e4
authored
Jan 24, 2017
by
Jason R. Coombs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Extract staticmethod for resolving setup path
parent
997b4351
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
7 deletions
+20
-7
setuptools/command/develop.py
setuptools/command/develop.py
+20
-7
No files found.
setuptools/command/develop.py
View file @
322472e4
...
...
@@ -79,15 +79,28 @@ class develop(namespaces.DevelopInstaller, easy_install):
project_name
=
ei
.
egg_name
)
p
=
self
.
egg_base
.
replace
(
os
.
sep
,
'/'
)
if
p
!=
os
.
curdir
:
p
=
'../'
*
(
p
.
count
(
'/'
)
+
1
)
self
.
setup_path
=
p
p
=
normalize_path
(
os
.
path
.
join
(
self
.
install_dir
,
self
.
egg_path
,
p
))
if
p
!=
normalize_path
(
os
.
curdir
):
self
.
setup_path
=
self
.
_resolve_setup_path
(
self
.
egg_base
,
self
.
install_dir
,
self
.
egg_path
,
)
@
staticmethod
def
_resolve_setup_path
(
egg_base
,
install_dir
,
egg_path
):
"""
Generate a path from egg_base back to '.' where the
setup script resides and ensure that path points to the
setup path from $install_dir/$egg_path.
"""
path_to_setup
=
egg_base
.
replace
(
os
.
sep
,
'/'
)
if
path_to_setup
!=
os
.
curdir
:
path_to_setup
=
'../'
*
(
path_to_setup
.
count
(
'/'
)
+
1
)
resolved
=
normalize_path
(
os
.
path
.
join
(
install_dir
,
egg_path
,
path_to_setup
))
if
resolved
!=
normalize_path
(
os
.
curdir
):
raise
DistutilsOptionError
(
"Can't get a consistent path to setup script from"
" installation directory"
,
p
,
normalize_path
(
os
.
curdir
))
" installation directory"
,
resolved
,
normalize_path
(
os
.
curdir
))
return
path_to_setup
def
install_for_development
(
self
):
if
six
.
PY3
and
getattr
(
self
.
distribution
,
'use_2to3'
,
False
):
...
...
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