Skip to content

Commit d4fbdbe

Browse files
authored
Merge branch 'main' into release_hub
2 parents dcfd4d1 + d87d799 commit d4fbdbe

21 files changed

+12937
-874
lines changed

.github/workflows/release.yml

Lines changed: 149 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,163 @@
11
name: Release
22

3+
# based off of https://github.com/astral-sh/ruff/blob/main/.github/workflows/release.yaml
34
on:
4-
push:
5-
tags:
6-
- "*.*.*"
5+
workflow_dispatch:
6+
inputs:
7+
tag:
8+
description: "The version to tag (without the leading 'v'). If omitted, will initiate a dry run (no uploads)."
9+
default: ""
10+
type: string
11+
branch:
12+
description: "The branch from which to release."
13+
type: string
14+
prerelease:
15+
description: "Whether the release is a pre-release."
16+
default: false
17+
type: boolean
18+
19+
concurrency:
20+
group: ${{ github.workflow }}-${{ github.ref }}
21+
cancel-in-progress: true
722

823
jobs:
9-
release:
10-
name: Release
24+
validate-tag:
25+
name: Validate tag
1126
runs-on: ubuntu-latest
27+
# If you don't set an input tag, it's a dry run (no uploads).
28+
if: ${{ inputs.tag }}
1229
steps:
13-
# will use ref/SHA that triggered it
14-
- name: Checkout code
15-
uses: actions/checkout@v3
30+
- uses: actions/checkout@v4
31+
with:
32+
ref: ${{ inputs.branch }}
33+
34+
- name: Check tag consistency
35+
run: |
36+
# Switch to the commit we want to release
37+
git checkout ${{ inputs.branch }}
38+
version=$(grep "^version = " pyproject.toml | sed -e 's/version = "\(.*\)"/\1/g')
39+
if [ "${{ inputs.tag }}" != "${version}" ]; then
40+
echo "The input tag does not match the version from pyproject.toml:" >&2
41+
echo "${{ inputs.tag }}" >&2
42+
echo "${version}" >&2
43+
exit 1
44+
else
45+
echo "Releasing ${version}"
46+
fi
1647
17-
- name: Set up Python 3.10
18-
uses: actions/setup-python@v4
48+
tag-release:
49+
name: Tag release
50+
runs-on: ubuntu-latest
51+
needs: validate-tag
52+
# If you don't set an input tag, it's a dry run (no uploads).
53+
if: ${{ inputs.tag }}
54+
permissions:
55+
# For git tag
56+
contents: write
57+
steps:
58+
- uses: actions/checkout@v4
1959
with:
20-
python-version: "3.10"
60+
ref: ${{ inputs.branch }}
2161

22-
- name: Install hatch
62+
- name: git tag
2363
run: |
24-
pip install hatch
64+
git config --global user.email "cergen@berkeley.edu"
65+
git config --global user.name "popv release"
66+
git tag -m "${{ inputs.tag }}" "${{ inputs.tag }}"
67+
# If there is duplicate tag, this will fail. The publish to pypi action will have been a noop (due to skip
68+
# existing), so we make a non-destructive exit here
69+
git push --tags
70+
71+
publish-release:
72+
name: Publish to GitHub
73+
runs-on: ubuntu-latest
74+
needs: tag-release
75+
# If you don't set an input tag, it's a dry run (no uploads).
76+
if: ${{ inputs.tag }}
77+
permissions:
78+
# For GitHub release publishing
79+
contents: write
80+
81+
steps:
82+
- uses: actions/checkout@v4
83+
with:
84+
ref: ${{ inputs.branch }}
85+
86+
- uses: softprops/action-gh-release@v2
87+
with:
88+
name: popv ${{ inputs.tag }}
89+
tag_name: ${{ inputs.tag }}
90+
generate_release_notes: false
91+
body_path: .github/workflows/release_notes.md
92+
prerelease: ${{ inputs.prerelease }}
93+
target_commitish: ${{ inputs.branch }}
94+
95+
upload-release:
96+
runs-on: ubuntu-latest
97+
needs: tag-release
98+
environment:
99+
name: pypi
100+
url: https://pypi.org/p/popv
101+
permissions:
102+
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
103+
# If you don't set an input tag, it's a dry run (no uploads).
104+
if: ${{ inputs.tag }}
105+
106+
steps:
107+
- uses: actions/checkout@v4
108+
with:
109+
filter: blob:none
110+
fetch-depth: 0
111+
ref: ${{ inputs.branch }}
112+
113+
- uses: actions/setup-python@v4
114+
with:
115+
python-version: "3.11"
116+
117+
- run: pip install build
118+
119+
- run: python -m build
120+
121+
- uses: pypa/gh-action-pypi-publish@release/v1
122+
123+
build-image:
124+
runs-on: ubuntu-latest
125+
needs: tag-release
126+
127+
permissions:
128+
contents: read
129+
packages: write
130+
131+
strategy:
132+
fail-fast: false
133+
matrix:
134+
dependencies: [""]
135+
# If you don't set an input tag, it's a dry run (no uploads).
136+
if: ${{ inputs.tag }}
137+
138+
steps:
139+
- uses: actions/checkout@v4
140+
with:
141+
filter: blob:none
142+
fetch-depth: 0
143+
ref: ${{ inputs.branch }}
25144

