Skip to content

Commit

Permalink
Bump Python version to 3.13
Browse files Browse the repository at this point in the history
  • Loading branch information
spencerwooo committed Feb 10, 2025
1 parent f9407bf commit a756d70
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- name: Install uv
uses: astral-sh/setup-uv@v4
with:
python-version: "3.12"
python-version: "3.13"

- name: Install the project's dev dependencies
# run: uv sync --dev --group test
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
- name: Install uv
uses: astral-sh/setup-uv@v4
with:
python-version: "3.12"
python-version: "3.13"

- name: Install the project's dev dependencies
run: uv sync --group docs
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pypi-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- name: Install uv
uses: astral-sh/setup-uv@v4
with:
python-version: "3.12"
python-version: "3.13"

- name: Install the project with build deps
run: uv sync
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ classifiers = [
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3 :: Only",
"Topic :: Software Development :: Libraries :: Python Modules",
]
Expand Down
10 changes: 4 additions & 6 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,10 @@ def device() -> torch.device:


@pytest.fixture()
def data() -> (
Callable[
[Callable[[Image.Image | torch.Tensor], torch.Tensor]],
tuple[torch.Tensor, torch.Tensor],
]
):
def data() -> Callable[
[Callable[[Image.Image | torch.Tensor], torch.Tensor]],
tuple[torch.Tensor, torch.Tensor],
]:
def _open_and_transform_image(
transform: Callable[[Image.Image | torch.Tensor], torch.Tensor],
) -> tuple[torch.Tensor, torch.Tensor]:
Expand Down
4 changes: 2 additions & 2 deletions torchattack/_attack.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,13 +87,13 @@ def __eq__(self, other: Any) -> bool:
continue
self_val = getattr(self, attr)
other_val = getattr(other, attr)

if isinstance(self_val, torch.Tensor):
if not isinstance(other_val, torch.Tensor):
return False
if not torch.equal(self_val, other_val):
return False
elif self_val != other_val:
return False

return True

0 comments on commit a756d70

Please sign in to comment.