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
2bb8225a
Commit
2bb8225a
authored
Jan 02, 2019
by
Jason R. Coombs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Extract common behavior into a function
parent
7378e6be
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
14 deletions
+11
-14
setuptools/build_meta.py
setuptools/build_meta.py
+11
-14
No files found.
setuptools/build_meta.py
View file @
2bb8225a
...
...
@@ -149,6 +149,15 @@ def prepare_metadata_for_build_wheel(metadata_directory, config_settings=None):
return
dist_infos
[
0
]
def
_file_with_extension
(
directory
,
extension
):
matching
=
(
f
for
f
in
os
.
listdir
(
directory
)
if
f
.
endswith
(
extension
)
)
file
,
=
matching
return
file
def
build_wheel
(
wheel_directory
,
config_settings
=
None
,
metadata_directory
=
None
):
config_settings
=
_fix_config
(
config_settings
)
...
...
@@ -160,13 +169,7 @@ def build_wheel(wheel_directory, config_settings=None,
shutil
.
rmtree
(
wheel_directory
)
shutil
.
copytree
(
'dist'
,
wheel_directory
)
wheels
=
(
f
for
f
in
os
.
listdir
(
wheel_directory
)
if
f
.
endswith
(
'.whl'
)
)
wheel
,
=
wheels
return
wheel
return
_file_with_extension
(
wheel_directory
,
'.whl'
)
def
build_sdist
(
sdist_directory
,
config_settings
=
None
):
...
...
@@ -177,10 +180,4 @@ def build_sdist(sdist_directory, config_settings=None):
[
"--dist-dir"
,
sdist_directory
]
_run_setup
()
sdists
=
(
f
for
f
in
os
.
listdir
(
sdist_directory
)
if
f
.
endswith
(
'.tar.gz'
)
)
sdist
,
=
sdists
return
sdist
return
_file_with_extension
(
sdist_directory
,
'.tar.gz'
)
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