Skip to content

Commit fb425c4

Browse files
kurodo3[bot]claude
andauthored
feat: scaffold orcapod-python-types repo with CI and PyPI publish workflow (#1)
* feat: scaffold orcapod-types package with hatchling + hatch-vcs Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * chore: add project metadata files * ci: add CI workflows (lint, type-check, test) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * ci: add release workflow and Linear sync * chore: add CODEOWNERS, dependabot, and planning docs * fix: add py.typed marker, version classifiers, and --python flag in CI matrix --------- Co-authored-by: agent-kurodo[bot] <268466204+agent-kurodo[bot]@users.noreply.github.com> Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 355511e commit fb425c4

19 files changed

Lines changed: 2187 additions & 2 deletions

‎.github/CODEOWNERS‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* @nauticalab/nauticalab

‎.github/dependabot.yml‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "github-actions"
4+
directory: "/"
5+
schedule:
6+
interval: "weekly"
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: License check
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
branch:
7+
description: 'Branch to check out'
8+
required: false
9+
type: string
10+
default: ''
11+
12+
jobs:
13+
license-check:
14+
name: License check
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v4
18+
with:
19+
fetch-depth: 0
20+
ref: ${{ inputs.branch != '' && inputs.branch || github.sha }}
21+
22+
- name: Install uv
23+
uses: astral-sh/setup-uv@v5
24+
25+
- name: Install dependencies
26+
run: uv sync --locked --dev
27+
28+
- name: Check dependency licenses
29+
run: >-
30+
uv run pip-licenses
31+
--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"
32+
--partial-match

‎.github/workflows/release-sync.yml‎

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Linear release sync
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
sync:
10+
runs-on: ubuntu-latest
11+
timeout-minutes: 5
12+
permissions:
13+
contents: read
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
17+
with:
18+
fetch-depth: 0
19+
- name: Sync Linear release
20+
uses: linear/linear-release-action@c0cb8354a362c24c6d3e0948f37fd66d07588e3f # v0
21+
with:
22+
access_key: ${{ secrets.LINEAR_ACCESS_KEY }}
23+
command: sync

‎.github/workflows/release.yml‎

Lines changed: 216 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,216 @@
1+
name: Release
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
version:
7+
description: 'Release version (e.g. 0.1.0 or v0.1.0 — leading v is stripped automatically)'
8+
required: true
9+
type: string
10+
branch:
11+
description: 'Branch to cut the release from (defaults to main)'
12+
required: false
13+
type: string
14+
default: main
15+
16+
jobs:
17+
validate-branch:
18+
name: Validate release branch
19+
runs-on: ubuntu-latest
20+
timeout-minutes: 5
21+
steps:
22+
- name: Check branch exists on origin
23+
env:
24+
GH_TOKEN: ${{ github.token }}
25+
BRANCH: ${{ inputs.branch }}
26+
run: |
27+
ENCODED_BRANCH="${BRANCH//\//%2F}"
28+
if ! gh api "repos/${{ github.repository }}/branches/${ENCODED_BRANCH}" --silent 2>/dev/null; then
29+
echo "::error::Branch '${BRANCH}' does not exist. Check for typos."
30+
exit 1
31+
fi
32+
echo "Branch '${BRANCH}' confirmed."
33+
34+
test:
35+
name: Test (Python ${{ matrix.python-version }})
36+
needs: [validate-branch]
37+
runs-on: ubuntu-latest
38+
timeout-minutes: 30
39+
strategy:
40+
fail-fast: true
41+
matrix:
42+
python-version: ["3.11", "3.12"]
43+
steps:
44+
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
45+
with:
46+
fetch-depth: 0
47+
ref: ${{ inputs.branch }}
48+
49+
- name: Install uv
50+
uses: astral-sh/setup-uv@e58605a9b6da7c637471fab8847a5e5a6b8df081 # v5
51+
52+
- name: Install dependencies
53+
run: uv sync --locked --dev --python ${{ matrix.python-version }}
54+
55+
- name: Lint
56+
run: uv run --python ${{ matrix.python-version }} ruff check src tests
57+
58+
- name: Format check
59+
run: uv run --python ${{ matrix.python-version }} ruff format --check src tests
60+
61+
- name: Type check
62+
run: uv run --python ${{ matrix.python-version }} basedpyright
63+
64+
- name: Run tests
65+
run: uv run --python ${{ matrix.python-version }} pytest --tb=short -q
66+
67+
license-check:
68+
needs: [validate-branch]
69+
uses: ./.github/workflows/_license-check.yml
70+
with:
71+
branch: ${{ inputs.branch }}
72+
73+
build:
74+
name: Build distribution
75+
needs: [test, license-check]
76+
runs-on: ubuntu-latest
77+
timeout-minutes: 20
78+
permissions:
79+
contents: write
80+
outputs:
81+
version: ${{ steps.normalize.outputs.version }}
82+
steps:
83+
- name: Normalize version
84+
id: normalize
85+
run: |
86+
VERSION="${{ inputs.version }}"
87+
VERSION="${VERSION#v}"
88+
echo "version=${VERSION}" >> "$GITHUB_OUTPUT"
89+
90+
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
91+
with:
92+
fetch-depth: 0
93+
ref: ${{ inputs.branch }}
94+
95+
- name: Configure git identity
96+
run: |
97+
git config user.name "github-actions[bot]"
98+
git config user.email "github-actions[bot]@users.noreply.github.com"
99+
100+
- name: Create local release tag
101+
run: git tag "v${{ steps.normalize.outputs.version }}"
102+
103+
- name: Install uv
104+
uses: astral-sh/setup-uv@e58605a9b6da7c637471fab8847a5e5a6b8df081 # v5
105+
106+
- name: Build wheel and sdist
107+
run: uv build
108+
109+
- name: Guard against duplicate tag
110+
run: |
111+
if git ls-remote --tags origin "refs/tags/v${{ steps.normalize.outputs.version }}" | grep -q .; then
112+
echo "::error::Tag v${{ steps.normalize.outputs.version }} already exists on origin. Aborting."
113+
exit 1
114+
fi
115+
116+
- name: Push release tag
117+
run: git push origin "v${{ steps.normalize.outputs.version }}"
118+
119+
- name: Upload dist artifact
120+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
121+
with:
122+
name: dist
123+
path: dist/
124+
if-no-files-found: error
125+
126+
publish-testpypi:
127+
name: Publish → TestPyPI
128+
needs: build
129+
runs-on: ubuntu-latest
130+
timeout-minutes: 10
131+
environment:
132+
name: testpypi
133+
url: https://test.pypi.org/p/orcapod-types
134+
permissions:
135+
id-token: write
136+
steps:
137+
- name: Install uv
138+
uses: astral-sh/setup-uv@e58605a9b6da7c637471fab8847a5e5a6b8df081 # v5
139+
140+
- name: Download dist artifact
141+
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
142+
with:
143+
name: dist
144+
path: dist/
145+
146+
- name: Publish to TestPyPI
147+
run: uv publish --publish-url https://test.pypi.org/legacy/ dist/*
148+
149+
publish-pypi:
150+
name: Publish → PyPI
151+
needs: [build, publish-testpypi]
152+
runs-on: ubuntu-latest
153+
timeout-minutes: 10
154+
environment:
155+
name: pypi
156+
url: https://pypi.org/p/orcapod-types
157+
permissions:
158+
id-token: write
159+
contents: write
160+
steps:
161+
- name: Install uv
162+
uses: astral-sh/setup-uv@e58605a9b6da7c637471fab8847a5e5a6b8df081 # v5
163+
164+
- name: Download dist artifact
165+
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
166+
with:
167+
name: dist
168+
path: dist/
169+
170+
- name: Publish to PyPI
171+
run: uv publish dist/*
172+
173+
- name: Create GitHub Release
174+
uses: softprops/action-gh-release@3bb12739c298aeb8a4eeaf626c5b8d85266b0e65 # v2.6.2
175+
with:
176+
tag_name: "v${{ needs.build.outputs.version }}"
177+
generate_release_notes: true
178+
files: dist/*
179+
180+
linear-sync:
181+
name: Sync Linear release
182+
needs: build
183+
runs-on: ubuntu-latest
184+
timeout-minutes: 5
185+
permissions:
186+
contents: read
187+
steps:
188+
- name: Checkout
189+
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
190+
with:
191+
fetch-depth: 0
192+
- name: Sync Linear release
193+
uses: linear/linear-release-action@c0cb8354a362c24c6d3e0948f37fd66d07588e3f # v0
194+
with:
195+
access_key: ${{ secrets.LINEAR_ACCESS_KEY }}
196+
command: sync
197+
version: "v${{ needs.build.outputs.version }}"
198+
199+
linear-complete:
200+
name: Complete Linear release
201+
needs: [build, publish-pypi, linear-sync]
202+
runs-on: ubuntu-latest
203+
timeout-minutes: 5
204+
permissions:
205+
contents: read
206+
steps:
207+
- name: Checkout
208+
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
209+
with:
210+
fetch-depth: 0
211+
- name: Complete Linear release
212+
uses: linear/linear-release-action@c0cb8354a362c24c6d3e0948f37fd66d07588e3f # v0
213+
with:
214+
access_key: ${{ secrets.LINEAR_ACCESS_KEY }}
215+
command: complete
216+
version: "v${{ needs.build.outputs.version }}"

‎.github/workflows/run-tests.yml‎

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
name: Run Tests
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
workflow_dispatch:
8+
9+
jobs:
10+
license-check:
11+
uses: ./.github/workflows/_license-check.yml
12+
13+
test:
14+
needs: license-check
15+
runs-on: ubuntu-latest
16+
strategy:
17+
matrix:
18+
python-version: ["3.11", "3.12"]
19+
20+
steps:
21+
- uses: actions/checkout@v4
22+
with:
23+
fetch-depth: 0
24+
25+
- name: Install uv
26+
uses: astral-sh/setup-uv@v5
27+
28+
- name: Set up Python ${{ matrix.python-version }}
29+
uses: actions/setup-python@v5
30+
with:
31+
python-version: ${{ matrix.python-version }}
32+
33+
- name: Install dependencies
34+
run: uv sync --locked --dev --python ${{ matrix.python-version }}
35+
36+
- name: Lint
37+
run: uv run ruff check src tests
38+
39+
- name: Format check
40+
run: uv run ruff format --check src tests
41+
42+
- name: Type check
43+
run: uv run basedpyright
44+
45+
- name: Run tests
46+
run: uv run pytest -v --cov=src --cov-report=term-missing --cov-report=xml
47+
48+
- name: Upload coverage reports to Codecov
49+
uses: codecov/codecov-action@v5
50+
51+
dependency-review:
52+
name: Dependency review
53+
runs-on: ubuntu-latest
54+
if: github.event_name == 'pull_request'
55+
steps:
56+
- uses: actions/checkout@v4
57+
58+
- name: Dependency review
59+
uses: actions/dependency-review-action@v4
60+
with:
61+
deny-licenses: >-
62+
GPL-2.0-only, GPL-2.0-or-later,
63+
GPL-3.0-only, GPL-3.0-or-later,
64+
AGPL-3.0-only, AGPL-3.0-or-later,
65+
LGPL-2.0-only, LGPL-2.0-or-later,
66+
LGPL-2.1-only, LGPL-2.1-or-later,
67+
LGPL-3.0-only, LGPL-3.0-or-later

‎.gitignore‎

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Python
2+
__pycache__/
3+
*.py[cod]
4+
*$py.class
5+
*.so
6+
.Python
7+
build/
8+
dist/
9+
*.egg-info/
10+
.eggs/
11+
*.egg
12+
13+
# Virtual environments
14+
.venv/
15+
venv/
16+
ENV/
17+
env/
18+
19+
# uv
20+
.uv/
21+
22+
# Testing
23+
.pytest_cache/
24+
.coverage
25+
coverage.xml
26+
htmlcov/
27+
.tox/
28+
29+
# Type checking
30+
.pyright/
31+
.mypy_cache/
32+
33+
# IDE
34+
.idea/
35+
.vscode/
36+
*.swp
37+
*.swo
38+
.DS_Store
39+
40+
# Hatch version file (generated)
41+
src/orcapod_types/_version.py

0 commit comments

Comments
 (0)