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
19db98f4
Commit
19db98f4
authored
Sep 07, 2017
by
xoviat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pep517: prepare_metadata: return basename
parent
17d56d62
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
4 deletions
+14
-4
setuptools/pep517.py
setuptools/pep517.py
+11
-2
setuptools/tests/test_pep517.py
setuptools/tests/test_pep517.py
+3
-2
No files found.
setuptools/pep517.py
View file @
19db98f4
...
...
@@ -26,6 +26,7 @@ def fix_config(config_settings):
config_settings
.
setdefault
(
'--global-option'
,
[])
return
config_settings
def
get_build_requires
(
config_settings
):
config_settings
=
fix_config
(
config_settings
)
requirements
=
[
'setuptools'
,
'wheel'
]
...
...
@@ -57,6 +58,13 @@ def prepare_metadata_for_build_wheel(metadata_directory, config_settings=None):
sys
.
argv
=
sys
.
argv
[:
1
]
+
[
'dist_info'
,
'--egg-base'
,
metadata_directory
]
_run_setup
()
dist_infos
=
[
f
for
f
in
os
.
listdir
(
metadata_directory
)
if
f
.
endswith
(
'.dist-info'
)]
assert
len
(
dist_infos
)
==
1
return
dist_infos
[
0
]
def
build_wheel
(
wheel_directory
,
config_settings
=
None
,
metadata_directory
=
None
):
config_settings
=
fix_config
(
config_settings
)
...
...
@@ -69,11 +77,12 @@ def build_wheel(wheel_directory, config_settings=None,
shutil
.
copytree
(
'dist'
,
wheel_directory
)
wheels
=
[
f
for
f
in
os
.
listdir
(
wheel_directory
)
if
f
.
endswith
(
'.whl'
)]
if
f
.
endswith
(
'.whl'
)]
assert
len
(
wheels
)
==
1
return
wheels
[
0
]
def
build_sdist
(
sdist_directory
,
config_settings
=
None
):
config_settings
=
fix_config
(
config_settings
)
sdist_directory
=
os
.
path
.
abspath
(
sdist_directory
)
...
...
@@ -85,7 +94,7 @@ def build_sdist(sdist_directory, config_settings=None):
shutil
.
copytree
(
'dist'
,
sdist_directory
)
sdists
=
[
f
for
f
in
os
.
listdir
(
sdist_directory
)
if
f
.
endswith
(
'.tar.gz'
)]
if
f
.
endswith
(
'.tar.gz'
)]
assert
len
(
sdists
)
==
1
return
sdists
[
0
]
setuptools/tests/test_pep517.py
View file @
19db98f4
...
...
@@ -110,6 +110,7 @@ def test_prepare_metadata_for_build_wheel(build_backend):
dist_dir
=
os
.
path
.
abspath
(
'pip-dist-info'
)
os
.
makedirs
(
dist_dir
)
b
.
prepare_metadata_for_build_wheel
(
)
dist_info
=
b
.
prepare_metadata_for_build_wheel
(
dist_dir
)
assert
os
.
path
.
isfile
(
os
.
path
.
join
(
dist_dir
,
'METADATA'
))
assert
os
.
path
.
isfile
(
os
.
path
.
join
(
dist_dir
,
dist_info
,
'METADATA'
))
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