Skip to content

Commit ea69a01

Browse files
authored
Merge pull request #114 from jguhlin/minimappers2-update
minimappers2-update
2 parents 2fbf6d8 + 6229fdd commit ea69a01

16 files changed

+9683
-3526
lines changed

.github/workflows/build-test-rust-minimappers2.yaml

Lines changed: 56 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -4,41 +4,71 @@ on:
44
pull_request:
55
branches: [ "main" ]
66
paths:
7-
- 'minimappers2/src/'
8-
- 'minimappers2/Cargo.toml'
7+
- minimappers2/src/
8+
- minimappers2/Cargo.toml
9+
- minimappers2/**
10+
- .github/workflows/build-test-rust-minimappers2.yaml
11+
12+
concurrency:
13+
group: ${{ github.workflow }}-${{ github.ref }}
14+
cancel-in-progress: true
915

1016
env:
17+
RUSTFLAGS: -C debuginfo=0 # Do not produce debug symbols to keep memory usage down
18+
RUST_BACKTRACE: 1
19+
PYTHONUTF8: 1
1120
CARGO_TERM_COLOR: always
1221

22+
defaults:
23+
run:
24+
working-directory: minimappers2
25+
shell: bash
26+
1327
jobs:
14-
test:
15-
runs-on: ubuntu-latest
28+
test-python:
29+
runs-on: ${{ matrix.os }}
30+
strategy:
31+
fail-fast: false
32+
matrix:
33+
os: [ubuntu-latest]
34+
python-version: ['3.9', '3.12', '3.13']
35+
1636
steps:
1737
- uses: actions/checkout@v4
1838
with:
1939
submodules: 'recursive'
20-
- run: cd minimappers2
40+
- name: Set up Python
41+
uses: actions/setup-python@v5
42+
with:
43+
python-version: ${{ matrix.python-version }}
44+
45+
- name: Create virtual environment
46+
env:
47+
BIN: ${{ matrix.os == 'windows-latest' && 'Scripts' || 'bin' }}
48+
run: |
49+
python -m venv .venv
50+
echo "$GITHUB_WORKSPACE/minimappers2/.venv/$BIN" >> $GITHUB_PATH
51+
echo "VIRTUAL_ENV=$GITHUB_WORKSPACE/minimappers2/.venv" >> $GITHUB_ENV
52+
53+
- name: Set up Rust
54+
run: rustup show
55+
56+
- name: Cache Rust
57+
uses: Swatinem/rust-cache@v2
58+
with:
59+
workspaces: minimappers2
60+
save-if: ${{ github.ref_name == 'main' }}
61+
62+
- name: Install Python dependencies
63+
run: |
64+
pip install uv
65+
uv pip install maturin
66+
67+
- name: Install minimappers2
68+
run: maturin develop
69+
2170
- name: Build
2271
run: cargo build --verbose
72+
2373
- name: Run tests
24-
run: cargo test --verbose
25-
26-
build-manylinux-x64_64:
27-
runs-on: ubuntu-latest
28-
steps:
29-
- uses: actions/checkout@v4
30-
with:
31-
submodules: 'recursive'
32-
- uses: actions/setup-python@v4
33-
with:
34-
python-version: '3.9'
35-
36-
- name: Test build
37-
uses: messense/maturin-action@v1
38-
env:
39-
RUSTFLAGS: -C target-feature=+fxsr,+sse,+sse2,+sse3,+ssse3,+sse4.1,+sse4.2,+popcnt,+avx,+fma
40-
with:
41-
rust-toolchain: nightly-2025-01-08
42-
maturin-version: '1.8.0'
43-
command: build
44-
args: -m minimappers2/Cargo.toml
74+
run: cargo test --verbose
Lines changed: 164 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -1,86 +1,185 @@
1-
# Taken from Polar-rs github action
2-
3-
name: Create Python release
1+
# This file is autogenerated by maturin v1.8.1
2+
# To update, run
3+
#
4+
# maturin generate-ci github
5+
#
6+
name: CI
47

58
on:
69
push:
10+
branches:
11+
- main
12+
- master
713
tags:
8-
- py-*
14+
- '*'
15+
pull_request:
16+
workflow_dispatch:
917

1018
defaults:
1119
run:
1220
shell: bash
1321

22+
permissions:
23+
contents: read
24+
1425
jobs:
15-
manylinux-x64_64:
16-
runs-on: ubuntu-latest
26+
linux:
27+
runs-on: ${{ matrix.platform.runner }}
28+
strategy:
29+
matrix:
30+
platform:
31+
- runner: ubuntu-22.04
32+
target: x86_64
33+
- runner: ubuntu-22.04
34+
target: x86
35+
- runner: ubuntu-22.04
36+
target: aarch64
37+
- runner: ubuntu-22.04
38+
target: armv7
39+
- runner: ubuntu-22.04
40+
target: s390x
41+
- runner: ubuntu-22.04
42+
target: ppc64le
1743
steps:
1844
- uses: actions/checkout@v4
19-
with:
20-
submodules: 'recursive'
45+
- run: cd minimappers2
2146
- uses: actions/setup-python@v5
2247
with:
23-
python-version: '3.7'
24-
25-
- name: Publish wheel
48+
python-version: 3.x
49+
- name: Build wheels
2650
uses: PyO3/maturin-action@v1
27-
env:
28-
MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
29-
RUSTFLAGS: -C target-feature=+fxsr,+sse,+sse2,+sse3,+ssse3,+sse4.1,+sse4.2,+popcnt,+avx,+fma
3051
with:
31-
rust-toolchain: nightly-2024-02-04
32-
maturin-version: '1.6.0'
33-
command: publish
34-
args: -m minimappers2/Cargo.toml --skip-existing -o wheels -u jguhlin
35-
36-
# Needed for Docker on Apple M1
37-
# manylinux-aarch64:
38-
# runs-on: ubuntu-latest
39-
# steps:
40-
# - uses: actions/checkout@v3
41-
# - uses: actions/setup-python@v4
42-
# with:
43-
# python-version: '3.7'
44-
#
45-
# - name: Publish wheel
46-
# uses: messense/maturin-action@v1
47-
# env:
48-
# MATURIN_PASSWORD: ${{ secrets.PYPI_PASS }}
49-
# with:
50-
# rust-toolchain: nightly-2023-01-19
51-
# target: aarch64-unknown-linux-gnu
52-
# maturin-version: '0.14.10'
53-
# command: publish
54-
# args: -m minimappers2/Cargo.toml --skip-existing -o wheels -u jguhlin
52+
target: ${{ matrix.platform.target }}
53+
args: --release --out dist
54+
sccache: 'true'
55+
manylinux: auto
56+
- name: Build free-threaded wheels
57+
uses: PyO3/maturin-action@v1
58+
with:
59+
target: ${{ matrix.platform.target }}
60+
args: --release --out dist -i python3.13t
61+
sccache: 'true'
62+
manylinux: auto
63+
- name: Upload wheels
64+
uses: actions/upload-artifact@v4
65+
with:
66+
name: wheels-linux-${{ matrix.platform.target }}
67+
path: dist
5568

56-
# uncomment to build a universal2 wheel
57-
# we don't run it because it is twice as big and not needed because we build for both architectures separately
58-
# macos-aarch64-universal:
59-
# runs-on: macos-latest
60-
# steps:
61-
# - uses: actions/checkout@v3
62-
# - uses: actions/setup-python@v4
63-
# with:
64-
# python-version: '3.7'
69+
musllinux:
70+
runs-on: ${{ matrix.platform.runner }}
71+
strategy:
72+
matrix:
73+
platform:
74+
- runner: ubuntu-22.04
75+
target: x86_64
76+
- runner: ubuntu-22.04
77+
target: x86
78+
- runner: ubuntu-22.04
79+
target: aarch64
80+
- runner: ubuntu-22.04
81+
target: armv7
82+
steps:
83+
- uses: actions/checkout@v4
84+
- run: cd minimappers2
85+
- uses: actions/setup-python@v5
86+
with:
87+
python-version: 3.x
88+
- name: Build wheels
89+
uses: PyO3/maturin-action@v1
90+
with:
91+
target: ${{ matrix.platform.target }}
92+
args: --release --out dist
93+
sccache: 'true'
94+
manylinux: musllinux_1_2
95+
- name: Build free-threaded wheels
96+
uses: PyO3/maturin-action@v1
97+
with:
98+
target: ${{ matrix.platform.target }}
99+
args: --release --out dist -i python3.13t
100+
sccache: 'true'
101+
manylinux: musllinux_1_2
102+
- name: Upload wheels
103+
uses: actions/upload-artifact@v4
104+
with:
105+
name: wheels-musllinux-${{ matrix.platform.target }}
106+
path: dist
65107

66-
# - name: Fix README symlink
67-
# run: |
68-
# rm py-polars/README.md
69-
# cp README.md py-polars/README.md
108+
# No support for minimap2 for windows
70109

71-
# - name: Set up Rust
72-
# uses: dtolnay/rust-toolchain@master
73-
# with:
74-
# toolchain: nightly-2023-01-19
110+
macos:
111+
runs-on: ${{ matrix.platform.runner }}
112+
strategy:
113+
matrix:
114+
platform:
115+
- runner: macos-13
116+
target: x86_64
117+
- runner: macos-14
118+
target: aarch64
119+
steps:
120+
- uses: actions/checkout@v4
121+
- run: cd minimappers2
122+
- uses: actions/setup-python@v5
123+
with:
124+
python-version: 3.x
125+
- name: Build wheels
126+
uses: PyO3/maturin-action@v1
127+
with:
128+
target: ${{ matrix.platform.target }}
129+
args: --release --out dist
130+
sccache: 'true'
131+
- name: Build free-threaded wheels
132+
uses: PyO3/maturin-action@v1
133+
with:
134+
target: ${{ matrix.platform.target }}
135+
args: --release --out dist -i python3.13t
136+
sccache: 'true'
137+
- name: Upload wheels
138+
uses: actions/upload-artifact@v4
139+
with:
140+
name: wheels-macos-${{ matrix.platform.target }}
141+
path: dist
75142

76-
# - name: Set up Rust targets
77-
# run: rustup target add aarch64-apple-darwin
143+
sdist:
144+
runs-on: ubuntu-latest
145+
steps:
146+
- uses: actions/checkout@v4
147+
- run: cd minimappers2
148+
- name: Build sdist
149+
uses: PyO3/maturin-action@v1
150+
with:
151+
command: sdist
152+
args: --out dist
153+
- name: Upload sdist
154+
uses: actions/upload-artifact@v4
155+
with:
156+
name: wheels-sdist
157+
path: dist
78158

79-
# - name: Publish wheel
80-
# uses: messense/maturin-action@v1
81-
# env:
82-
# MATURIN_PASSWORD: ${{ secrets.PYPI_PASS }}
83-
# with:
84-
# maturin-version: '0.14.10'
85-
# command: publish
86-
# args: -m py-polars/Cargo.toml --no-sdist --universal2 -o wheels -i python -u ritchie46
159+
release:
160+
name: Release
161+
runs-on: ubuntu-latest
162+
if: ${{ startsWith(github.ref, 'refs/tags/py-') || github.event_name == 'workflow_dispatch' }}
163+
needs: [linux, musllinux, macos, sdist]
164+
permissions:
165+
# Use to sign the release artifacts
166+
id-token: write
167+
# Used to upload release artifacts
168+
contents: write
169+
# Used to generate artifact attestation
170+
attestations: write
171+
steps:
172+
- uses: actions/download-artifact@v4
173+
- run: cd minimappers2
174+
- name: Generate artifact attestation
175+
uses: actions/attest-build-provenance@v1
176+
with:
177+
subject-path: 'wheels-*/*'
178+
- name: Publish to PyPI
179+
if: ${{ startsWith(github.ref, 'refs/tags/') }}
180+
uses: PyO3/maturin-action@v1
181+
env:
182+
MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
183+
with:
184+
command: upload
185+
args: --non-interactive --skip-existing wheels-*/*

minimappers2/.gitattributes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# GitHub syntax highlighting
2+
pixi.lock linguist-language=YAML linguist-generated=true

minimappers2/.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# pixi environments
2+
.pixi
3+
*.egg-info

0 commit comments

Comments
 (0)