Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
run: uv python install ${{ matrix.python-version }}

- name: Install dependencies
run: uv sync --extra dev
run: uv sync --group dev

- name: Lint
run: uv run ruff check .
Expand Down Expand Up @@ -53,7 +53,7 @@ jobs:
uses: astral-sh/setup-uv@v7

- name: Install dependencies
run: uv sync --extra docs
run: uv sync --group docs

- name: Build docs
run: uv run mkdocs build
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
branches: [main]
workflow_dispatch: # Manual trigger
workflow_run:
workflows: ["Release (Manual)", "Release Please"]
workflows: ["Publish"]
types: [completed]

permissions:
Expand All @@ -32,7 +32,7 @@ jobs:
uses: astral-sh/setup-uv@v7

- name: Install dependencies
run: uv sync --extra docs
run: uv sync --group docs

- name: Build docs
run: uv run mkdocs build
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/latest-deps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
run: uv python install ${{ matrix.python-version }}

- name: Install with latest dependencies
run: uv sync --extra dev --upgrade
run: uv sync --group dev --upgrade

- name: Test
run: uv run pytest --cov=xarray_plotly
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pr-title.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: PR Title Check

on:
pull_request:
types: [opened, edited, synchronize, reopened]
types: [opened, edited, reopened]

jobs:
validate:
Expand Down
71 changes: 71 additions & 0 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: Publish

on:
push:
tags: ["v*"]
workflow_call:
inputs:
tag:
required: true
type: string

concurrency:
group: publish-${{ inputs.tag || github.ref_name }}
cancel-in-progress: false

permissions:
contents: write
id-token: write
attestations: write

jobs:
publish:
name: Build & publish to PyPI
runs-on: ubuntu-24.04
timeout-minutes: 10
environment:
name: pypi
url: https://pypi.org/project/xarray_plotly
steps:
- uses: actions/checkout@v4
with:
ref: ${{ inputs.tag || github.ref_name }}
fetch-depth: 0

- uses: astral-sh/setup-uv@v7
with:
enable-cache: true

- uses: actions/setup-python@v5
with:
python-version: "3.12"

- name: Build
run: uv build

- uses: pypa/gh-action-pypi-publish@release/v1

github-release:
name: Create GitHub Release
needs: [publish]
if: github.event_name == 'push' && needs.publish.result == 'success'
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.ref_name }}

- name: Create GitHub Release
run: |
if gh release view "$TAG" &>/dev/null; then
echo "Release $TAG already exists, skipping."
exit 0
fi
if [[ "$TAG" == *-* ]]; then
gh release create "$TAG" --generate-notes --prerelease
else
gh release create "$TAG" --generate-notes
fi
env:
GH_TOKEN: ${{ github.token }}
TAG: ${{ github.ref_name }}
43 changes: 0 additions & 43 deletions .github/workflows/publish.yml

This file was deleted.

42 changes: 0 additions & 42 deletions .github/workflows/release-please.yml

This file was deleted.

20 changes: 5 additions & 15 deletions .github/workflows/release.yml → .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,6 @@ name: Release
on:
push:
branches: [main]
workflow_dispatch:
inputs:
branch:
description: Branch to create the release from
required: true
default: main
prerelease:
description: Create a pre-release
type: boolean
default: false

permissions:
contents: write
Expand All @@ -35,17 +25,17 @@ jobs:
- uses: googleapis/release-please-action@v4
id: release
with:
token: ${{ steps.app-token.outputs.token }}
config-file: .release-please-config.json
manifest-file: .release-please-manifest.json
token: ${{ steps.app-token.outputs.token }}
target-branch: ${{ inputs.branch || github.ref_name }}
prerelease: ${{ inputs.prerelease }}

publish:
needs: [release-please]
needs: release-please
if: needs.release-please.outputs.release_created
permissions:
id-token: write
uses: ./.github/workflows/publish.yml
contents: write
attestations: write
uses: ./.github/workflows/publish.yaml
with:
tag: ${{ needs.release-please.outputs.tag_name }}
18 changes: 18 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
version: 2

mkdocs:
configuration: mkdocs.yml

build:
os: ubuntu-24.04
tools:
python: "3.13"
jobs:
pre_create_environment:
- asdf plugin add uv
- asdf install uv latest
- asdf global uv latest
create_environment:
- uv venv "${READTHEDOCS_VIRTUALENV_PATH}"
install:
- UV_PROJECT_ENVIRONMENT="${READTHEDOCS_VIRTUALENV_PATH}" uv sync --frozen --group docs
19 changes: 10 additions & 9 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,7 @@ Homepage = "https://github.com/FBumann/xarray_plotly"
Documentation = "https://fbumann.github.io/xarray_plotly"
Repository = "https://github.com/FBumann/xarray_plotly"

[project.optional-dependencies]
dev = [
"pytest==9.0.2",
"pytest-cov==7.0.0",
"mypy==1.19.1",
"ruff==0.15.7",
"pre-commit==4.5.1",
"nbstripout==0.9.1",
]
[dependency-groups]
docs = [
"mkdocs==1.6.1",
"mkdocs-material==9.7.6",
Expand All @@ -47,6 +39,15 @@ docs = [
"mkdocs-plotly-plugin==0.1.3",
"jupyter==1.1.1",
]
dev = [
{include-group = "docs"},
"pytest==9.0.2",
"pytest-cov==7.0.0",
"mypy==1.19.1",
"ruff==0.15.7",
"pre-commit==4.5.1",
"nbstripout==0.9.1",
]

[project.entry-points."xarray.backends"]
# Entry point for xarray to auto-register the accessor (xarray >= 2024.01)
Expand Down