Skip to content

Commit 44284d9

Browse files
Fix: Update package references and fix type checking issues in test files
Co-Authored-By: [email protected] <[email protected]>
1 parent 36c3886 commit 44284d9

File tree

6 files changed

+17
-12
lines changed

6 files changed

+17
-12
lines changed

.github/workflows/python-ci.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@ jobs:
4545
else
4646
. ../../.venv/bin/activate
4747
fi
48-
uv pip install -e . -r requirements.txt -r dev-requirements.txt
48+
python -m pip install -e .
49+
python -m pip install -r requirements.txt -r dev-requirements.txt
4950
5051
- name: selfie-lib - pytest
5152
shell: bash
@@ -89,7 +90,8 @@ jobs:
8990
else
9091
. ../../.venv/bin/activate
9192
fi
92-
uv pip install -e . -r requirements.txt -r dev-requirements.txt
93+
python -m pip install -e . -e ../selfie-lib
94+
python -m pip install -r requirements.txt -r dev-requirements.txt
9395
9496
- name: pytest-selfie - pyright
9597
shell: bash
@@ -122,7 +124,8 @@ jobs:
122124
else
123125
. ../../.venv/bin/activate
124126
fi
125-
uv pip install -e . -r requirements.txt -r dev-requirements.txt
127+
python -m pip install -e . -e ../selfie-lib -e ../pytest-selfie
128+
python -m pip install -r requirements.txt -r dev-requirements.txt
126129
127130
- name: example-pytest-selfie - pytest
128131
shell: bash
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
flask>=3.0.3
22
openai>=1.0.0
3-
-e file:../selfie-lib
4-
-e file:../pytest-selfie
3+
-e ../selfie-lib
4+
-e ../pytest-selfie

python/example-pytest-selfie/tests/to_be_file_test.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,10 @@
1212

1313
class TestSnapshotFileLayout(SnapshotFileLayout):
1414
def get_snapshot_file(self, test_file: TypedPath) -> TypedPath:
15-
return TypedPath(str(test_file).replace(".jpg", ".ss"))
15+
"""Return the path to the snapshot file for the current test."""
16+
test_dir = os.path.dirname(str(test_file))
17+
test_name = os.path.splitext(os.path.basename(str(test_file)))[0]
18+
return TypedPath(os.path.join(test_dir, f"{test_name}.ss"))
1619

1720

1821
def test_to_be_file():

python/pytest-selfie/dev-requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
-e file:///home/ubuntu/repos/selfie/python/selfie-lib ; python_version >= "3.9" and python_version < "4.0"
1+
-e ../selfie-lib
22
colorama==0.4.6 ; python_version >= "3.9" and python_version < "4.0" and sys_platform == "win32" \
33
--hash=sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44 \
44
--hash=sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
pytest>=8.0.0
2-
-e file:../selfie-lib
2+
-e ../selfie-lib

python/pytest-selfie/tests/test_plugin.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
import os
2-
from pathlib import Path
3-
from typing import Any
4-
52
import pytest
63
from _pytest.config import Config
4+
from pathlib import Path
5+
from typing import Any
76

87
from pytest_selfie.plugin import PytestSnapshotSystem, SelfieSettingsAPI
98
from selfie_lib import Mode, TypedPath
@@ -13,7 +12,7 @@ class MockConfig(Config): # type: ignore
1312
def __init__(self, tmp_path: Path):
1413
self._rootpath = tmp_path
1514

16-
def getoption(self, _name: str, default: Any = None, _skip: bool = False) -> Any:
15+
def getoption(self, name: str, default: Any = None, skip: bool = False) -> Any:
1716
return default
1817

1918
@property

0 commit comments

Comments
 (0)