Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .github/workflows/build-and-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,15 @@ jobs:
poetry build
poetry run twine check dist/*

# The tag is already covered by the merged PR's full test gate. Validate
# only the tag-specific artifact here, before it is published.
- name: Smoke-test the release wheel
if: steps.validate_tag.outputs.should_publish == 'true'
run: |
python -m venv /tmp/corneto-release-wheel-smoke
/tmp/corneto-release-wheel-smoke/bin/pip install dist/*.whl
/tmp/corneto-release-wheel-smoke/bin/python -c 'import corneto; print(corneto.__version__)'

# 8. Create GitHub Release with automated notes
- name: Create GitHub Release
if: steps.validate_tag.outputs.should_publish == 'true'
Expand Down
67 changes: 16 additions & 51 deletions .github/workflows/deploy-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,8 @@ env:
on:
push:
branches:
- dev
- main
tags:
- '*'
workflow_dispatch:
inputs:
target:
description: "What to build/deploy (dev=latest, main=stable, or tag)"
type: choice
required: true
options:
- dev
- main
- tag
tag:
description: "Tag to deploy when target=tag (e.g., v1.0.0-beta.3)"
type: string
required: false
workflow_run:
workflows: ["Publish Python Package"]
types: [completed]
Expand All @@ -43,14 +27,7 @@ jobs:
with:
fetch-depth: 0
fetch-tags: true
ref: >-
${{
github.event_name == 'workflow_dispatch' &&
(github.event.inputs.target == 'tag' && format('refs/tags/{0}', github.event.inputs.tag) ||
format('refs/heads/{0}', github.event.inputs.target))
|| github.event_name == 'workflow_run' && github.event.workflow_run.head_sha
|| github.ref
}}
ref: ${{ github.event_name == 'workflow_run' && github.event.workflow_run.head_sha || github.ref }}

- name: Set up Python & Graphviz
uses: actions/setup-python@v5
Expand Down Expand Up @@ -89,22 +66,19 @@ jobs:
- name: Determine version_folder
id: set_version
run: |
case "${GITHUB_REF}" in
refs/heads/dev)
echo "version_folder=latest" >> $GITHUB_OUTPUT
;;
refs/heads/main)
echo "version_folder=stable" >> $GITHUB_OUTPUT
;;
refs/tags/*)
v="${GITHUB_REF#refs/tags/}"
echo "version_folder=${v}" >> $GITHUB_OUTPUT
;;
*)
echo "No docs to deploy for ${GITHUB_REF}" >&2
exit 0
;;
esac
if [ "${{ github.event_name }}" = "workflow_run" ]; then
if [[ "${{ github.event.workflow_run.head_branch }}" == v* ]]; then
echo "version_folder=${{ github.event.workflow_run.head_branch }}" >> $GITHUB_OUTPUT
else
echo "Publish workflow did not run for a release tag" >&2
exit 1
fi
elif [ "${GITHUB_REF}" = "refs/heads/main" ]; then
echo "version_folder=stable" >> $GITHUB_OUTPUT
else
echo "No documentation target for ${GITHUB_REF}" >&2
exit 1
fi

- name: Sync GitHub Releases to Docs
env:
Expand All @@ -119,15 +93,6 @@ jobs:
DOCS_BASE_URL: https://corneto.org
run: poetry run sphinx-build -W --keep-going -b html docs docs/_build/html

- name: Deploy “latest” docs
if: ${{ steps.set_version.outputs.version_folder == 'latest' }}
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs/_build/html
destination_dir: latest
keep_files: true

- name: Deploy “stable” docs
if: ${{ steps.set_version.outputs.version_folder == 'stable' }}
uses: peaceiris/actions-gh-pages@v4
Expand All @@ -137,8 +102,8 @@ jobs:
destination_dir: stable
keep_files: true

- name: Deploy versioned docs for tag
if: ${{ startsWith(github.ref, 'refs/tags/') }}
- name: Deploy versioned docs for release tag
if: ${{ steps.set_version.outputs.version_folder != 'stable' }}
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
Expand Down
9 changes: 8 additions & 1 deletion .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,15 @@
name: Unit tests

on:
push:
pull_request:
branches:
- main

# A PR into the public trunk is the release gate. Do not repeat this matrix
# for every temporary branch push, merge to main, or release tag.
concurrency:
group: unit-tests-${{ github.event.pull_request.number }}
cancel-in-progress: true

env:
POETRY_VERSION: "2.4.1"
Expand Down
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ For notebook execution in tutorials, we also support [Pixi](https://pixi.sh/) en
Once installed, clone the repository and install it with poetry. This will create a virtual environment ready for development:

```bash
git clone git+https://github.com/saezlab/corneto.git@dev
git clone https://github.com/saezlab/corneto.git
cd corneto
poetry install --with dev
```
Expand Down Expand Up @@ -243,7 +243,7 @@ poetry run python docs/tutorials/run_notebooks.py
- **Pixi integration**: Tutorial notebooks can use individual `pixi.toml` files for isolated execution environments with specific dependencies.
- **Poetry and PEP 621**: The project uses both Poetry (legacy) and modern PEP 621 project configuration in `pyproject.toml`.

Please see [contributing with tutorials](https://github.com/saezlab/corneto/blob/dev/docs/tutorials/README.md) for more information on how to contribute tutorials.
Please see [contributing with tutorials](https://github.com/saezlab/corneto/blob/main/docs/tutorials/README.md) for more information on how to contribute tutorials.

## Releases

Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,14 @@ pip install corneto

CORNETO provides several optional dependency groups:

- **`plot`**: Graphviz, NetworkX, and Matplotlib visualization support
- **`research`**: Full research stack with Gurobi, PICOS, visualization, and network tools
- **`os`**: Open-source solvers (SCIP, HiGHS) with visualization and network tools
- **`ml`**: Machine learning dependencies (JAX, Keras, scikit-learn)

Install any combination with:
```bash
pip install corneto[plot] # Visualization without the full research stack
pip install corneto[research,ml] # Multiple extras
```

Expand Down
Loading
Loading