-
Notifications
You must be signed in to change notification settings - Fork 3
Add python tests via Tox #313
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Changes from all commits
Commits
Show all changes
42 commits
Select commit
Hold shift + click to select a range
189b5df
Move data folder
ppinchuk aa3d373
Moce files
ppinchuk d70a8b9
Make integrated directory
ppinchuk 9043810
Update data directory fixture
ppinchuk f3af6f8
Fix path
ppinchuk d3e0bb6
Update some jurs names
ppinchuk b597743
Update notebook
ppinchuk f12148a
Update names
ppinchuk 3b856d5
Update notebook
ppinchuk 637e71f
Update notebook
ppinchuk 6e2d6c9
Remove duplicate district
ppinchuk 61385c9
Fix unit tests
ppinchuk eb90a04
Fix tests
ppinchuk 532ab73
Update commands
ppinchuk 21bc961
Deprecate lint action
ppinchuk 2ca474b
Add Python CI action
ppinchuk ef66b7c
Add tox config
ppinchuk 638622d
Fix typo
ppinchuk a7d2d9b
Add poppler install
ppinchuk a1ea962
Merge remote-tracking branch 'origin/main' into pp/tox
ppinchuk a75155a
Update action
ppinchuk 686677f
Update action
ppinchuk f1b2a1e
Install specific libs
ppinchuk ce8f81b
Mark test as flaky
ppinchuk 7e9ca92
Don't test 3.14 yet
ppinchuk 587d265
Up number of retries
ppinchuk ad5082c
Try to fix windows install
ppinchuk a11b4a1
Try to fix windows action
ppinchuk b56a133
Add conda install
ppinchuk d42fb72
Try to fix windows test
ppinchuk ba7b045
Don't test ptt
ppinchuk a1466c3
Mark test as flaky
ppinchuk e6f9740
Bump elm dep
ppinchuk 44d438a
Update test
ppinchuk 7fdffda
Try another fix for windows
ppinchuk 9aee45a
No command call
ppinchuk 97c98a4
No windows tox tests
ppinchuk be15b35
Mark test as flaky
ppinchuk affac9d
Bump numpy
ppinchuk b805ea0
`--frozen` -> `--locked`
ppinchuk f3e66a7
Add `fetch-tags: true`
ppinchuk ad623f3
Reference correct file
ppinchuk File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,152 @@ | ||
| name: Python checks | ||
|
|
||
| on: | ||
| push: | ||
| branches: [main] | ||
| paths: | ||
| - compass/** | ||
| - .github/workflows/ci-python.yml | ||
| - pyproject.toml | ||
| - pixi.lock | ||
| pull_request: | ||
| paths: | ||
| - compass/** | ||
| - .github/workflows/ci-python.yml | ||
| - pyproject.toml | ||
| - pixi.lock | ||
| workflow_dispatch: | ||
|
|
||
| jobs: | ||
| lint: | ||
| name: Lint Python Code Base with Ruff | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v5 | ||
| - uses: astral-sh/ruff-action@v3 | ||
| with: | ||
| version: "latest" | ||
| args: "check" | ||
| src: "./compass" | ||
| - uses: astral-sh/ruff-action@v3 | ||
| with: | ||
| version: "latest" | ||
| args: "format --check" | ||
| src: "./compass" | ||
|
|
||
| unit-tests: | ||
| needs: lint | ||
| name: Python Unit Tests (Pixi) | ||
| runs-on: ${{ matrix.os }} | ||
| strategy: | ||
| fail-fast: false | ||
| max-parallel: 8 | ||
| matrix: | ||
| os: [ubuntu-latest, macos-latest, windows-latest] | ||
|
|
||
| steps: | ||
| - name: Checkout Repo | ||
| uses: actions/checkout@v5 | ||
| with: | ||
| fetch-depth: 0 | ||
| fetch-tags: true | ||
|
|
||
| - uses: prefix-dev/setup-pixi@v0.9.2 | ||
| with: | ||
| pixi-version: v0.50.2 | ||
| locked: true | ||
| cache: true | ||
| cache-write: ${{ github.ref == 'refs/heads/main' }} | ||
| environments: pdev | ||
|
|
||
| - run: | | ||
| pixi run -e pdev --locked tests-u | ||
|
|
||
| integration-tests: | ||
ppinchuk marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| needs: lint | ||
| name: Python Integration Tests (Pixi) | ||
| runs-on: ${{ matrix.os }} | ||
| strategy: | ||
| fail-fast: false | ||
| max-parallel: 8 | ||
| matrix: | ||
| os: [ubuntu-latest, macos-latest, windows-latest] | ||
|
|
||
| steps: | ||
| - name: Checkout Repo | ||
| uses: actions/checkout@v5 | ||
| with: | ||
| fetch-depth: 0 | ||
| fetch-tags: true | ||
|
|
||
| - uses: prefix-dev/setup-pixi@v0.9.2 | ||
| with: | ||
| pixi-version: v0.50.2 | ||
| locked: true | ||
| cache: true | ||
| cache-write: ${{ github.ref == 'refs/heads/main' }} | ||
| environments: pdev | ||
|
|
||
| - run: | | ||
| pixi run -e pdev --locked tests-i | ||
|
|
||
| tox-tests: | ||
| needs: lint | ||
| name: Python tests (Tox) | ||
| runs-on: ${{ matrix.os }} | ||
| strategy: | ||
| fail-fast: false | ||
| max-parallel: 8 | ||
| matrix: | ||
| os: [ubuntu-latest, macos-latest] | ||
| python-version: ['3.13', '3.12'] | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v5 | ||
| with: | ||
| fetch-depth: 0 | ||
| fetch-tags: true | ||
|
|
||
| - name: Set up Python ${{ matrix.python-version }} | ||
| uses: actions/setup-python@v6 | ||
| with: | ||
| python-version: ${{ matrix.python-version }} | ||
| cache: 'pip' | ||
|
|
||
| - name: Install Poppler Reqs (Linux) | ||
| if: ${{ runner.os == 'Linux' }} | ||
| shell: bash | ||
| run: | | ||
| sudo apt-get update | ||
| sudo apt-get install -y libpoppler-cpp-dev poppler-utils | ||
|
|
||
| - name: Install Poppler Reqs (Mac) | ||
| if: ${{ runner.os == 'macOS' }} | ||
| shell: bash | ||
| run: | | ||
| brew install poppler | ||
|
|
||
| - name: Install Dependencies | ||
| run: | | ||
| python -m pip install --upgrade pip | ||
| python -m pip install tox tox-gh-actions>=2.0 | ||
| python -m pip install pdftotext | ||
|
|
||
| - name: Load tox cache | ||
| uses: actions/cache/restore@v4 | ||
| with: | ||
| path: .tox/ | ||
| key: ${{ runner.os }}-${{ matrix.python-version }}-tox-v1-${{ hashFiles('**/pyproject.toml') }} | ||
| restore-keys: | | ||
| ${{ runner.os }}-${{ matrix.python-version }}-tox-v1- | ||
|
|
||
| - name: Test with tox | ||
| run: tox -e ${{ matrix.python-version == '3.12' && 'msv' || 'latest' }} | ||
ppinchuk marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| env: | ||
| PYTHONDEVMODE: 1 | ||
|
|
||
| - name: Save tox cache only on main | ||
| if: github.ref == 'refs/heads/main' | ||
| uses: actions/cache/save@v4 | ||
| with: | ||
| path: .tox/ | ||
| key: ${{ runner.os }}-${{ matrix.python-version }}-tox-v1-${{ hashFiles('**/pyproject.toml') }} | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.