26-
- name: Build project for distribution
27-
run: hatch build
145+
- uses: docker/setup-buildx-action@v3
146+
147+
- uses: docker/login-action@v3
148+
with:
149+
registry: ghcr.io
150+
username: ${{ github.actor }}
151+
password: ${{ secrets.GITHUB_TOKEN }}
28152

29-
- name: Publish a Python distribution to PyPI
30-
uses: pypa/gh-action-pypi-publish@release/v1
153+
- uses: docker/build-push-action@v5
31154
with:
32-
password: ${{ secrets.PYPI_TOKEN }}
155+
context: .
156+
file: ./Dockerfile
157+
push: true
158+
cache-from: type=registry,ref=ghcr.io/yoseflab/popv:buildcache
159+
cache-to: type=inline,ref=ghcr.io/yoseflab/popv:buildcache
160+
target: build
161+
tags: ghcr.io/yoseflab/popv:py3.11-cu12-${{ inputs.tag }}-${{ matrix.dependencies }}
162+
build-args: |
163+
DEPENDENCIES=${{ matrix.dependencies }}

.github/workflows/release_notes.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
See the [release notes](https://docs.popv.org/en/stable/changelog.html) for all changes.
2+
3+
This release is available via PyPi:
4+
5+
```bash
6+
pip install popv
7+
```
8+
9+
Please report any issues on [GitHub](https://github.com/yoseflab/popv).

.github/workflows/test_linux_cuda.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
shell: bash -e {0} # -e to fail on error
3131

3232
container:
33-
image: ghcr.io/yoseflab/popv:py3.10-cu12-base
33+
image: ghcr.io/yoseflab/popv:py3.11-cu12-0.5.2.post1-
3434
options: --user root --gpus all --pull always
3535

3636
name: integration

.pre-commit-config.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ repos:
1818
types: [yaml]
1919

2020
- repo: https://github.com/executablebooks/mdformat
21-
rev: 0.7.21
21+
rev: 0.7.22
2222
hooks:
2323
- id: mdformat
2424
additional_dependencies:
@@ -31,7 +31,7 @@ repos:
3131
)$
3232
3333
- repo: https://github.com/igorshubovych/markdownlint-cli
34-
rev: v0.43.0
34+
rev: v0.44.0
3535
hooks:
3636
- id: markdownlint-fix
3737
exclude: |
@@ -41,7 +41,7 @@ repos:
4141
)$
4242
4343
- repo: https://github.com/astral-sh/ruff-pre-commit
44-
rev: v0.9.1
44+
rev: v0.11.8
4545
hooks:
4646
- id: ruff
4747
args: [--fix, --exit-non-zero-on-fix]

.readthedocs.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,5 @@ python:
1313
- docsbuild
1414
submodules:
1515
include:
16-
- "docs/notebooks"
16+
- "docs/tutorials/notebooks"
1717
recursive: true

CHANGELOG.md

Lines changed: 33 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,41 @@
1-
# Changelog
1+
<!-- markdownlint-disable MD024 -->
22

3-
All notable changes to this project will be documented in this file.
3+
# Release notes
44

5-
The format is based on [Keep a Changelog],
6-
and this project adheres to [Semantic Versioning].
5+
Starting from version 0.5.0, this format is based on [Keep a Changelog],
6+
and this project adheres
7+
to [Semantic Versioning]. Full commit history is available in the
8+
[commit logs](https://github.com/Yoseflab/popv/commits/).
79

8-
## [Unreleased]
10+
For the original manuscript version 0.4.0 was used. 0.5.0 is a
11+
major rewrite of the project to scale
12+
to several million cells on workstations with 128 GB of RAM
13+
and enable more GPU-accelerated
14+
functions.
915

10-
### Added
16+
## Version 0.5
1117

12-
- Basic tool, preprocessing and plotting functions
18+
### 0.5.2
19+
20+
#### Fixed
21+
22+
- Changed Louvain overclustering for Celltypist to Leiden.
23+
- Fixed documentation references.
24+
- Fix release workflow.
25+
26+
### 0.5.1
27+
28+
#### Fixed
29+
30+
- Fixed errors in Google Colab.
31+
32+
### 0.5.0
33+
34+
First major release. Production-ready code.
35+
36+
### 0.4.0
37+
38+
Version used for the manuscript.
1339

1440
[keep a changelog]: https://keepachangelog.com/en/1.0.0/
1541
[semantic versioning]: https://semver.org/spec/v2.0.0.html

CODE_OF_CONDUCT.md

Lines changed: 0 additions & 77 deletions
This file was deleted.

Dockerfile

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
FROM nvidia/cuda:12.4.0-runtime-ubuntu22.04
2+
FROM python:3.11 AS base
3+
4+
RUN pip install --no-cache-dir uv
5+
6+
RUN uv pip install --system --no-cache torch torchvision torchaudio "jax[cuda12]"
7+
RUN pip install --no-cache-dir --extra-index-url https://pypi.nvidia.com cuml-cu12 cudf-cu12 cugraph-cu12
8+
9+
CMD ["/bin/bash"]
10+
11+
FROM base AS build
12+
13+
ENV POPV_PATH="/usr/local/lib/python3.11/site-packages/popv"
14+
15+
COPY . ${POPV_PATH}
16+
17+
ARG DEPENDENCIES=""
18+
RUN uv pip install --system "popv[${DEPENDENCIES}] @ ${POPV_PATH}"

0 commit comments

Comments
 (0)