Skip to content

Commit 33011ac

Browse files
committed
Moved RUNNER to BaseBackend
1 parent 8b2a70d commit 33011ac

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

arca/_arca.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,6 @@ class Arca:
3131
3232
"""
3333

34-
RUNNER = Path(__file__).parent.resolve() / "_runner.py"
35-
3634
base_dir: str = LazySettingProperty(default=".arca")
3735
single_pull: bool = LazySettingProperty(default=False, convert=bool)
3836
ignore_cache_errors: bool = LazySettingProperty(default=False, convert=bool)

arca/backend/base.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ class BaseBackend:
2424
* **cwd**: Relative path to the required working directory. (default is ``""``, the root of the repo)
2525
"""
2626

27+
RUNNER = Path(__file__).parent.parent.resolve() / "_runner.py"
28+
2729
requirements_location: str = LazySettingProperty(default="requirements.txt")
2830
cwd: str = LazySettingProperty(default="")
2931

@@ -153,7 +155,7 @@ def run(self, repo: str, branch: str, task: Task, git_repo: Repo, repo_path: Pat
153155
logger.debug("Running with python %s", python_path)
154156

155157
process = subprocess.Popen([python_path,
156-
str(self._arca.RUNNER),
158+
str(self.RUNNER),
157159
str(task_path.resolve())],
158160
stdout=subprocess.PIPE,
159161
stderr=subprocess.PIPE,

arca/backend/docker.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -614,7 +614,7 @@ def tar_files(self, path: Path) -> bytes:
614614
def tar_runner(self):
615615
""" Returns a tar with the runner script.
616616
"""
617-
script_bytes = self._arca.RUNNER.read_bytes()
617+
script_bytes = self.RUNNER.read_bytes()
618618

619619
tarstream = BytesIO()
620620
tar = tarfile.TarFile(fileobj=tarstream, mode='w')

arca/backend/vagrant.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ def init_vagrant(self, vagrant_file):
141141
end
142142
"""))
143143

144-
(vagrant_file.parent / "runner.py").write_text(self._arca.RUNNER.read_text())
144+
(vagrant_file.parent / "runner.py").write_text(self.RUNNER.read_text())
145145

146146
@property
147147
def fabric_task(self):

0 commit comments

Comments
 (0)