Skip to content

Commit 35ff9ad

Browse files
committed
feat: add TestPyPI workflow and dynamic versioning support
1 parent 85fb14a commit 35ff9ad

19 files changed

Lines changed: 1424 additions & 1020 deletions

File tree

.github/workflows/publish.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,12 @@ permissions:
1010
jobs:
1111
deploy:
1212
runs-on: ubuntu-latest
13+
environment:
14+
name: pypi
15+
url: https://pypi.org/p/python-oephys
16+
permissions:
17+
id-token: write
18+
contents: read
1319

1420
steps:
1521
- uses: actions/checkout@v4

.github/workflows/test_release.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Test Publish to TestPyPI
2+
3+
on:
4+
workflow_dispatch:
5+
6+
permissions:
7+
contents: read
8+
9+
jobs:
10+
test-pypi-publish:
11+
name: Upload release to TestPyPI
12+
runs-on: ubuntu-latest
13+
environment:
14+
name: testpypi
15+
url: https://test.pypi.org/p/python-oephys
16+
permissions:
17+
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
18+
contents: read
19+
20+
steps:
21+
- uses: actions/checkout@v4
22+
with:
23+
fetch-depth: 0 # Required for setuptools_scm to see tags
24+
25+
- name: Set up Python
26+
uses: actions/setup-python@v4
27+
with:
28+
python-version: "3.10"
29+
30+
- name: Install build tools
31+
run: |
32+
python -m pip install --upgrade pip
33+
pip install uv build
34+
35+
- name: Build package
36+
run: uv build
37+
38+
- name: Publish package distributions to TestPyPI
39+
uses: pypa/gh-action-pypi-publish@release/v1
40+
with:
41+
repository-url: https://test.pypi.org/legacy/
42+
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
43+
skip-existing: true

.gitignore

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,4 +79,10 @@ pip-log.txt
7979
pip-delete-this-directory.txt
8080

8181
# Old utilities
82-
src/old_utils/
82+
src/old_utils/
83+
84+
# Local secrets & environment variables
85+
.env
86+
.secrets
87+
.tokens
88+
.pypirc_local

README.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@ A comprehensive Python toolkit for working with Open Ephys devices, featuring si
2323
- **Filtering**: Real-time and offline filters (Bandpass, Notch, Smoothing).
2424
- **Features**: Extract RMS, MAV, Zero Crossings, and IMU features.
2525

26+
### 💾 Data & IO
27+
- **Unified IO**: Robust support for Open Ephys Binary (`.oebin`) and `.npz` formats.
28+
- **Dataset Builder**: Advanced tools to discover, group, and merge multi-session datasets.
29+
- **Spatial Mapping**: Grid reorientation tools (`rot90`, `flipH`, etc.) for high-density arrays.
30+
2631
## Installation
2732

2833
### From Source
@@ -85,6 +90,19 @@ results = qc.compute_qc(data_chunk)
8590
print(results) # Status (Good/Bad) per channel
8691
```
8792

93+
### 4. Unified CLI Tools
94+
Build a dataset from multiple sessions and train/predict with a single command workflow:
95+
```bash
96+
# 1. Build Dataset (Auto-discovery, Preprocessing, Merging)
97+
python examples/gesture_classifier/1_build_dataset.py --root_dir ./data --multi_file --paper_style
98+
99+
# 2. Train Model
100+
python examples/gesture_classifier/2_train_model.py --root_dir ./data --label my_model
101+
102+
# 3. Predict (Offline or Real-time Stream)
103+
python examples/gesture_classifier/predict.py stream --root_dir ./data --label my_model
104+
```
105+
88106
## Examples
89107
Check the `examples/` directory for complete scripts:
90108
- `examples/gesture_classifier/2_train_model.py`: Train a gesture classifier.
@@ -95,3 +113,24 @@ Check the `examples/` directory for complete scripts:
95113

96114
## License
97115
MIT License. See [LICENSE](LICENSE) for details.
116+
117+
## Development & Release
118+
119+
### Versioning
120+
This project uses **dynamic versioning** via `setuptools_scm`. The version is automatically derived from Git tags.
121+
122+
### How to Release
123+
1. **Commit** all changes.
124+
2. **Tag** the commit with the new version number:
125+
```bash
126+
git tag -a v0.1.0 -m "Release v0.1.0"
127+
```
128+
3. **Push** the tag to GitHub:
129+
```bash
130+
git push origin v0.1.0
131+
```
132+
4. **Create a Release** on GitHub:
133+
- Go to **Releases** > **Draft a new release**.
134+
- Select the tag `v0.1.0`.
135+
- Click **Publish release**.
136+
5. The `publish.yml` workflow will trigger, build the package, and upload to PyPI.

0 commit comments

Comments
 (0)