Skip to content

Commit

Permalink
Add support for Python 3.13
Browse files Browse the repository at this point in the history
* Upgrade pre-commit dependencies
* Upgrade Python requirements
  • Loading branch information
replaceafill authored Jan 13, 2025
1 parent 05b4bfa commit 5296a54
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 18 deletions.
11 changes: 6 additions & 5 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,15 @@ on:
jobs:
test:
name: "Test Python ${{ matrix.python-version }}"
runs-on: "ubuntu-22.04"
runs-on: "ubuntu-24.04"
strategy:
matrix:
python-version: [
"3.9",
"3.10",
"3.11",
"3.12",
"3.13",
]
steps:
- name: "Check out repository"
Expand All @@ -32,10 +33,10 @@ jobs:
- name: "Install tox"
run: |
python -m pip install --upgrade pip
pip install tox tox-gh-actions
pip install tox
- name: "Run tox"
run: |
tox -- --cov fixity --cov-config .coveragerc --cov-report xml:coverage.xml
tox -e py3 -- --cov fixity --cov-config .coveragerc --cov-report xml:coverage.xml
- name: "Upload coverage report"
if: github.repository == 'artefactual/fixity'
uses: "codecov/codecov-action@v4"
Expand All @@ -47,14 +48,14 @@ jobs:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
lint:
name: "Lint"
runs-on: "ubuntu-22.04"
runs-on: "ubuntu-24.04"
steps:
- name: "Check out repository"
uses: "actions/checkout@v4"
- name: "Set up Python"
uses: "actions/setup-python@v5"
with:
python-version: "3.12"
python-version: "3.x"
cache-dependency-path: |
requirements.txt
requirements-dev.txt
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.8.5
rev: v0.9.1
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
Expand Down
10 changes: 2 additions & 8 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ classifiers = [
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
]
authors = [
{name = "Artefactual Systems Inc.", email = "info@artefactual.com"}
Expand Down Expand Up @@ -106,14 +107,7 @@ omit = [
[tool.tox]
legacy_tox_ini = """
[tox]
envlist = py{39,310,311,312}, linting
[gh-actions]
python =
3.9: py39
3.10: py310
3.11: py311
3.12: py312
envlist = py3{9,10,11,12,13}, linting
[testenv]
skip_install = true
Expand Down
6 changes: 3 additions & 3 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ pytest-cov==6.0.0
# via fixity (pyproject.toml)
requests==2.32.3
# via fixity (pyproject.toml)
ruff==0.8.5
ruff==0.9.1
# via fixity (pyproject.toml)
sqlalchemy==2.0.36
sqlalchemy==2.0.37
# via fixity (pyproject.toml)
tomli==2.2.1
# via
Expand All @@ -68,5 +68,5 @@ zipp==3.21.0
# The following packages are considered to be unsafe in a requirements file:
pip==24.3.1
# via pip-tools
setuptools==75.6.0
setuptools==75.8.0
# via pip-tools
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ idna==3.10
# via requests
requests==2.32.3
# via fixity (pyproject.toml)
sqlalchemy==2.0.36
sqlalchemy==2.0.37
# via fixity (pyproject.toml)
typing-extensions==4.12.2
# via sqlalchemy
Expand Down
3 changes: 3 additions & 0 deletions tests/test_fixity.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,18 +88,21 @@ def test_scan(
]


@mock.patch("time.time_ns")
@mock.patch("time.time")
@mock.patch("requests.get")
def test_scan_if_timestamps_argument_is_passed(
_get: mock.Mock,
time: mock.Mock,
time_ns: mock.Mock,
environment: None,
mock_check_fixity: list[mock.Mock],
) -> None:
_get.side_effect = mock_check_fixity
aip_id = uuid.uuid4()
timestamp = 1514775600
time.return_value = timestamp
time_ns.return_value = timestamp * (10**9)
stream = io.StringIO()

response = fixity.main(["scan", str(aip_id), "--timestamps"], stream=stream)
Expand Down

0 comments on commit 5296a54

Please sign in to comment.