Commit ddd5d0a9 authored by xoviat's avatar xoviat

tests: cleanup the backend

parent b054af58
...@@ -15,17 +15,21 @@ from .textwrap import DALS ...@@ -15,17 +15,21 @@ from .textwrap import DALS
from . import contexts from . import contexts
class BuildBackend(object): class BuildBackendBase(object):
"""PEP 517 Build Backend"""
def __init__(self, cwd=None, env={}, backend_name='setuptools.pep517'): def __init__(self, cwd=None, env={}, backend_name='setuptools.pep517'):
self.cwd = cwd self.cwd = cwd
self.env = env self.env = env
self.backend_name = backend_name self.backend_name = backend_name
class BuildBackend(object):
"""PEP 517 Build Backend"""
def __init__(self, *args, **kwargs):
super(BuildBackend, self).__init__(*args, **kwargs)
self.pool = ProcessPoolExecutor() self.pool = ProcessPoolExecutor()
def __getattr__(self, name): def __getattr__(self, name):
"""Handles aribrary function invokations on the build backend.""" """Handles aribrary function invocations on the build backend."""
def method(*args, **kw): def method(*args, **kw):
return self.pool.submit( return self.pool.submit(
BuildBackendCaller(os.path.abspath(self.cwd), self.env, BuildBackendCaller(os.path.abspath(self.cwd), self.env,
...@@ -35,12 +39,7 @@ class BuildBackend(object): ...@@ -35,12 +39,7 @@ class BuildBackend(object):
return method return method
class BuildBackendCaller(object): class BuildBackendCaller(BuildBackendBase):
def __init__(self, cwd, env, backend_name):
self.cwd = cwd
self.env = env
self.backend_name = backend_name
def __call__(self, info): def __call__(self, info):
"""Handles aribrary function invokations on the build backend.""" """Handles aribrary function invokations on the build backend."""
os.chdir(self.cwd) os.chdir(self.cwd)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment