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
fa5f1be3
Commit
fa5f1be3
authored
Oct 12, 2017
by
Jason R. Coombs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Clean up imports in test_pep517 to conform to PEP 8 standards.
parent
4e5c1640
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
14 deletions
+14
-14
setuptools/tests/test_pep517.py
setuptools/tests/test_pep517.py
+14
-14
No files found.
setuptools/tests/test_pep517.py
View file @
fa5f1be3
import
pytest
import
os
import
contextlib
import
tempfile
# Only test the backend on Python 3
# because we don't want to require
# a concurrent.futures backport for testing
pytest
.
importorskip
(
'concurrent.futures'
)
import
pytest
from
contextlib
import
contextmanager
from
importlib
import
import_module
from
tempfile
import
mkdtemp
from
concurrent.futures
import
ProcessPoolExecutor
from
.files
import
build_files
from
.textwrap
import
DALS
from
.
import
contexts
futures
=
pytest
.
importorskip
(
'concurrent.futures'
)
importlib
=
pytest
.
importorskip
(
'importlib'
)
class
BuildBackendBase
(
object
):
...
...
@@ -26,7 +23,7 @@ class BuildBackend(BuildBackendBase):
"""PEP 517 Build Backend"""
def
__init__
(
self
,
*
args
,
**
kwargs
):
super
(
BuildBackend
,
self
).
__init__
(
*
args
,
**
kwargs
)
self
.
pool
=
ProcessPoolExecutor
()
self
.
pool
=
futures
.
ProcessPoolExecutor
()
def
__getattr__
(
self
,
name
):
"""Handles aribrary function invocations on the build backend."""
...
...
@@ -44,10 +41,11 @@ class BuildBackendCaller(BuildBackendBase):
"""Handles aribrary function invocations on the build backend."""
os
.
chdir
(
self
.
cwd
)
os
.
environ
.
update
(
self
.
env
)
return
getattr
(
import_module
(
self
.
backend_name
),
name
)(
*
args
,
**
kw
)
mod
=
importlib
.
import_module
(
self
.
backend_name
)
return
getattr
(
mod
,
name
)(
*
args
,
**
kw
)
@
contextmanager
@
context
lib
.
context
manager
def
enter_directory
(
dir
,
val
=
None
):
original_dir
=
os
.
getcwd
()
os
.
chdir
(
dir
)
...
...
@@ -57,7 +55,7 @@ def enter_directory(dir, val=None):
@
pytest
.
fixture
def
build_backend
():
tmpdir
=
mkdtemp
()
tmpdir
=
tempfile
.
mkdtemp
()
with
enter_directory
(
tmpdir
):
setup_script
=
DALS
(
"""
from setuptools import setup
...
...
@@ -87,6 +85,7 @@ def test_get_requires_for_build_wheel(build_backend):
assert
list
(
sorted
(
b
.
get_requires_for_build_wheel
()))
==
\
list
(
sorted
([
'six'
,
'setuptools'
,
'wheel'
]))
def
test_build_wheel
(
build_backend
):
with
build_backend
as
b
:
dist_dir
=
os
.
path
.
abspath
(
'pip-wheel'
)
...
...
@@ -104,6 +103,7 @@ def test_build_sdist(build_backend):
assert
os
.
path
.
isfile
(
os
.
path
.
join
(
dist_dir
,
sdist_name
))
def
test_prepare_metadata_for_build_wheel
(
build_backend
):
with
build_backend
as
b
:
dist_dir
=
os
.
path
.
abspath
(
'pip-dist-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