Skip to content

Commit

Permalink
Merge pull request #215 from khaeru/fix/xml-v21-cat-target
Browse files Browse the repository at this point in the history
Fix read of str:Categorisation > str:Target from SDMX-ML 2.1
  • Loading branch information
khaeru authored Dec 17, 2024
2 parents 13a4957 + cf06118 commit 2accc1c
Show file tree
Hide file tree
Showing 7 changed files with 109 additions and 75 deletions.
41 changes: 22 additions & 19 deletions .github/workflows/pytest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,23 +44,22 @@ jobs:
repository: khaeru/sdmx-test-data
path: sdmx-test-data

- uses: actions/setup-python@v5
- uses: astral-sh/setup-uv@v4
with:
python-version: ${{ matrix.python-version }}
cache: pip
cache-dependency-path: "**/pyproject.toml"
enable-cache: true
cache-dependency-glob: "**/pyproject.toml"

- name: Upgrade pip
run: python -m pip install --upgrade pip

- name: Install the Python package and dependencies
run: pip install .[tests]
- name: Install Python, the package, and dependencies
run: |
uv venv --python=${{ matrix.python-version }}
uv pip install .[tests]
- name: Run pytest
env:
SDMX_TEST_DATA: ./sdmx-test-data/
run: |
pytest \
uv run --no-sync \
pytest \
-ra --color=yes --verbose \
--cov-report=xml \
--numprocesses auto
Expand All @@ -77,12 +76,16 @@ jobs:

steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with: { python-version: 3.x }

- name: Force recreation of pre-commit virtual environment for mypy
if: github.event_name == 'schedule' # Comment this line to run on a PR
run: gh cache list -L 999 | cut -f2 | grep pre-commit | xargs -I{} gh cache delete "{}" || true
env: { GH_TOKEN: "${{ github.token }}" }

- uses: pre-commit/[email protected]
- uses: astral-sh/setup-uv@v4
with:
enable-cache: true
cache-dependency-glob: "**/pyproject.toml"
- uses: actions/cache@v4
with:
path: ~/.cache/pre-commit
key: ${{ github.job }}|${{ hashFiles('.pre-commit-config.yaml') }}
lookup-only: ${{ github.event_name == 'schedule' }}
# lookup-only: true
- name: Run pre-commit
# TEMPORARY Use Python 3.12 to avoid https://github.com/python/mypy/issues/18216
run: uvx --python=3.12 pre-commit run --all-files --show-diff-on-failure --color=always
29 changes: 16 additions & 13 deletions .github/workflows/sources.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,21 +63,23 @@ jobs:
repository: khaeru/sdmx-test-data
path: sdmx-test-data

- uses: actions/setup-python@v5
- uses: astral-sh/setup-uv@v4
with:
python-version: 3.x
cache: pip
cache-dependency-path: "**/pyproject.toml"
enable-cache: true
cache-dependency-glob: "**/pyproject.toml"

- name: Install the Python package and dependencies
run: pip install .[cache,tests] pytest-regex
- name: Install Python, the package, and dependencies
run: |
uv venv --python=${{ matrix.python-version }}
uv pip install .[tests] pytest-regex
- name: Tests of ${{ matrix.source }} data source
continue-on-error: true
env:
SDMX_TEST_DATA: ./sdmx-test-data/
run: |
pytest -m network --regex '.*Test${{ matrix.source }}:' \
uv run \
pytest -m network --regex '.*Test${{ matrix.source }}:' \
--color=yes --durations=30 -rA --verbose \
--cov-report=xml \
--numprocesses=auto
Expand All @@ -101,14 +103,15 @@ jobs:
steps:
- uses: actions/checkout@v4

- uses: actions/setup-python@v5
- uses: astral-sh/setup-uv@v4
with:
python-version: 3.x
cache: pip
cache-dependency-path: "**/pyproject.toml"
enable-cache: true
cache-dependency-glob: "**/pyproject.toml"

- name: Install the Python package and dependencies
run: pip install .[cache,tests]
- name: Install Python, the package, and dependencies
run: |
uv venv --python=${{ matrix.python-version }}
uv pip install .[tests] pytest-regex
- name: Download artifacts
uses: actions/download-artifact@v4
Expand Down
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.12.0
rev: v1.13.0
hooks:
- id: mypy
additional_dependencies:
Expand All @@ -15,7 +15,7 @@ repos:
- types-requests
args: []
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.6.9
rev: v0.8.3
hooks:
- id: ruff
- id: ruff-format
Expand Down
Loading

0 comments on commit 2accc1c

Please sign in to comment.