Skip to content

Commit 01ad911

Browse files
committed
updated repo
1 parent 18e9b6b commit 01ad911

236 files changed

Lines changed: 70507 additions & 23 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/CI.yml

Lines changed: 232 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,232 @@
1+
# This file is autogenerated by maturin v1.0.1
2+
# To update, run
3+
#
4+
# maturin generate-ci github --pytest
5+
#
6+
name: CI
7+
8+
on:
9+
push:
10+
branches:
11+
- main
12+
tags:
13+
- 'v*'
14+
pull_request:
15+
workflow_dispatch:
16+
17+
permissions:
18+
contents: read
19+
20+
jobs:
21+
22+
pre-commit:
23+
runs-on: ubuntu-latest
24+
steps:
25+
- uses: actions/checkout@v4
26+
- uses: actions/setup-python@v5
27+
with:
28+
python-version: "3.9"
29+
- uses: pre-commit/action@v3.0.0
30+
31+
cargo-clippy:
32+
runs-on: ubuntu-latest
33+
steps:
34+
- uses: actions/checkout@v4
35+
- name: install rust stable
36+
uses: dtolnay/rust-toolchain@stable
37+
- name: cache rust
38+
uses: Swatinem/rust-cache@v2
39+
- name: Run clippy
40+
run: cargo clippy
41+
42+
test-python:
43+
44+
runs-on: ubuntu-latest
45+
strategy:
46+
fail-fast: false
47+
matrix:
48+
python-version:
49+
- '3.9'
50+
- '3.10'
51+
- '3.11'
52+
- '3.12'
53+
- 'pypy3.9'
54+
steps:
55+
- uses: actions/checkout@v4
56+
- name: install rust stable
57+
uses: dtolnay/rust-toolchain@stable
58+
- name: cache rust
59+
uses: Swatinem/rust-cache@v2
60+
with:
61+
key: test-v1
62+
- name: set up python
63+
uses: actions/setup-python@v5
64+
with:
65+
python-version: ${{ matrix.python-version }}
66+
- run: pip install -e .[testing]
67+
env:
68+
RUST_BACKTRACE: 1
69+
- run: pip freeze
70+
- run: pytest
71+
72+
linux:
73+
runs-on: ubuntu-latest
74+
strategy:
75+
fail-fast: false
76+
matrix:
77+
target:
78+
- x86_64
79+
- x86
80+
- aarch64
81+
- armv7
82+
# - s390x # TODO build fails: "error: failed to run custom build command for `psm v0.1.21`""
83+
- ppc64le
84+
steps:
85+
- uses: actions/checkout@v4
86+
- uses: actions/setup-python@v5
87+
with:
88+
python-version: "3.10"
89+
- name: Build wheels
90+
uses: PyO3/maturin-action@v1
91+
with:
92+
target: ${{ matrix.target }}
93+
args: --release --out dist --find-interpreter
94+
sccache: 'true'
95+
manylinux: auto
96+
- name: Upload wheels
97+
uses: actions/upload-artifact@v3
98+
with:
99+
name: wheels
100+
path: dist
101+
- name: pytest
102+
if: ${{ startsWith(matrix.target, 'x86_64') }}
103+
shell: bash
104+
run: |
105+
set -e
106+
pip install --upgrade pip
107+
pip install quickmark --find-links dist --force-reinstall
108+
pip install pytest pytest-param-files
109+
pytest
110+
- name: pytest
111+
if: ${{ !startsWith(matrix.target, 'x86') && matrix.target != 'ppc64' }}
112+
uses: uraimo/run-on-arch-action@v2
113+
with:
114+
arch: ${{ matrix.target }}
115+
distro: ubuntu22.04
116+
githubToken: ${{ github.token }}
117+
install: |
118+
apt-get update
119+
apt-get install -y --no-install-recommends python3-dev python3-pip build-essential
120+
pip3 install -U pip pytest pytest-param-files
121+
run: |
122+
set -e
123+
pip3 install quickmark --find-links dist --force-reinstall
124+
pytest
125+
126+
windows:
127+
runs-on: windows-latest
128+
strategy:
129+
fail-fast: false
130+
matrix:
131+
target: [x64, x86]
132+
steps:
133+
- uses: actions/checkout@v4
134+
- uses: actions/setup-python@v5
135+
with:
136+
python-version: '3.10'
137+
architecture: ${{ matrix.target }}
138+
- name: Build wheels
139+
uses: PyO3/maturin-action@v1
140+
with:
141+
target: ${{ matrix.target }}
142+
args: --release --out dist --find-interpreter
143+
sccache: 'true'
144+
- name: Upload wheels
145+
uses: actions/upload-artifact@v3
146+
with:
147+
name: wheels
148+
path: dist
149+
- name: pytest
150+
if: ${{ !startsWith(matrix.target, 'aarch64') }}
151+
shell: bash
152+
run: |
153+
set -e
154+
pip install --upgrade pip
155+
pip install quickmark --find-links dist --force-reinstall
156+
pip install pytest pytest-param-files
157+
pytest
158+
159+
macos:
160+
runs-on: macos-latest
161+
strategy:
162+
fail-fast: false
163+
matrix:
164+
target: [x86_64, aarch64]
165+
steps:
166+
- uses: actions/checkout@v4
167+
- uses: actions/setup-python@v5
168+
with:
169+
python-version: '3.10'
170+
- name: Build wheels
171+
uses: PyO3/maturin-action@v1
172+
with:
173+
target: ${{ matrix.target }}
174+
args: --release --out dist --find-interpreter
175+
sccache: 'true'
176+
- name: Upload wheels
177+
uses: actions/upload-artifact@v3
178+
with:
179+
name: wheels
180+
path: dist
181+
- name: pytest
182+
if: ${{ !startsWith(matrix.target, 'aarch64') }}
183+
shell: bash
184+
run: |
185+
set -e
186+
pip install --upgrade pip
187+
pip install quickmark --find-links dist --force-reinstall
188+
pip install pytest pytest-param-files
189+
pytest
190+
191+
sdist:
192+
runs-on: ubuntu-latest
193+
steps:
194+
- uses: actions/checkout@v4
195+
- name: Build sdist
196+
uses: PyO3/maturin-action@v1
197+
with:
198+
command: sdist
199+
args: --out dist
200+
- name: Upload sdist
201+
uses: actions/upload-artifact@v3
202+
with:
203+
name: wheels
204+
path: dist
205+
206+
# https://github.com/marketplace/actions/alls-green#why used for branch protection checks
207+
check:
208+
if: always()
209+
needs: [pre-commit, cargo-clippy, test-python, linux, windows, macos, sdist]
210+
runs-on: ubuntu-latest
211+
steps:
212+
- name: Decide whether the needed jobs succeeded or failed
213+
uses: re-actors/alls-green@release/v1
214+
with:
215+
jobs: ${{ toJSON(needs) }}
216+
allowed-failures: coverage
217+
218+
release:
219+
runs-on: ubuntu-latest
220+
if: "startsWith(github.ref, 'refs/tags/')"
221+
needs: [pre-commit, cargo-clippy, test-python, linux, windows, macos, sdist]
222+
steps:
223+
- uses: actions/download-artifact@v3
224+
with:
225+
name: wheels
226+
- name: Publish to PyPI
227+
uses: PyO3/maturin-action@v1
228+
env:
229+
MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
230+
with:
231+
command: upload
232+
args: --skip-existing *

