diff --git a/.config/pre-commit-config.yaml b/.config/pre-commit-config.yaml index f0e7722a..5ea3f61d 100644 --- a/.config/pre-commit-config.yaml +++ b/.config/pre-commit-config.yaml @@ -1,14 +1,14 @@ default_language_version: - python: python3.11 + python: python3.12 repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.5.0 + rev: v4.6.0 hooks: - id: trailing-whitespace - id: end-of-file-fixer - id: check-ast - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.4.4 + rev: v0.4.10 hooks: # Run the linter. - id: ruff @@ -17,7 +17,7 @@ repos: - id: ruff-format args: [--config, .config/ruff.toml] - repo: https://github.com/astral-sh/uv-pre-commit - rev: 0.1.44 + rev: 0.2.13 hooks: # Run the pip compile - id: pip-compile diff --git a/.github/workflows/run-python-tests.yaml b/.github/workflows/run-python-tests.yaml index 78c08163..c685318f 100644 --- a/.github/workflows/run-python-tests.yaml +++ b/.github/workflows/run-python-tests.yaml @@ -42,14 +42,15 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install --upgrade hatch + - name: Install Hatch + uses: pypa/hatch@install - name: Test with hatch/pytest run: | - hatch run test:test + hatch test - name: Check styling if: always() run: | - hatch run lint:style + hatch fmt --check - name: Publish Unit Test Results uses: EnricoMi/publish-unit-test-result-action@v2 if: always() diff --git a/pyproject.toml b/pyproject.toml index 62ee4bcf..200b6e11 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -36,7 +36,7 @@ requires-python = ">=3.8" dependencies = [ "hapi-schema>=0.8.9", "hdx-python-api>= 6.2.9", - "hdx-python-country>= 3.7.2, <3.7.3", + "hdx-python-country>= 3.7.4", "hdx-python-database[postgresql]>= 1.3.1", "hdx-python-scraper>= 2.3.7", "hdx-python-utilities>= 3.6.9", @@ -83,25 +83,21 @@ version_scheme = "python-simplified-semver" # Tests -[tool.hatch.envs.test] +[tool.hatch.envs.hatch-test] features = ["test"] -[tool.hatch.envs.test.scripts] -test = """ +[[tool.hatch.envs.hatch-test.matrix]] +python = ["3.12"] + +[tool.hatch.envs.hatch-test.scripts] +run = """ pytest -c .config/pytest.ini --rootdir=. --junitxml=test-results.xml \ --cov --cov-config=.config/coveragerc --no-cov-on-fail \ --cov-report=lcov --cov-report=term-missing """ -[[tool.hatch.envs.test.matrix]] -python = ["3.12"] - -[tool.hatch.envs.lint] -detached = true -dependencies = ["ruff"] - -[tool.hatch.envs.lint.scripts] -style = [ - "ruff check --config .config/ruff.toml --diff {args:.}", - "ruff format --config .config/ruff.toml --diff {args:.}", -] +[tool.hatch.envs.hatch-static-analysis.scripts] +format-check = ["ruff format --config .config/ruff.toml --check --diff {args:.}",] +format-fix = ["ruff format --config .config/ruff.toml {args:.}",] +lint-check = ["ruff check --config .config/ruff.toml {args:.}",] +lint-fix = ["ruff check --config .config/ruff.toml --fix {args:.}",] diff --git a/requirements.txt b/requirements.txt index 0ed7e86d..9546e846 100644 --- a/requirements.txt +++ b/requirements.txt @@ -64,7 +64,7 @@ hdx-python-api==6.3.1 # via # hapi-pipelines (pyproject.toml) # hdx-python-scraper -hdx-python-country==3.7.2 +hdx-python-country==3.7.4 # via # hapi-pipelines (pyproject.toml) # hdx-python-api @@ -206,7 +206,7 @@ pyyaml==6.0.1 # frictionless # pre-commit # tableschema-to-template -quantulum3==0.9.1 +quantulum3==0.9.2 # via hdx-python-api ratelimit==2.2.1 # via hdx-python-utilities @@ -242,7 +242,7 @@ ruamel-yaml==0.18.6 # via hdx-python-utilities ruamel-yaml-clib==0.2.8 # via ruamel-yaml -setuptools==70.1.0 +setuptools==70.1.1 # via ckanapi shellingham==1.5.4 # via typer