Skip to content

Commit 742a094

Browse files
committed
Updated type hints
1 parent 95e7ae8 commit 742a094

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

exasol/toolbox/util/dependencies/poetry_dependencies.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,9 +164,9 @@ def get_dependencies_from_latest_tag() -> (
164164
OrderedDict[str, dict[NormalizedPackageStr, Package]]
165165
):
166166
latest_tag = Git.get_latest_tag()
167-
directory = PROJECT_CONFIG.root.relative_to(Git.toplevel())
167+
path = PROJECT_CONFIG.root.relative_to(Git.toplevel())
168168
with tempfile.TemporaryDirectory() as path:
169169
tmpdir = Path(path)
170170
for file in ("poetry.lock", PYPROJECT_TOML):
171-
Git.checkout(latest_tag, dir / file, tmpdir / file)
171+
Git.checkout(latest_tag, path / file, tmpdir / file)
172172
return get_dependencies(working_directory=tmpdir)

exasol/toolbox/util/git.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,20 +26,20 @@ def get_latest_tag():
2626

2727
@staticmethod
2828
@run_command
29-
def read_file_from_tag(tag: str, remote_file: str):
29+
def read_file_from_tag(tag: str, path: Path | str):
3030
"""
31-
Read the contents of the specified file `remote_file` at the point in time
32-
specified by git tag `tag`.
31+
Read the contents of the specified file `path` at the point in
32+
time specified by git tag `tag`.
3333
"""
34-
return ["git", "cat-file", "blob", f"{tag}:{remote_file}"]
34+
return ["git", "cat-file", "blob", f"{tag}:{path}"]
3535

3636
@staticmethod
3737
def checkout(tag: str, source: Path, dest: Path) -> None:
3838
"""
3939
Copy the specified file `source` at the point in time specified by
4040
git tag `tag` to file `dest` within the local filesystem.
4141
"""
42-
contents = Git.read_file_from_tag(tag=tag, remote_file=source)
42+
contents = Git.read_file_from_tag(tag=tag, path=source)
4343
dest.write_text(contents)
4444

4545
@staticmethod

test/unit/util/git_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ def latest_tag() -> str:
1313

1414
@pytest.fixture(scope="module")
1515
def read_file_from_tag(latest_tag) -> str:
16-
return Git.read_file_from_tag(tag=latest_tag, remote_file=POETRY_LOCK)
16+
return Git.read_file_from_tag(tag=latest_tag, path=POETRY_LOCK)
1717

1818

1919
class TestGit:

0 commit comments

Comments
 (0)