|
1 | | -# phylib |
2 | | -[](https://travis-ci.org/cortex-lab/phylib) |
3 | | -[](http://codecov.io/github/cortex-lab/phylib?branch=master) |
4 | | - |
5 | | -Electrophysiological data analysis library used by [phy](https://github.com/kwikteam/phy/), a spike sorting visualization software, and [ibllib](https://github.com/int-brain-lab/ibllib/). |
6 | | - |
7 | | - |
| 1 | +# phylib |
| 2 | +[](https://github.com/cortex-lab/phylib/actions/workflows/ci.yml) |
| 3 | +[](http://codecov.io/github/cortex-lab/phylib?branch=master) |
| 4 | + |
| 5 | +Electrophysiological data analysis library used by [phy](https://github.com/kwikteam/phy/), a spike sorting visualization software, and [ibllib](https://github.com/int-brain-lab/ibllib/). |
| 6 | + |
| 7 | + |
8 | 8 | ## Contribution |
9 | 9 |
|
10 | 10 | - participation in phylib is governed by the project [Code of Conduct](CODE_OF_CONDUCT.md) |
11 | 11 | - run all tests using pytest `pytest phylib` |
12 | 12 | - PR to master |
13 | 13 | - keep `phylib/__init__.py` on the next development version (for example, |
14 | 14 | `2.7.1.dev0`) |
15 | | -- for a release, update `CHANGELOG.md`, remove the `.dev0` suffix, run the |
16 | | - tests, and tag the exact release commit |
| 15 | +- for a release, follow the steps below |
17 | 16 | - after publishing, immediately bump `phylib/__init__.py` to the next |
18 | 17 | `.dev0` version |
19 | | -- publish to pypi: |
20 | | -```shell |
21 | | -rm -R dist |
22 | | -rm -R build |
23 | | -python setup.py sdist bdist_wheel |
24 | | -twine upload dist/* |
| 18 | + |
| 19 | +## Release |
| 20 | + |
| 21 | +Before merging the release PR, confirm maintainer approval and green CI. Update |
| 22 | +`CHANGELOG.md` with all changes since the previous release, replace the pending |
| 23 | +release date with the actual release date, and remove the `.dev0` suffix from |
| 24 | +`phylib/__init__.py`. |
| 25 | + |
| 26 | +Validate the final release checkout in a dedicated environment: |
| 27 | + |
| 28 | +```shell |
| 29 | +uv venv --python 3.12 .venv-release |
| 30 | +uv pip install --python .venv-release -r requirements-dev.txt -e . setuptools build twine |
| 31 | +.venv-release/bin/python -m flake8 phylib |
| 32 | +.venv-release/bin/python -m pytest phylib |
25 | 33 | ``` |
| 34 | + |
| 35 | +After the approved PR is merged, create an annotated tag from the merged release |
| 36 | +commit (for example, `git tag -a 2.7.1 -m "phylib 2.7.1"`). Build fresh artifacts |
| 37 | +from that tagged checkout into an empty output directory: |
| 38 | + |
| 39 | +```shell |
| 40 | +.venv-release/bin/python -m build --outdir dist/2.7.1 |
| 41 | +.venv-release/bin/python -m twine check dist/2.7.1/* |
| 42 | +``` |
| 43 | + |
| 44 | +Install the wheel in a separate clean environment and verify its version and |
| 45 | +imports. Verify the downstream phy template-less waveform regression against |
| 46 | +this wheel before publishing. Upload only the artifacts just checked: |
| 47 | + |
| 48 | +```shell |
| 49 | +.venv-release/bin/python -m twine upload dist/2.7.1/* |
| 50 | +``` |
| 51 | + |
| 52 | +Verify installation of the published version from PyPI in another clean |
| 53 | +environment. Then bump `master` to `2.7.2.dev0` and add an `Unreleased` changelog |
| 54 | +section. Substitute the appropriate version numbers for subsequent releases. |
0 commit comments