-
Notifications
You must be signed in to change notification settings - Fork 6
CI, packaging and doc maintenance #47
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
benbovy
merged 18 commits into
xarray-contrib:master
from
benbovy:ci-packaging-maintenance
Nov 20, 2025
Merged
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
6918817
update pre-commit config
benbovy da0f9d0
run pre-commit on all files
benbovy 0760382
switch to pyproject / hatchling
benbovy 8d5fa3c
fix test import error
benbovy 8408513
ci: update pypi publish workflow
benbovy 0bdfda1
update rtd config
benbovy 7ca324c
fix rtc?
benbovy d4b714e
doc env: unpin dependencies
benbovy 186104e
ci: update test workflow
benbovy d479c0b
move and refactor conda environment files
benbovy 623538e
ci tests: switch back to conda (micromamba)
benbovy f9ed3e4
add more github config (dependabot, release)
benbovy b924910
ci: remove lint workflow (use pre-commit-ci)
benbovy fc15e55
ci: fix inspect package workflow?
benbovy ce51e14
fix pre-commit and some typing fixes
benbovy 37a617e
fix doc build
benbovy 55440fd
doc: switch to sphinx-book theme
benbovy eff81db
doc env: add missing theme packages
benbovy 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
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,6 @@ | ||
| version: 2 | ||
| updates: | ||
| - package-ecosystem: "github-actions" | ||
| directory: "/" | ||
| schedule: | ||
| interval: "monthly" |
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,5 @@ | ||
| changelog: | ||
| exclude: | ||
| authors: | ||
| - dependabot | ||
| - pre-commit-ci | ||
This file was deleted.
Oops, something went wrong.
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 |
|---|---|---|
| @@ -1,26 +1,46 @@ | ||
| name: Upload Python Package | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
| release: | ||
| types: [created] | ||
| types: [published] | ||
| pull_request: | ||
| paths: | ||
| - ".github/workflows/pypipublish.yml" | ||
| - "pyproject.toml" | ||
|
|
||
| jobs: | ||
| deploy: | ||
| dist: | ||
| name: Build & inspect package | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v2.3.4 | ||
| - name: Set up Python | ||
| uses: actions/setup-python@v2.1.4 | ||
| - uses: actions/checkout@v4 | ||
| with: | ||
| python-version: "3.x" | ||
| - name: Install dependencies | ||
| run: | | ||
| python -m pip install --upgrade pip | ||
| python -m pip install setuptools setuptools-scm wheel twine | ||
| - name: Build and publish | ||
| env: | ||
| TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} | ||
| TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} | ||
| run: | | ||
| python setup.py sdist bdist_wheel | ||
| twine upload dist/* | ||
| fetch-depth: 0 | ||
|
|
||
| - uses: hynek/build-and-inspect-python-package@v2 | ||
|
|
||
| publish: | ||
| name: Upload package to PyPI | ||
| needs: [dist] | ||
| runs-on: ubuntu-latest | ||
| environment: pypi | ||
| permissions: | ||
| id-token: write | ||
| attestations: write | ||
| contents: read | ||
| if: github.event_name == 'release' && github.event.action == 'published' | ||
| steps: | ||
| - name: Get dist files | ||
| uses: actions/download-artifact@v4 | ||
| with: | ||
| name: Packages | ||
| path: dist | ||
|
|
||
| - name: Generate artifact attestation for sdist and wheel | ||
| uses: actions/attest-build-provenance@v2 | ||
| with: | ||
| subject-path: "dist/*" | ||
|
|
||
| - name: Publish on PyPI | ||
| uses: pypa/gh-action-pypi-publish@release/v1 |
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 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 |
|---|---|---|
| @@ -1,25 +1,21 @@ | ||
| repos: | ||
| - repo: https://github.com/pre-commit/pre-commit-hooks | ||
| rev: v3.3.0 | ||
| rev: v5.0.0 | ||
| hooks: | ||
| - id: trailing-whitespace | ||
| - id: end-of-file-fixer | ||
| - id: check-docstring-first | ||
| - id: check-yaml | ||
| - id: double-quote-string-fixer | ||
|
|
||
| - repo: https://github.com/ambv/black | ||
| rev: 20.8b1 | ||
| - repo: https://github.com/astral-sh/ruff-pre-commit | ||
| rev: v0.14.5 | ||
| hooks: | ||
| - id: black | ||
| args: ["--line-length", "100", "--skip-string-normalization"] | ||
| - id: ruff-format | ||
| types_or: [ python, pyi ] | ||
| - id: ruff | ||
| args: [--fix] | ||
| types_or: [ python, pyi ] | ||
|
|
||
| - repo: https://gitlab.com/PyCQA/flake8 | ||
| rev: 3.8.4 | ||
| hooks: | ||
| - id: flake8 | ||
|
|
||
| - repo: https://github.com/PyCQA/isort | ||
| rev: 5.6.4 | ||
| hooks: | ||
| - id: isort | ||
| ci: | ||
| autofix_prs: false | ||
| autoupdate_schedule: quarterly |
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 |
|---|---|---|
| @@ -1,15 +1,20 @@ | ||
| # Required | ||
| version: 2 | ||
|
|
||
| # Build documentation in the doc/ directory with Sphinx | ||
| build: | ||
| os: "ubuntu-20.04" | ||
| tools: | ||
| python: "mambaforge-4.10" | ||
|
|
||
| sphinx: | ||
| configuration: doc/conf.py | ||
|
|
||
| conda: | ||
| environment: environment_doc.yml | ||
| environment: doc/environment.yml | ||
|
|
||
| python: | ||
| version: 3.8 | ||
| install: | ||
| - method: pip | ||
| path: . | ||
|
|
||
| formats: [] |
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,15 @@ | ||
| name: xoak | ||
| channels: | ||
| - conda-forge | ||
| dependencies: | ||
| - python | ||
| - numpy | ||
| - xarray | ||
| - dask | ||
| - scipy | ||
| - scikit-learn | ||
| - pys2index | ||
| - pytest | ||
| - pytest-cov | ||
| - pydata-sphinx-theme=0.15.4 | ||
| - sphinx-book-theme=1.1.4 |
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,55 @@ | ||
|
|
||
| code.literal { | ||
| background-color: unset; | ||
| border: unset; | ||
| } | ||
|
|
||
| .xr-wrap { | ||
| /* workaround when (ipy)widgets are present in output cells | ||
| * https://github.com/xarray-contrib/xarray-indexes/issues/14 | ||
| * only rely on pydata-sphinx-theme variables here! | ||
| */ | ||
| --xr-font-color0: var(--pst-color-text-base); | ||
| --xr-font-color2: var(--pst-color-text-base); | ||
| --xr-font-color3: var(--pst-color-text-base); | ||
| --xr-border-color: hsl(from var(--pst-color-text-base) h s calc(l + 40)); | ||
| --xr-disabled-color: hsl(from var(--pst-color-text-base) h s calc(l + 40)); | ||
| --xr-background-color: var(--pst-color-on-background); | ||
| --xr-background-color-row-even: hsl( | ||
| from var(--pst-color-on-background) h s calc(l - 5) | ||
| ); | ||
| --xr-background-color-row-odd: hsl( | ||
| from var(--pst-color-on-background) h s calc(l - 15) | ||
| ); | ||
|
|
||
| font-size: 0.9em; | ||
| margin-left: 1.25em; | ||
| } | ||
|
|
||
| html[data-theme="dark"] .xr-wrap { | ||
| --xr-border-color: hsl(from var(--pst-color-text-base) h s calc(l - 40)); | ||
| --xr-disabled-color: hsl(from var(--pst-color-text-base) h s calc(l - 40)); | ||
| --xr-background-color-row-even: hsl( | ||
| from var(--pst-color-on-background) h s calc(l + 5) | ||
| ); | ||
| --xr-background-color-row-odd: hsl( | ||
| from var(--pst-color-on-background) h s calc(l + 15) | ||
| ); | ||
| } | ||
|
|
||
| .xr-array-wrap, | ||
| .xr-var-data, | ||
| .xr-var-preview { | ||
| /* font-size: 0.9em; */ | ||
| } | ||
| .gp { | ||
| color: darkorange; | ||
| } | ||
|
|
||
| /* workaround Pydata Sphinx theme using light colors for widget cell outputs in dark-mode */ | ||
| /* works for many widgets but not for Xarray html reprs */ | ||
| /* https://github.com/pydata/pydata-sphinx-theme/issues/2189 */ | ||
| html[data-theme="dark"] .output_area.rendered_html:has(div.xr-wrap) { | ||
| background-color: var(--pst-color-on-background) !important; | ||
| color: var(--pst-color-text-base) !important; | ||
| } |
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.