Skip to content

Commit 2dc3b75

Browse files
committed
Renamed validate_settings to validate_configuration, renamed create_or_get_venv to get_or_create_venv
1 parent 8ed90ff commit 2dc3b75

File tree

4 files changed

+12
-12
lines changed

4 files changed

+12
-12
lines changed

arca/backend/base.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,9 @@ def inject_arca(self, arca):
4343
"""
4444
self._arca = arca
4545

46-
self.validate_settings()
46+
self.validate_configuration()
4747

48-
def validate_settings(self):
48+
def validate_configuration(self):
4949
pass
5050

5151
@cached_property

arca/backend/docker.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ def __init__(self, **kwargs):
7979
self._containers = set()
8080
self.client = None
8181

82-
def validate_settings(self):
82+
def validate_configuration(self):
8383
"""
8484
Validates the provided settings.
8585
@@ -89,7 +89,7 @@ def validate_settings(self):
8989
9090
:raise ArcaMisconfigured: If some of the settings aren't valid.
9191
"""
92-
super().validate_settings()
92+
super().validate_configuration()
9393

9494
if self.inherit_image is not None:
9595
try:

arca/backend/vagrant.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,14 +83,14 @@ def inject_arca(self, arca):
8383

8484
self.log_cm = vagrant.make_file_cm(self.log_path)
8585

86-
def validate_settings(self):
87-
""" Runs :meth:`arca.DockerBackend.validate_settings` and checks extra:
86+
def validate_configuration(self):
87+
""" Runs :meth:`arca.DockerBackend.validate_configuration` and checks extra:
8888
8989
* ``box`` format
9090
* ``provider`` format
9191
* ``use_registry_name`` is set and ``registry_pull_only`` is not enabled.
9292
"""
93-
super().validate_settings()
93+
super().validate_configuration()
9494

9595
if self.use_registry_name is None:
9696
raise ArcaMisconfigured("Use registry name setting is required for VagrantBackend")

arca/backend/venv.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def get_virtualenv_name(self, requirements_file: Path) -> str:
2525
2626
Either:
2727
28-
* SHA1 of the requirements file and Arca version
28+
* hash of the requirements file and Arca version
2929
* ``no_requirements_file`` if the requirements file doesn't exist.
3030
3131
:param requirements_file: :class:`Path <pathlib.Path>` to where the requirements file
@@ -37,7 +37,7 @@ def get_virtualenv_name(self, requirements_file: Path) -> str:
3737
else:
3838
return self.get_requirements_hash(requirements_file)
3939

40-
def create_or_get_venv(self, path: Path) -> Path:
40+
def get_or_create_venv(self, path: Path) -> Path:
4141
"""
4242
Gets the name of the virtualenv from :meth:`get_virtualenv_name`, checks if it exists already,
4343
creates it and installs requirements otherwise. The virtualenvs are stored in a folder based
@@ -46,9 +46,9 @@ def create_or_get_venv(self, path: Path) -> Path:
4646
:param path: :class:`Path <pathlib.Path>` to the cloned repository.
4747
"""
4848
requirements_file = self.get_requirements_file(path)
49-
requirements_name = self.get_virtualenv_name(requirements_file)
49+
venv_name = self.get_virtualenv_name(requirements_file)
5050

51-
venv_path = Path(self._arca.base_dir) / "venvs" / requirements_name
51+
venv_path = Path(self._arca.base_dir) / "venvs" / venv_name
5252

5353
if not venv_path.exists():
5454
logger.info(f"Creating a venv in {venv_path}")
@@ -91,4 +91,4 @@ def create_or_get_venv(self, path: Path) -> Path:
9191
def get_or_create_environment(self, repo: str, branch: str, git_repo: Repo, repo_path: Path) -> str:
9292
""" Handles the requirements in the target repository, returns a path to a executable of the virtualenv.
9393
"""
94-
return str(self.create_or_get_venv(repo_path).resolve() / "bin" / "python")
94+
return str(self.get_or_create_venv(repo_path).resolve() / "bin" / "python")

0 commit comments

Comments
 (0)