Skip to content

Commit 568b84e

Browse files
committed
add publishing workflow with github actions support
1 parent cfcdedb commit 568b84e

9 files changed

Lines changed: 1576 additions & 1268 deletions

File tree

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Publish to PyPi
2+
on:
3+
push:
4+
tags:
5+
# Publish on any tag starting with a `v`, e.g., v0.1.0
6+
- cheese3d-annotator/v*
7+
jobs:
8+
pypi-publish:
9+
runs-on: ubuntu-latest
10+
environment:
11+
name: pypi
12+
permissions:
13+
id-token: write
14+
contents: read
15+
steps:
16+
- uses: actions/checkout@v4
17+
- name: Validate version matches tag
18+
run: |
19+
TAG_VERSION="${GITHUB_REF#refs/tags/cheese3d-annotator/v}"
20+
TOML_VERSION=$(grep '^version' packages/cheese3d-annotator/pyproject.toml | head -1 | sed 's/version = "\(.*\)"/\1/')
21+
if [ "$TAG_VERSION" != "$TOML_VERSION" ]; then
22+
echo "Tag version ($TAG_VERSION) does not match pyproject.toml ($TOML_VERSION)"
23+
exit 1
24+
fi
25+
- name: Install dependencies
26+
uses: prefix-dev/setup-pixi@v0.9.5
27+
with:
28+
pixi-version: v0.66.0
29+
cache: false
30+
# cache-write: ${{ github.event_name == 'push' && github.ref_name == 'main' }}
31+
environments: default
32+
- name: Publish to PyPi
33+
run: pixi run publish-ci cheese3d-annotator
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Publish to PyPi
2+
on:
3+
push:
4+
tags:
5+
# Publish on any tag starting with a `v`, e.g., v0.1.0
6+
- cheese3d/v*
7+
jobs:
8+
pypi-publish:
9+
runs-on: ubuntu-latest
10+
environment:
11+
name: pypi
12+
permissions:
13+
id-token: write
14+
contents: read
15+
steps:
16+
- uses: actions/checkout@v4
17+
- name: Validate version matches tag
18+
run: |
19+
TAG_VERSION="${GITHUB_REF#refs/tags/cheese3d/v}"
20+
TOML_VERSION=$(grep '^version' packages/cheese3d/pyproject.toml | head -1 | sed 's/version = "\(.*\)"/\1/')
21+
if [ "$TAG_VERSION" != "$TOML_VERSION" ]; then
22+
echo "Tag version ($TAG_VERSION) does not match pyproject.toml ($TOML_VERSION)"
23+
exit 1
24+
fi
25+
- name: Install dependencies
26+
uses: prefix-dev/setup-pixi@v0.9.5
27+
with:
28+
pixi-version: v0.66.0
29+
cache: false
30+
# cache-write: ${{ github.event_name == 'push' && github.ref_name == 'main' }}
31+
environments: default
32+
- name: Publish to PyPi
33+
run: pixi run publish-ci cheese3d
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# `cheese3d-annotator` Python package
2+
3+
[![Documentation](https://img.shields.io/badge/docs-latest-blue)](https://hou-lab-cshl.github.io/cheese3d/)
4+
5+
Cheese3D is a pipeline for tracking mouse facial movements built on top of existing tools ([DeepLabCut](https://github.com/DeepLabCut/DeepLabCut) and [Anipose](https://github.com/lambdaloop/anipose)). By tracking anatomically-informed keypoints using multiple cameras registered in 3D, our pipeline produces sensitive, high-precision facial movement data that can be related internal state (e.g., electrophysiology).
6+
7+
**NEW!** Check out the [Cheese3D paper](https://www.nature.com/articles/s41593-026-02262-8).
8+
9+
`cheese3d-annotator` contains the Napari visualization tooling.
10+
Please see the [repository](https://github.com/Hou-Lab-CSHL/cheese3d) for complete information.

packages/cheese3d-annotator/cheese3d_annotator/__init__.py

Whitespace-only changes.

packages/cheese3d-annotator/pyproject.toml

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ authors = [
77
{ name = "Kyle Daruwalla", email = "daruwal@cshl.edu"},
88
{ name = "Rubin Zhao", email = "rzhao@cshl.edu"}
99
]
10-
readme = "../../README.md"
10+
readme = "README.md"
1111
requires-python = ">=3.10"
1212
dependencies = [
1313
"tables>=3.7.0",
@@ -27,11 +27,18 @@ dependencies = [
2727
cheese3d_annotator = "cheese3d_annotator:napari.yaml"
2828

2929
[build-system]
30-
build-backend = "hatchling.build"
31-
requires = ["hatchling"]
30+
requires = ["uv_build>=0.11.11,<0.12"]
31+
build-backend = "uv_build"
3232

33-
[tool.hatch.build.targets.wheel]
34-
packages = ["cheese3d_annotator"]
33+
[tool.uv.build-backend]
34+
module-root = "."
3535

36-
[tool.hatch.metadata]
37-
allow-direct-references = true
36+
[[tool.uv.index]]
37+
name = "pypi"
38+
url = "https://pypi.org/simple"
39+
publish-url = "https://upload.pypi.org/legacy/"
40+
41+
[[tool.uv.index]]
42+
name = "test-pypi"
43+
url = "https://test.pypi.org/simple"
44+
publish-url = "https://test.pypi.org/legacy/"

packages/cheese3d/README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# `cheese3d` Python package
2+
3+
[![Documentation](https://img.shields.io/badge/docs-latest-blue)](https://hou-lab-cshl.github.io/cheese3d/)
4+
5+
Cheese3D is a pipeline for tracking mouse facial movements built on top of existing tools ([DeepLabCut](https://github.com/DeepLabCut/DeepLabCut) and [Anipose](https://github.com/lambdaloop/anipose)). By tracking anatomically-informed keypoints using multiple cameras registered in 3D, our pipeline produces sensitive, high-precision facial movement data that can be related internal state (e.g., electrophysiology).
6+
7+
**NEW!** Check out the [Cheese3D paper](https://www.nature.com/articles/s41593-026-02262-8).
8+
9+
Please see the [repository](https://github.com/Hou-Lab-CSHL/cheese3d) for complete information.

packages/cheese3d/pyproject.toml

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name = "cheese3d"
33
version = "0.1.0"
44
description = "Sensitive detection and analysis of whole-face movement in mice."
55
authors = [{ name = "Hou Lab CSHL", email = "the.hou.lab@gmail.com" }]
6-
readme = "../../README.md"
6+
readme = "README.md"
77
requires-python = ">=3.10"
88
scripts = { cheese3d = "cheese3d.cli:cli" }
99
dependencies = [
@@ -47,11 +47,21 @@ dependencies = [
4747
]
4848

4949
[build-system]
50-
build-backend = "hatchling.build"
51-
requires = ["hatchling"]
50+
requires = ["uv_build>=0.11.11,<0.12"]
51+
build-backend = "uv_build"
5252

53-
[tool.hatch.metadata]
54-
allow-direct-references = true
53+
[tool.uv.build-backend]
54+
module-root = "."
55+
56+
[[tool.uv.index]]
57+
name = "pypi"
58+
url = "https://pypi.org/simple"
59+
publish-url = "https://upload.pypi.org/legacy/"
60+
61+
[[tool.uv.index]]
62+
name = "test-pypi"
63+
url = "https://test.pypi.org/simple"
64+
publish-url = "https://test.pypi.org/legacy/"
5565

5666
[tool.pytest.ini_options]
5767
testpaths = ["tests"]

0 commit comments

Comments
 (0)