Skip to content

Commit 3595e01

Browse files
authored
chore(linters): fix mypy, ruff, pylint (#478)
Housekeeping, maintenance
1 parent 7608ba1 commit 3595e01

File tree

4 files changed

+11
-9
lines changed

4 files changed

+11
-9
lines changed

.github/workflows/check-test-release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
fail-fast: false
2727
matrix:
2828
os: [ubuntu-latest, macos-latest, windows-latest]
29-
python: ["3.9", "3.10", "3.11", "3.12", "3.13"]
29+
python: ["3.10", "3.11", "3.12", "3.13"]
3030

3131
steps:
3232
- uses: actions/checkout@v5

gto/index.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -516,8 +516,7 @@ def update_state(
516516
commit = self.scm.resolve_commit(version.commit_hexsha)
517517
enrichments = self.describe(
518518
artifact.artifact,
519-
# faster to make git.Reference here
520-
rev=commit,
519+
rev=commit.hexsha,
521520
)
522521
version.add_event(
523522
EnrichmentEvent(
@@ -537,12 +536,16 @@ def update_state(
537536
for commit in self.get_commits(
538537
all_branches=all_branches, all_commits=all_commits
539538
):
540-
for art_name in GTOEnrichment().discover(self.scm, commit):
541-
enrichments = self.describe(art_name, rev=commit)
539+
for art_name in GTOEnrichment().discover(self.scm, commit.hexsha):
540+
enrichments = self.describe(art_name, rev=commit.hexsha)
542541
artifact = state.find_artifact(art_name, create_new=True)
543542
version = artifact.find_version(
544543
commit_hexsha=commit.hexsha, create_new=True
545544
)
545+
546+
assert version is not None and not isinstance(
547+
version, list
548+
), "Expected a single Version instance"
546549
version.add_event(
547550
EnrichmentEvent(
548551
artifact=artifact.artifact,

pyproject.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ keywords = ["git", "repo", "repository", "artifact", "registry", "developer-tool
1212
classifiers = [
1313
"Development Status :: 2 - Pre-Alpha",
1414
"Programming Language :: Python :: 3",
15-
"Programming Language :: Python :: 3.9",
1615
"Programming Language :: Python :: 3.10",
1716
"Programming Language :: Python :: 3.11",
1817
"Programming Language :: Python :: 3.12",

tests/conftest.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
class Runner:
2020
def __init__(self):
21-
self._runner = CliRunner(mix_stderr=False)
21+
self._runner = CliRunner()
2222

2323
def invoke(self, *args, **kwargs) -> Result:
2424
return self._runner.invoke(app, *args, **kwargs)
@@ -51,14 +51,14 @@ def isolate(tmp_path_factory: pytest.TempPathFactory) -> Iterator[None]:
5151
5252
"""
5353
(home_dir / ".gitconfig").write_bytes(contents)
54-
pygit2.settings.search_path[pygit2.GIT_CONFIG_LEVEL_GLOBAL] = str(home_dir) # type: ignore[attr-defined]
54+
pygit2.settings.search_path[pygit2.GIT_CONFIG_LEVEL_GLOBAL] = str(home_dir) # type: ignore[index]
5555

5656
yield
5757
monkeypatch.undo()
5858

5959

6060
@pytest.fixture
61-
def scm(tmp_dir: TmpDir) -> Git:
61+
def scm(tmp_dir: TmpDir) -> Iterator[Git]:
6262
scm_instance = Git.init(tmp_dir)
6363
try:
6464
yield scm_instance

0 commit comments

Comments
 (0)