aboutsummaryrefslogtreecommitdiffstats
path: root/setuptools/tests/test_build_meta.py
diff options
context:
space:
mode:
authorPaul Ganssle <paul@ganssle.io>2019-02-03 12:17:46 -0500
committerPaul Ganssle <paul@ganssle.io>2019-02-03 12:25:06 -0500
commit11fb3f38d23ff1e0d81e64ba3b68b3de2d2b990a (patch)
treecef2559edceb178cb8484974c1f149f9d58cfab6 /setuptools/tests/test_build_meta.py
parentdb590baf81ebcb23605da54118905437412228ce (diff)
downloadexternal_python_setuptools-11fb3f38d23ff1e0d81e64ba3b68b3de2d2b990a.tar.gz
external_python_setuptools-11fb3f38d23ff1e0d81e64ba3b68b3de2d2b990a.tar.bz2
external_python_setuptools-11fb3f38d23ff1e0d81e64ba3b68b3de2d2b990a.zip
Move build_meta_legacy to build_meta:legacy
Rather than exposing a top-level module for the legacy backend, we will move the legacy backend into the `setuptools.build_meta` module and specify it using the module:object syntax.
Diffstat (limited to 'setuptools/tests/test_build_meta.py')
-rw-r--r--setuptools/tests/test_build_meta.py17
1 files changed, 14 insertions, 3 deletions
diff --git a/setuptools/tests/test_build_meta.py b/setuptools/tests/test_build_meta.py
index b29d6f29..42e3098a 100644
--- a/setuptools/tests/test_build_meta.py
+++ b/setuptools/tests/test_build_meta.py
@@ -23,7 +23,6 @@ class BuildBackendBase:
self.env = env
self.backend_name = backend_name
-
class BuildBackend(BuildBackendBase):
"""PEP 517 Build Backend"""
@@ -43,12 +42,24 @@ class BuildBackend(BuildBackendBase):
class BuildBackendCaller(BuildBackendBase):
+ def __init__(self, *args, **kwargs):
+ super(BuildBackendCaller, self).__init__(*args, **kwargs)
+
+ (self.backend_name, _,
+ self.backend_obj) = self.backend_name.partition(':')
+
def __call__(self, name, *args, **kw):
"""Handles aribrary function invocations on the build backend."""
os.chdir(self.cwd)
os.environ.update(self.env)
mod = importlib.import_module(self.backend_name)
- return getattr(mod, name)(*args, **kw)
+
+ if self.backend_obj:
+ backend = getattr(mod, self.backend_obj)
+ else:
+ backend = mod
+
+ return getattr(backend, name)(*args, **kw)
defns = [
@@ -259,7 +270,7 @@ class TestBuildMetaBackend:
class TestBuildMetaLegacyBackend(TestBuildMetaBackend):
- backend_name = 'setuptools.build_meta_legacy'
+ backend_name = 'setuptools.build_meta:legacy'
# build_meta_legacy-specific tests
def test_build_sdist_relative_path_import(self, tmpdir_cwd):