-
Notifications
You must be signed in to change notification settings - Fork 25
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
Move to Pixi, Hatchling, Pre-commit, and Ruff #142
Merged
Merged
Changes from 9 commits
Commits
Show all changes
36 commits
Select commit
Hold shift + click to select a range
9b29faf
Add pixi.toml
hoxbro 6258e2f
Add upperpins for now
hoxbro 1b124bf
Move tool settings to pyproject.toml
hoxbro 24f3e1f
Move to simple ruff
hoxbro 0e835d3
Add simple pre-commit for now
hoxbro 8c2f04d
Add core test run
hoxbro 1864e97
Format test.yaml
hoxbro f839804
Update test.yaml
hoxbro 9f453fd
Add test-example
hoxbro fbdade1
Remove script
hoxbro 4e5ad57
Switch to hatchling as build-backend
hoxbro 5ca0c2b
Update __version__ file
hoxbro b6adcc3
Update pixi toml with build and lint
hoxbro 740fbe3
Try pygeos for 3.9
hoxbro 4c480de
Update conda build
hoxbro fd38836
Remove pytest-rerunfailures
hoxbro 5cf401d
Clean up
hoxbro c40cbaa
Lit build.yaml
hoxbro 1f46a13
Update build file
hoxbro d67c42b
Add nighly lock
hoxbro 0258c63
run ruff lint on code
hoxbro 5c9b2ea
Remove config files
hoxbro 305ae7d
Lower pin s3fs
hoxbro 2713e21
Always use shapely backend for geopandas
hoxbro cebba92
Add moto back
hoxbro c53e2cf
Change s3fs pin to be spec 0 compatible
hoxbro 404cdac
Add lower pins to fsspec and pyarrow and remove param
hoxbro faa82e4
Update to work with moto 5
hoxbro 048fda0
Parameterize dask_remote test
hoxbro 9b45db9
Misc. changes
hoxbro 7242989
Reduce hypothesis runtime from 500 to 100
hoxbro 23e46bb
Automate conda meta
hoxbro 7cb36bf
Add rtree dependency as geopandas no longer use pygeos
hoxbro c3b2b56
Ignore test_intersection if point
hoxbro 8403b1c
Restore examples file
hoxbro b080a29
Remove clean notebook pre-commit
hoxbro 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 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 |
---|---|---|
|
@@ -5,50 +5,158 @@ on: | |
- main | ||
pull_request: | ||
branches: | ||
- '*' | ||
- "*" | ||
workflow_dispatch: | ||
inputs: | ||
target: | ||
description: "How much of the test suite to run" | ||
type: choice | ||
default: default | ||
options: | ||
- default | ||
- full | ||
- downstream | ||
cache: | ||
description: "Use cache" | ||
type: boolean | ||
default: true | ||
|
||
schedule: | ||
- cron: '0 01 * * SUN' | ||
- cron: "0 01 * * SUN" | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | ||
cancel-in-progress: true | ||
|
||
defaults: | ||
run: | ||
shell: bash -el {0} | ||
|
||
env: | ||
COLUMNS: 120 | ||
DISPLAY: ":99.0" | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
COV: "--cov=./spatialpandas --cov-report=xml" | ||
|
||
jobs: | ||
test_suite: | ||
name: Tests on ${{ matrix.os }} with Python ${{ matrix.python-version }} | ||
pre_commit: | ||
name: Run pre-commit | ||
runs-on: "ubuntu-latest" | ||
steps: | ||
- uses: holoviz-dev/holoviz_tasks/pre-commit@v0 | ||
|
||
setup: | ||
name: Setup workflow | ||
runs-on: ubuntu-latest | ||
permissions: | ||
pull-requests: read | ||
outputs: | ||
code_change: ${{ steps.filter.outputs.code }} | ||
matrix: ${{ env.MATRIX }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
if: github.event_name != 'pull_request' | ||
- name: Check for code changes | ||
uses: dorny/paths-filter@v3 | ||
id: filter | ||
with: | ||
filters: | | ||
code: | ||
- 'spatialpandas/**' | ||
- 'examples/**' | ||
- 'pixi.toml' | ||
- 'pyproject.toml' | ||
- '.github/workflows/test.yaml' | ||
- name: Set matrix option | ||
run: | | ||
if [[ '${{ github.event_name }}' == 'workflow_dispatch' ]]; then | ||
OPTION=${{ github.event.inputs.target }} | ||
elif [[ '${{ github.event_name }}' == 'schedule' ]]; then | ||
OPTION="full" | ||
elif [[ '${{ github.event_name }}' == 'push' && '${{ github.ref_type }}' == 'tag' ]]; then | ||
OPTION="full" | ||
else | ||
OPTION="default" | ||
fi | ||
echo "MATRIX_OPTION=$OPTION" >> $GITHUB_ENV | ||
- name: Set test matrix with 'default' option | ||
if: env.MATRIX_OPTION == 'default' | ||
run: | | ||
MATRIX=$(jq -nsc '{ | ||
"os": ["ubuntu-latest", "macos-latest", "windows-latest"], | ||
"environment": ["test-39", "test-312"] | ||
}') | ||
echo "MATRIX=$MATRIX" >> $GITHUB_ENV | ||
- name: Set test matrix with 'full' option | ||
if: env.MATRIX_OPTION == 'full' | ||
run: | | ||
MATRIX=$(jq -nsc '{ | ||
"os": ["ubuntu-latest", "macos-latest", "windows-latest"], | ||
"environment": ["test-39", "test-310", "test-311", "test-312"] | ||
}') | ||
echo "MATRIX=$MATRIX" >> $GITHUB_ENV | ||
- name: Set test matrix with 'downstream' option | ||
if: env.MATRIX_OPTION == 'downstream' | ||
run: | | ||
MATRIX=$(jq -nsc '{ | ||
"os": ["ubuntu-latest"], | ||
"environment": ["test-311"] | ||
}') | ||
echo "MATRIX=$MATRIX" >> $GITHUB_ENV | ||
|
||
pixi_lock: | ||
name: Pixi lock | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: holoviz-dev/holoviz_tasks/pixi_lock@pixi | ||
with: | ||
cache: ${{ github.event.inputs.cache == 'true' || github.event.inputs.cache == '' }} | ||
|
||
unit_test_suite: | ||
name: unit:${{ matrix.environment }}:${{ matrix.os }} | ||
needs: [pre_commit, setup, pixi_lock] | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: ${{ fromJson(needs.setup.outputs.matrix) }} | ||
timeout-minutes: 120 | ||
steps: | ||
- uses: holoviz-dev/holoviz_tasks/pixi_install@pixi | ||
if: needs.setup.outputs.code_change == 'true' | ||
with: | ||
environments: ${{ matrix.environment }} | ||
- name: Test Unit | ||
if: needs.setup.outputs.code_change == 'true' | ||
run: | | ||
pixi run -e ${{ matrix.environment }} test-unit $COV | ||
- name: Test Examples | ||
if: needs.setup.outputs.code_change == 'true' | ||
run: | | ||
pixi run -e ${{ matrix.environment }} test-example | ||
- uses: codecov/codecov-action@v4 | ||
if: needs.setup.outputs.code_change == 'true' | ||
with: | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
|
||
core_test_suite: | ||
name: core:${{ matrix.environment }}:${{ matrix.os }} | ||
needs: [pre_commit, setup, pixi_lock] | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: ['ubuntu-latest', 'macos-latest', 'windows-latest'] | ||
python-version: ["3.9", "3.10", "3.11"] | ||
timeout-minutes: 90 | ||
defaults: | ||
run: | ||
shell: bash -l {0} | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
os: ["ubuntu-latest"] | ||
environment: ["test-core"] | ||
timeout-minutes: 120 | ||
steps: | ||
- uses: holoviz-dev/holoviz_tasks/[email protected] | ||
- uses: holoviz-dev/holoviz_tasks/pixi_install@pixi | ||
if: needs.setup.outputs.code_change == 'true' | ||
with: | ||
name: unit_test_suite | ||
python-version: ${{ matrix.python-version }} | ||
channel-priority: strict | ||
channels: pyviz/label/dev,conda-forge,nodefaults | ||
envs: "-o tests" | ||
cache: true | ||
conda-update: true | ||
id: install | ||
- name: doit test_lint | ||
if: runner.os != 'Windows' | ||
run: | | ||
conda activate test-environment | ||
doit test_lint | ||
- name: doit test_unit_deploy | ||
run: | | ||
conda activate test-environment | ||
doit test_unit_deploy | ||
environments: ${{ matrix.environment }} | ||
- name: Check packages latest version | ||
if: needs.setup.outputs.code_change == 'true' | ||
run: | | ||
pixi run -e ${{ matrix.environment }} check-latest-packages numpy pandas bokeh panel param | ||
- name: Test Unit | ||
if: needs.setup.outputs.code_change == 'true' | ||
run: | | ||
pixi run -e ${{ matrix.environment }} test-unit |
This file contains 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.
This file contains 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,37 @@ | ||
exclude: (\.(js|svg)$) | ||
|
||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v4.6.0 | ||
hooks: | ||
- id: check-builtin-literals | ||
- id: check-case-conflict | ||
- id: check-docstring-first | ||
- id: check-executables-have-shebangs | ||
- id: check-toml | ||
- id: detect-private-key | ||
- id: end-of-file-fixer | ||
- id: trailing-whitespace | ||
- repo: https://github.com/astral-sh/ruff-pre-commit | ||
rev: v0.5.6 | ||
hooks: | ||
- id: ruff | ||
files: datashader/ | ||
- repo: https://github.com/hoxbro/clean_notebook | ||
rev: v0.1.15 | ||
hooks: | ||
- id: clean-notebook | ||
# - repo: https://github.com/codespell-project/codespell | ||
# rev: v2.3.0 | ||
# hooks: | ||
# - id: codespell | ||
# additional_dependencies: | ||
# - tomli | ||
# - repo: https://github.com/pycqa/isort | ||
# rev: 5.13.2 | ||
# hooks: | ||
# - id: isort | ||
# name: isort (python) | ||
|
||
ci: | ||
autofix_prs: false |
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if we should add this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't think so, at least for now. The examples notebooks are deliberately checked in with the output.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have restored the output of the notebooks