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
25 changes: 25 additions & 0 deletions .github/workflows/_license-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: License check

on:
workflow_call:

jobs:
license-check:
name: License check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # required: hatch-vcs runs during uv sync

- name: Install uv
uses: astral-sh/setup-uv@v5

- name: Install dependencies
run: uv sync --locked --dev

- name: Check dependency licenses
run: >-
uv run pip-licenses
--allow-only="MIT;Apache-2.0;Apache 2.0;Apache Software License;BSD-2-Clause;BSD-3-Clause;BSD License;BSD;ISC;LGPL-3.0-only;MPL-2.0;Mozilla Public License;Python-2.0;PSF-2.0;Python Software Foundation License;Unlicense"
--partial-match
111 changes: 111 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
name: Publish to PyPI

on:
push:

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed: changed to "v[0-9]*.[0-9]*.[0-9]*" using glob * quantifiers. GitHub Actions tag filters use fnmatch-style globs, not regex — the previous + was treated as a literal character and would never have triggered. The updated pattern matches v0.1.0, v1.2.3, and pre-releases like v0.1.0rc1.

tags:
- "v[0-9]*.[0-9]*.[0-9]*"

jobs:
license-check:
uses: ./.github/workflows/_license-check.yml

test:
name: Test (Python ${{ matrix.python-version }})
needs: license-check
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
python-version: ["3.11", "3.12"]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # required: hatch-vcs needs full tag history

- name: Install uv
uses: astral-sh/setup-uv@v5

- name: Set up Python ${{ matrix.python-version }}
run: uv python install ${{ matrix.python-version }}

- name: Install system dependencies
run: sudo apt-get update && sudo apt-get install -y graphviz libgraphviz-dev

- name: Install dependencies
run: uv sync --locked --all-extras --dev --python ${{ matrix.python-version }}

- name: Run tests
run: uv run --python ${{ matrix.python-version }} pytest -m "not postgres" --tb=short -q

build:
name: Build distribution
needs: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # required: hatch-vcs reads tag to set version

- name: Install uv
uses: astral-sh/setup-uv@v5

- name: Build wheel and sdist
run: uv build

- name: Upload dist artifact
uses: actions/upload-artifact@v4
with:
name: dist
path: dist/
if-no-files-found: error

publish-testpypi:
name: Publish → TestPyPI
needs: build
runs-on: ubuntu-latest
environment:
name: testpypi
url: https://test.pypi.org/p/orcapod
permissions:
id-token: write # required for OIDC Trusted Publishing
steps:
- name: Install uv
uses: astral-sh/setup-uv@v5

- name: Download dist artifact
uses: actions/download-artifact@v4
with:
name: dist
path: dist/

- name: Publish to TestPyPI
run: uv publish --publish-url https://test.pypi.org/legacy/ dist/*

publish-pypi:
name: Publish → PyPI
needs: publish-testpypi
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/orcapod
permissions:
id-token: write # required for OIDC Trusted Publishing
contents: write # required for creating GitHub Release
steps:
- name: Install uv
uses: astral-sh/setup-uv@v5

- name: Download dist artifact
uses: actions/download-artifact@v4
with:
name: dist
path: dist/

- name: Publish to PyPI
run: uv publish dist/*

- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
generate_release_notes: true
files: dist/*
26 changes: 26 additions & 0 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,16 @@ on:

jobs:
test:
needs: license-check
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.11", "3.12"]

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # required: hatch-vcs needs full tag history

- name: Install uv
uses: astral-sh/setup-uv@v5
Expand Down Expand Up @@ -64,6 +67,8 @@ jobs:

- uses: actions/checkout@v4
if: env.SPIRAL_WORKLOAD_ID != ''
with:
fetch-depth: 0 # required: hatch-vcs needs full tag history

- name: Install uv
if: env.SPIRAL_WORKLOAD_ID != ''
Expand All @@ -86,3 +91,24 @@ jobs:
- name: Run SpiralDB integration tests
if: env.SPIRAL_WORKLOAD_ID != ''
run: uv run pytest tests/test_databases/test_spiraldb_connector_integration.py -v

license-check:
uses: ./.github/workflows/_license-check.yml

dependency-review:
name: Dependency review
runs-on: ubuntu-latest
if: github.event_name == 'pull_request'
steps:
- uses: actions/checkout@v4

- name: Dependency review
uses: actions/dependency-review-action@v4
with:
deny-licenses: >-
GPL-2.0-only, GPL-2.0-or-later,
GPL-3.0-only, GPL-3.0-or-later,
AGPL-3.0-only, AGPL-3.0-or-later,
LGPL-2.0-only, LGPL-2.0-or-later,
LGPL-2.1-only, LGPL-2.1-or-later,
LGPL-3.0-only, LGPL-3.0-or-later
18 changes: 11 additions & 7 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[build-system]
requires = ["setuptools>=64", "wheel", "setuptools-scm>=8"]

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed: pinned hatchling>=1.21.0 and hatch-vcs>=0.4.0. These minimums ensure the source = "vcs" option (added in hatch-vcs 0.3.0) and the VCS hook are available, matching the spirit of the previous setuptools>=64/setuptools-scm>=8 pins.

build-backend = "setuptools.build_meta"
requires = ["hatchling>=1.21.0", "hatch-vcs>=0.4.0"]
build-backend = "hatchling.build"

[project]
name = "orcapod"
Expand Down Expand Up @@ -38,7 +38,7 @@ classifiers = [
]

[project.urls]
Homepage = "https://github.com/walkerlab/orcapod-python"
Homepage = "https://github.com/nauticalab/orcapod-python"

[project.optional-dependencies]
redis = ["redis>=6.2.0"]
Expand All @@ -50,11 +50,14 @@ spiraldb = [
all = ["orcapod[redis]", "orcapod[ray]", "orcapod[postgresql]", "orcapod[spiraldb]"]


[tool.setuptools.packages.find]
where = ["src"]
[tool.hatch.version]
source = "vcs"

[tool.setuptools_scm]
version_file = "src/orcapod/_version.py"
[tool.hatch.build.hooks.vcs]
version-file = "src/orcapod/_version.py"

[tool.hatch.build.targets.wheel]
packages = ["src/orcapod"]


[dependency-groups]
Expand All @@ -80,6 +83,7 @@ dev = [
"redis>=6.2.0",
"ruff>=0.14.4",
"testcontainers[minio]>=4.0.0",
"pip-licenses>=5.0.0",
"tqdm>=4.67.1",
"mkdocs-material>=9.7.5",
"mkdocstrings[python]>=1.0.3",
Expand Down
37 changes: 32 additions & 5 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading