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
0902f02d
Commit
0902f02d
authored
Dec 24, 2018
by
Jason R. Coombs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Access pkg_resources objects through its namespace
parent
3b830754
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
11 deletions
+13
-11
setuptools/command/develop.py
setuptools/command/develop.py
+13
-11
No files found.
setuptools/command/develop.py
View file @
0902f02d
...
...
@@ -7,7 +7,7 @@ import io
from
setuptools.extern
import
six
from
pkg_resources
import
Distribution
,
PathMetadata
,
normalize_path
import
pkg_resources
from
setuptools.command.easy_install
import
easy_install
from
setuptools
import
namespaces
import
setuptools
...
...
@@ -65,9 +65,9 @@ class develop(namespaces.DevelopInstaller, easy_install):
if
self
.
egg_path
is
None
:
self
.
egg_path
=
os
.
path
.
abspath
(
ei
.
egg_base
)
target
=
normalize_path
(
self
.
egg_base
)
egg_path
=
normalize_path
(
os
.
path
.
join
(
self
.
install_dir
,
self
.
egg_path
))
target
=
pkg_resources
.
normalize_path
(
self
.
egg_base
)
egg_path
=
pkg_resources
.
normalize_path
(
os
.
path
.
join
(
self
.
install_dir
,
self
.
egg_path
))
if
egg_path
!=
target
:
raise
DistutilsOptionError
(
"--egg-path must be a relative path from the install"
...
...
@@ -75,9 +75,9 @@ class develop(namespaces.DevelopInstaller, easy_install):
)
# Make a distribution for the package's source
self
.
dist
=
Distribution
(
self
.
dist
=
pkg_resources
.
Distribution
(
target
,
PathMetadata
(
target
,
os
.
path
.
abspath
(
ei
.
egg_info
)),
pkg_resources
.
PathMetadata
(
target
,
os
.
path
.
abspath
(
ei
.
egg_info
)),
project_name
=
ei
.
egg_name
)
...
...
@@ -97,13 +97,14 @@ class develop(namespaces.DevelopInstaller, easy_install):
path_to_setup
=
egg_base
.
replace
(
os
.
sep
,
'/'
).
rstrip
(
'/'
)
if
path_to_setup
!=
os
.
curdir
:
path_to_setup
=
'../'
*
(
path_to_setup
.
count
(
'/'
)
+
1
)
resolved
=
normalize_path
(
resolved
=
pkg_resources
.
normalize_path
(
os
.
path
.
join
(
install_dir
,
egg_path
,
path_to_setup
)
)
if
resolved
!=
normalize_path
(
os
.
curdir
):
if
resolved
!=
pkg_resources
.
normalize_path
(
os
.
curdir
):
raise
DistutilsOptionError
(
"Can't get a consistent path to setup script from"
" installation directory"
,
resolved
,
normalize_path
(
os
.
curdir
))
" installation directory"
,
resolved
,
pkg_resources
.
normalize_path
(
os
.
curdir
))
return
path_to_setup
def
install_for_development
(
self
):
...
...
@@ -114,7 +115,7 @@ class develop(namespaces.DevelopInstaller, easy_install):
self
.
reinitialize_command
(
'build_py'
,
inplace
=
0
)
self
.
run_command
(
'build_py'
)
bpy_cmd
=
self
.
get_finalized_command
(
"build_py"
)
build_path
=
normalize_path
(
bpy_cmd
.
build_lib
)
build_path
=
pkg_resources
.
normalize_path
(
bpy_cmd
.
build_lib
)
# Build extensions
self
.
reinitialize_command
(
'egg_info'
,
egg_base
=
build_path
)
...
...
@@ -128,7 +129,8 @@ class develop(namespaces.DevelopInstaller, easy_install):
self
.
egg_path
=
build_path
self
.
dist
.
location
=
build_path
# XXX
self
.
dist
.
_provider
=
PathMetadata
(
build_path
,
ei_cmd
.
egg_info
)
self
.
dist
.
_provider
=
pkg_resources
.
PathMetadata
(
build_path
,
ei_cmd
.
egg_info
)
else
:
# Without 2to3 inplace works fine:
self
.
run_command
(
'egg_info'
)
...
...
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