Skip to content

Commit

Permalink
Revert to pyphonetics by upgrading HDX Python Country (OCHA-DAP#117)
Browse files Browse the repository at this point in the history
  • Loading branch information
mcarans authored Jun 26, 2024
1 parent c28f2a9 commit a903663
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 26 deletions.
8 changes: 4 additions & 4 deletions .config/pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/run-python-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
28 changes: 12 additions & 16 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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:.}",]
6 changes: 3 additions & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit a903663

Please sign in to comment.