.gitignore

Lines changed: 75 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,75 @@
1-
# Generated by Cargo
2-
# will have compiled files and executables
3-
debug
4-
target
5-
6-
# These are backup files generated by rustfmt
7-
**/*.rs.bk
8-
9-
# MSVC Windows builds of rustc generate these, which store debugging information
10-
*.pdb
11-
12-
# Generated by cargo mutants
13-
# Contains mutation testing data
14-
**/mutants.out*/
15-
16-
# RustRover
17-
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
18-
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
19-
# and can be added to the global gitignore or merged into this file. For a more nuclear
20-
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
21-
#.idea/
1+
/target
2+
uv.lock
3+
4+
# Byte-compiled / optimized / DLL files
5+
__pycache__/
6+
.pytest_cache/
7+
*.py[cod]
8+
9+
# C extensions
10+
*.so
11+
12+
# Distribution / packaging
13+
.Python
14+
.venv/
15+
env/
16+
bin/
17+
build/
18+
develop-eggs/
19+
dist/
20+
eggs/
21+
lib/
22+
lib64/
23+
parts/
24+
sdist/
25+
var/
26+
include/
27+
man/
28+
venv/
29+
*.egg-info/
30+
.installed.cfg
31+
*.egg
32+
33+
# Installer logs
34+
pip-log.txt
35+
pip-delete-this-directory.txt
36+
pip-selfcheck.json
37+
38+
# Unit test / coverage reports
39+
htmlcov/
40+
.tox/
41+
.coverage
42+
.cache
43+
nosetests.xml
44+
coverage.xml
45+
46+
# Translations
47+
*.mo
48+
49+
# Mr Developer
50+
.mr.developer.cfg
51+
.project
52+
.pydevproject
53+
54+
# Rope
55+
.ropeproject
56+
57+
# Django stuff:
58+
*.log
59+
*.pot
60+
61+
.DS_Store
62+
63+
# Sphinx documentation
64+
docs/_build/
65+
66+
# PyCharm
67+
.idea/
68+
69+
# VSCode
70+
.vscode/
71+
72+
# Pyenv
73+
.python-version
74+
75+
archive/

.pre-commit-config.yaml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# See https://pre-commit.com for more information
2+
# See https://pre-commit.com/hooks.html for more hooks
3+
repos:
4+
- repo: https://github.com/pre-commit/pre-commit-hooks
5+
rev: v5.0.0
6+
hooks:
7+
- id: trailing-whitespace
8+
exclude: ^tests/fixtures/.*
9+
- id: end-of-file-fixer
10+
- id: check-yaml
11+
- id: check-added-large-files
12+
13+
- repo: local
14+
hooks:
15+
- id: cargo-fmt
16+
name: cargo-fmt
17+
description: Format files with cargo fmt.
18+
entry: cargo fmt
19+
language: rust
20+
types: [rust]
21+
args: ["--"]
22+
23+
- repo: https://github.com/pycqa/isort
24+
rev: 5.13.2
25+
hooks:
26+
- id: isort
27+
28+
- repo: https://github.com/psf/black
29+
rev: 24.10.0
30+
hooks:
31+
- id: black
32+
33+
- repo: https://github.com/astral-sh/ruff-pre-commit
34+
rev: v0.7.0
35+
hooks:
36+
- id: ruff
37+
38+
- repo: https://github.com/pre-commit/mirrors-mypy
39+
rev: v1.12.1
40+
hooks:
41+
- id: mypy
42+
files: >
43+
(?x)^(
44+
.*\.pyi|
45+
tests/test_api\.py
46+
)$

0 commit comments

Comments
 (0)