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
12d4fba6
Commit
12d4fba6
authored
Sep 03, 2017
by
xoviat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tests: add build_wheel and build_sdist
parent
33546858
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
3 deletions
+32
-3
setuptools/pep517.py
setuptools/pep517.py
+11
-0
setuptools/tests/test_pep517.py
setuptools/tests/test_pep517.py
+21
-3
No files found.
setuptools/pep517.py
View file @
12d4fba6
...
...
@@ -68,6 +68,11 @@ 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'
)]
assert
len
(
wheels
)
==
1
return
wheels
[
0
]
def
build_sdist
(
sdist_directory
,
config_settings
=
None
):
config_settings
=
fix_config
(
config_settings
)
...
...
@@ -78,3 +83,9 @@ def build_sdist(sdist_directory, config_settings=None):
if
sdist_directory
!=
'dist'
:
shutil
.
rmtree
(
sdist_directory
)
shutil
.
copytree
(
'dist'
,
sdist_directory
)
sdists
=
[
f
for
f
in
os
.
listdir
(
sdist_directory
)
if
f
.
endswith
(
'.tar.gz'
)]
assert
len
(
sdists
)
==
1
return
sdists
[
0
]
\ No newline at end of file
setuptools/tests/test_pep517.py
View file @
12d4fba6
...
...
@@ -28,7 +28,8 @@ class BuildBackend(object):
def
method
(
*
args
,
**
kw
):
return
self
.
pool
.
submit
(
BuildBackendCaller
(
self
.
cwd
,
self
.
env
,
self
.
backend_name
),
BuildBackendCaller
(
os
.
path
.
abspath
(
self
.
cwd
),
self
.
env
,
self
.
backend_name
),
(
name
,
args
,
kw
)).
result
()
return
method
...
...
@@ -66,7 +67,7 @@ def build_backend():
setup(
name='foo',
py_modules=['hello'],
setup_requires=['
test-package
'],
setup_requires=['
six
'],
entry_points={'console_scripts': ['hi = hello.run']},
zip_safe=False,
)
...
...
@@ -86,4 +87,21 @@ def build_backend():
def
test_get_requires_for_build_wheel
(
build_backend
):
with
build_backend
as
b
:
assert
list
(
sorted
(
b
.
get_requires_for_build_wheel
()))
==
\
list
(
sorted
([
'test-package'
,
'setuptools'
,
'wheel'
]))
list
(
sorted
([
'six'
,
'setuptools'
,
'wheel'
]))
def
test_build_wheel
(
build_backend
):
with
build_backend
as
b
:
dist_dir
=
os
.
path
.
abspath
(
'pip-wheel'
)
os
.
makedirs
(
dist_dir
)
wheel_name
=
b
.
build_wheel
(
dist_dir
)
assert
os
.
path
.
isfile
(
os
.
path
.
join
(
dist_dir
,
wheel_name
))
def
test_build_sdist
(
build_backend
):
with
build_backend
as
b
:
dist_dir
=
os
.
path
.
abspath
(
'pip-sdist'
)
os
.
makedirs
(
dist_dir
)
sdist_name
=
b
.
build_sdist
(
dist_dir
)
assert
os
.
path
.
isfile
(
os
.
path
.
join
(
dist_dir
,
sdist_name
))
\ No newline at end of file
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