Skip to content

Commit 8a7c6c3

Browse files
authored
Merge pull request #46 from saezlab/dev
chore: merge dev into main for v1.0.0-beta.4 release
2 parents 048af53 + 2cf23c9 commit 8a7c6c3

34 files changed

Lines changed: 2742 additions & 1367 deletions

.github/RELEASE_TEMPLATE.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,14 @@ The automated release notes will be generated first, then you can add additional
1818
## 📦 Installation
1919

2020
```bash
21-
pip install corneto==VERSION_PLACEHOLDER
21+
pip install corneto==<version-without-v-prefix>
2222
```
2323

2424
## 📖 Documentation
2525

26-
- [📚 Documentation](https://saezlab.github.io/corneto/)
26+
- [📚 Documentation](https://saezlab.github.io/corneto/stable/)
2727
- [🚀 Getting Started](https://saezlab.github.io/corneto/stable/install.html)
28-
- [📑 API Reference](https://saezlab.github.io/corneto/stable/api)
28+
- [📑 API Reference](https://saezlab.github.io/corneto/stable/api/)
2929

3030
<!-- The automated release notes will be appended below this line -->
3131
---

.github/workflows/build-and-publish.yml

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,15 @@ jobs:
5959
echo "Valid release tag detected: ${version}"
6060
echo "should_publish=true" >> $GITHUB_OUTPUT
6161
echo "version=${version}" >> $GITHUB_OUTPUT
62+
echo "pypi_version=${version#v}" >> $GITHUB_OUTPUT
63+
# Mark alpha/beta/rc tags as GitHub pre-releases automatically.
64+
if [[ "${version}" =~ -(alpha|beta|rc)([.-].*)?$ ]]; then
65+
echo "is_prerelease=true" >> $GITHUB_OUTPUT
66+
echo "make_latest=false" >> $GITHUB_OUTPUT
67+
else
68+
echo "is_prerelease=false" >> $GITHUB_OUTPUT
69+
echo "make_latest=true" >> $GITHUB_OUTPUT
70+
fi
6271
;;
6372
*)
6473
echo "Not a v* tag: ${GITHUB_REF}, skipping publishing"
@@ -80,21 +89,22 @@ jobs:
8089
tag_name: ${{ steps.validate_tag.outputs.version }}
8190
name: Release ${{ steps.validate_tag.outputs.version }}
8291
generate_release_notes: true
83-
make_latest: true
92+
prerelease: ${{ steps.validate_tag.outputs.is_prerelease }}
93+
make_latest: ${{ steps.validate_tag.outputs.make_latest }}
8494
files: |
8595
dist/*
8696
body: |
8797
## 📦 Installation
8898
8999
```bash
90-
pip install corneto==${{ steps.validate_tag.outputs.version }}
100+
pip install corneto==${{ steps.validate_tag.outputs.pypi_version }}
91101
```
92102
93103
## 📖 Documentation
94104
95-
- [📚 Documentation](https://saezlab.github.io/corneto/)
96-
- [🚀 Getting Started](https://saezlab.github.io/corneto/install.html)
97-
- [📑 API Reference](https://saezlab.github.io/corneto/api/)
105+
- [📚 Documentation](https://saezlab.github.io/corneto/stable/)
106+
- [🚀 Getting Started](https://saezlab.github.io/corneto/stable/install.html)
107+
- [📑 API Reference](https://saezlab.github.io/corneto/stable/api/)
98108
99109
---
100110

.github/workflows/deploy-docs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ jobs:
6868
run: |
6969
pip install poetry
7070
poetry self add "poetry-dynamic-versioning[plugin]"
71-
poetry install --with dev,docs
71+
poetry install --with dev --extras docs
7272
7373
- name: Debug Git state and version
7474
run: |

.github/workflows/unit-tests.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@ jobs:
3434
pip install poetry
3535
poetry self add "poetry-dynamic-versioning[plugin]"
3636
poetry install
37+
- name: Validate pinned wasm-graphviz checksum
38+
run: |
39+
poetry run python scripts/check_wasm_graphviz_checksum.py
3740
- name: Test with pytest
3841
run: |
3942
poetry run pytest

CONTRIBUTING.md

Lines changed: 25 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ We value community input and look forward to opening up for contributions once w
66

77
## Setup environment
88

9-
We use [Poetry](https://python-poetry.org) for dependency management and [Nox](https://nox.thea.codes/) for task automation. Please follow the instructions to install `poetry` on your system: https://python-poetry.org/docs/#installing-with-pipx. We recommend to install poetry using `pipx`.
9+
We use [Poetry](https://python-poetry.org) for dependency management and task execution. Please follow the instructions to install `poetry` on your system: https://python-poetry.org/docs/#installing-with-pipx. We recommend to install poetry using `pipx`.
1010

1111
For notebook execution in tutorials, we also support [Pixi](https://pixi.sh/) environments for isolated execution per tutorial directory.
1212

@@ -139,13 +139,6 @@ We use `pytest` for running our automated tests. You can run tests in several wa
139139
poetry run pytest
140140
```
141141

142-
### Using Nox (recommended):
143-
```bash
144-
nox -s tests
145-
```
146-
147-
The nox approach is recommended as it creates an isolated environment and ensures consistent testing across different setups. Nox is our primary task runner that provides standardized environments for testing, linting, formatting, and documentation building.
148-
149142
This command will run all test files in your project that follow the `test_*.py` naming convention, as recognized by `pytest`.
150143

151144
### Writing Tests
@@ -162,47 +155,22 @@ def test_calculate_division():
162155
calculate_division(5, 0)
163156
```
164157

165-
## Code Quality and Testing with Nox
166-
167-
We use [Nox](https://nox.thea.codes/) to standardize testing, linting, and documentation building across different environments. Nox provides isolated virtual environments for running different tasks and supports multiple Python versions.
168-
169-
### Available Nox Sessions
170-
171-
- **Testing**: Run unit tests across supported Python versions (3.10, 3.11, 3.12)
172-
```bash
173-
nox -s tests # Uses your current Python version
174-
# Or specify a version if you have multiple:
175-
nox -s "tests-3.10" # Python 3.10
176-
nox -s "tests-3.11" # Python 3.11
177-
nox -s "tests-3.12" # Python 3.12
178-
```
179-
180-
- **Linting**: Check code style and quality with ruff
181-
```bash
182-
nox -s lint
183-
```
184-
185-
- **Formatting**: Auto-fix code formatting issues
186-
```bash
187-
nox -s format
188-
```
189-
190-
- **Type Checking**: Run static type analysis with pyrefly
191-
```bash
192-
nox -s typing
193-
```
194-
195-
- **Documentation**: Build HTML documentation
196-
```bash
197-
nox -s docs
198-
```
158+
## Code Quality and Testing
199159

160+
### Linting
161+
```bash
162+
poetry run ruff check corneto --exclude tests
163+
```
200164

201-
### Running All Quality Checks
165+
### Formatting
166+
```bash
167+
poetry run ruff check corneto --exclude tests --fix
168+
poetry run ruff format corneto --exclude tests
169+
```
202170

203-
To run all quality checks (linting, formatting, typing, and tests) at once:
171+
### Type Checking
204172
```bash
205-
nox -s lint format typing tests
173+
poetry run pyrefly check corneto
206174
```
207175

208176
## Generating the documentation
@@ -211,51 +179,52 @@ This project uses Sphinx along with the PyData Sphinx theme to generate HTML doc
211179

212180
### Documentation for the current version
213181

214-
To generate the HTML documentation for the current version of the project using nox:
182+
To generate the HTML documentation for the current version of the project using pixi:
215183

216184
```bash
217-
nox -s docs
185+
pixi run docs
218186
```
219187

220188
This command will build the documentation in the `docs/_build/html` directory, which you can open in a browser to view.
221189

222190
### Additional Documentation Options
223191

224-
We provide several nox sessions for different documentation needs:
192+
We provide several pixi tasks for different documentation needs:
225193

226194
- **Clean build**: Remove previous builds and rebuild documentation
227195
```bash
228-
nox -s docs_clean
196+
pixi run docs-force
229197
```
230198

231199
- **Force notebook execution**: Build docs with forced notebook execution
232200
```bash
233-
nox -s docs_force
201+
pixi run docs-force
234202
```
235203

236204
- **Strict mode**: Build docs treating warnings as errors
237205
```bash
238-
nox -s docs_werror
206+
pixi run python -m sphinx-build -b html -W docs docs/_build/html
239207
```
240208

241209
- **Complete build**: Clean, force notebook execution, and build with warnings as errors
242210
```bash
243-
nox -s docs_all
211+
pixi run docs-force
212+
pixi run python -m sphinx-build -b html -W docs docs/_build/html
244213
```
245214

246215
- **Link checking**: Verify all external links in documentation
247216
```bash
248-
nox -s docs_linkcheck
217+
pixi run python -m sphinx-build -b linkcheck docs docs/_build/linkcheck
249218
```
250219

251220
- **Serve locally**: Build and serve documentation at http://localhost:8000
252221
```bash
253-
nox -s docs_serve
222+
pixi run docs-serve
254223
```
255224

256225
- **Full local check**: Build HTML documentation
257226
```bash
258-
nox -s docs_full
227+
pixi run docs
259228
```
260229

261230
### Notebook Execution with Pixi
@@ -269,7 +238,7 @@ poetry run python docs/tutorials/run_notebooks.py
269238

270239
### Additional notes
271240

272-
- **Task automation**: All documentation, testing, and quality assurance tasks are standardized through nox sessions defined in `noxfile.py`.
241+
- **Task automation**: Testing and code quality are run via poetry commands; documentation tasks use pixi tasks defined in `pixi.toml`.
273242
- **`myst-nb`**: We use `myst-nb` to handle the conversion of Jupyter notebooks (`.ipynb` files) into HTML. If your contribution involves notebooks, make sure they render correctly in the generated documentation.
274243
- **Pixi integration**: Tutorial notebooks can use individual `pixi.toml` files for isolated execution environments with specific dependencies.
275244
- **Poetry and PEP 621**: The project uses both Poetry (legacy) and modern PEP 621 project configuration in `pyproject.toml`.

RELEASE.md

Lines changed: 39 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -8,25 +8,30 @@ CORNETO uses an automated tag-based release process powered by Poetry Dynamic Ve
88

99
To create a new release:
1010

11-
1. **Create and push a Git tag** following semantic versioning:
11+
1. **Merge `dev` into `main`** via pull request.
12+
13+
2. **Create and push the release tag from `main`**:
1214
```bash
13-
git tag -a v1.2.3 -m "v1.2.3"
14-
git push origin v1.2.3
15+
poetry install
16+
git checkout main
17+
git pull --ff-only origin main
18+
poetry run release v1.2.3
1519
```
20+
- Use pre-release tags as needed: `v1.2.3-alpha.0`, `v1.2.3-beta.0`, `v1.2.3-rc.0`.
1621

17-
2. **Automatic pipeline execution**:
22+
3. **Automatic pipeline execution**:
1823
- GitHub Actions detects the new tag
1924
- Builds the package using Poetry
2025
- **Creates GitHub Release with automated release notes**
2126
- Publishes to PyPI via OIDC trusted publishing
2227
- Deploys versioned documentation to GitHub Pages
2328

24-
3. **Version resolution**:
29+
4. **Version resolution**:
2530
- Poetry Dynamic Versioning automatically extracts the version from the Git tag
2631
- The package version in `pyproject.toml` remains at `0.0.0` (placeholder)
2732
- Built packages use the actual tag version (e.g., `1.2.3`)
2833

29-
4. **Automated Release Notes**:
34+
5. **Automated Release Notes**:
3035
- GitHub automatically generates release notes based on merged PRs and commits
3136
- Uses conventional commit patterns to categorize changes
3237
- Includes contributor acknowledgments and change summaries
@@ -37,10 +42,10 @@ To create a new release:
3742
```bash
3843
# Ensure you're on the main branch and up to date
3944
git checkout main
40-
git pull origin main
45+
git pull --ff-only origin main
4146

42-
# Create and push a release tag (use semantic versioning)
43-
python scripts/release.py minor
47+
# Create and push a release tag explicitly
48+
poetry run release v1.0.0-beta.4
4449
```
4550

4651
The release pipeline (`.github/workflows/build-and-publish.yml`) will automatically:
@@ -51,15 +56,23 @@ The release pipeline (`.github/workflows/build-and-publish.yml`) will automatica
5156

5257
### Release Helper
5358

54-
Use the helper script to bump and push the next tag:
59+
Use the helper command to create and push an explicit tag:
5560

5661
```bash
57-
python scripts/release.py major # vX.0.0
58-
python scripts/release.py minor # v0.X.0
59-
python scripts/release.py patch # v0.0.X
62+
poetry run release v1.2.3
63+
poetry run release v1.0.0-beta.4
64+
poetry run release 1.0.0-rc.1 # 'v' prefix is optional
6065
```
6166

62-
It finds the latest `v*` tag, computes the next version, creates an annotated tag, and pushes it to `origin`.
67+
It validates release preconditions (clean tree, on `main`, in sync with `origin/main`,
68+
`origin/dev` merged into `main`, tag not already present), then creates an annotated tag and pushes it to `origin`.
69+
70+
Useful options:
71+
72+
```bash
73+
poetry run release v1.0.0-beta.4 --dry-run # validate only
74+
poetry run release v1.0.0-beta.4 --yes # skip confirmation prompt
75+
```
6376

6477
### Customizing Release Notes
6578

@@ -83,7 +96,6 @@ Before creating a release, ensure the development environment and code quality s
8396
All maintainers should have the development environment properly configured as described in [CONTRIBUTING.md](CONTRIBUTING.md), including:
8497
- Poetry for dependency management
8598
- Pre-commit hooks installed and active
86-
- Nox for running quality checks
8799

88100
### Pre-commit Requirements
89101
**Critical**: Pre-commit hooks must be installed and passing for all commits that will be included in the release. The pre-commit configuration ensures:
@@ -111,14 +123,18 @@ poetry run pre-commit install --hook-type pre-commit --hook-type commit-msg
111123
### Code Quality Validation
112124
Before releasing, run comprehensive quality checks:
113125
```bash
114-
# Run all quality checks
115-
nox -s lint format typing tests
116-
117-
# Or individual checks
118-
nox -s tests # Run test suite
119-
nox -s lint # Check code style
120-
nox -s format # Auto-fix formatting
121-
nox -s typing # Type checking
126+
# Tests
127+
poetry run pytest
128+
129+
# Linting
130+
poetry run ruff check corneto --exclude tests
131+
132+
# Formatting
133+
poetry run ruff check corneto --exclude tests --fix
134+
poetry run ruff format corneto --exclude tests
135+
136+
# Type checking
137+
poetry run pyrefly check corneto
122138
```
123139

124140
## Development Workflow

0 commit comments

Comments
 (0)