Skip to content

Commit fa75184

Browse files
committed
Initialize project
0 parents  commit fa75184

19 files changed

+1506
-0
lines changed

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* text=auto eol=lf

.github/workflows/deploy_to_pypi.yml

Lines changed: 130 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
---
2+
name: Publish 📦 to PyPI
3+
4+
on:
5+
push:
6+
tags:
7+
- "v[0-9]+.[0-9]+.[0-9]+"
8+
- "!*-dev.*"
9+
10+
workflow_dispatch:
11+
12+
permissions:
13+
contents: read
14+
15+
jobs:
16+
linux:
17+
runs-on: ubuntu-latest
18+
strategy:
19+
matrix:
20+
target: [x86_64]
21+
python-version: ["3.8", "3.9", "3.10"]
22+
23+
steps:
24+
- uses: actions/checkout@v3
25+
- uses: actions/setup-python@v4
26+
with:
27+
python-version: ${{ matrix.python-version }}
28+
29+
- name: Build wheels
30+
uses: PyO3/maturin-action@v1
31+
with:
32+
target: ${{ matrix.target }}
33+
args: --release --out dist --find-interpreter
34+
sccache: "true"
35+
manylinux: auto
36+
37+
- name: Upload wheels
38+
uses: actions/upload-artifact@v3
39+
with:
40+
name: wheels
41+
path: dist
42+
43+
windows:
44+
runs-on: windows-latest
45+
strategy:
46+
matrix:
47+
target: [x64]
48+
python-version: ["3.8", "3.9", "3.10"]
49+
50+
steps:
51+
- uses: actions/checkout@v3
52+
- uses: actions/setup-python@v4
53+
with:
54+
python-version: ${{ matrix.python-version }}
55+
architecture: ${{ matrix.target }}
56+
57+
- name: Build wheels
58+
uses: PyO3/maturin-action@v1
59+
with:
60+
target: ${{ matrix.target }}
61+
args: --release --out dist --find-interpreter
62+
sccache: "true"
63+
64+
- name: Upload wheels
65+
uses: actions/upload-artifact@v3
66+
with:
67+
name: wheels
68+
path: dist
69+
70+
macos:
71+
runs-on: macos-latest
72+
strategy:
73+
matrix:
74+
target: [x86_64]
75+
python-version: ["3.8", "3.9", "3.10"]
76+
77+
steps:
78+
- uses: actions/checkout@v3
79+
80+
- uses: actions/setup-python@v4
81+
with:
82+
python-version: ${{ matrix.python-version }}
83+
84+
- name: Build wheels
85+
uses: PyO3/maturin-action@v1
86+
with:
87+
target: ${{ matrix.target }}
88+
args: --release --out dist --find-interpreter
89+
sccache: "true"
90+
91+
- name: Upload wheels
92+
uses: actions/upload-artifact@v3
93+
with:
94+
name: wheels
95+
path: dist
96+
97+
sdist:
98+
runs-on: ubuntu-latest
99+
steps:
100+
- uses: actions/checkout@v3
101+
102+
- name: Build sdist
103+
uses: PyO3/maturin-action@v1
104+
with:
105+
command: sdist
106+
args: --out dist
107+
108+
- name: Upload sdist
109+
uses: actions/upload-artifact@v3
110+
with:
111+
name: wheels
112+
path: dist
113+
114+
release:
115+
name: Release
116+
runs-on: ubuntu-latest
117+
if: "startsWith(github.ref, 'refs/tags/')"
118+
needs: [linux, windows, macos, sdist]
119+
steps:
120+
- uses: actions/download-artifact@v3
121+
with:
122+
name: wheels
123+
124+
- name: Publish to PyPI
125+
uses: PyO3/maturin-action@v1
126+
env:
127+
MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
128+
with:
129+
command: upload
130+
args: --skip-existing *
Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
---
2+
name: Publish 📦 to PyPI
3+
4+
on:
5+
push:
6+
tags:
7+
- "v[0-9]+.[0-9]+.[0-9]+"
8+
- "!*-dev.*"
9+
10+
workflow_dispatch:
11+
12+
permissions:
13+
contents: write
14+
15+
jobs:
16+
linux:
17+
runs-on: ubuntu-latest
18+
strategy:
19+
matrix:
20+
target: [x86_64]
21+
python-version: ["3.8", "3.9", "3.10"]
22+
23+
steps:
24+
- uses: actions/checkout@v3
25+
- uses: actions/setup-python@v4
26+
with:
27+
python-version: ${{ matrix.python-version }}
28+
29+
- name: Build wheels
30+
uses: PyO3/maturin-action@v1
31+
with:
32+
target: ${{ matrix.target }}
33+
args: --release --out dist --find-interpreter
34+
sccache: "true"
35+
manylinux: auto
36+
37+
- name: Upload wheels
38+
uses: actions/upload-artifact@v3
39+
with:
40+
name: wheels
41+
path: dist
42+
43+
windows:
44+
runs-on: windows-latest
45+
strategy:
46+
matrix:
47+
target: [x64]
48+
python-version: ["3.8", "3.9", "3.10"]
49+
50+
steps:
51+
- uses: actions/checkout@v3
52+
- uses: actions/setup-python@v4
53+
with:
54+
python-version: ${{ matrix.python-version }}
55+
architecture: ${{ matrix.target }}
56+
57+
- name: Build wheels
58+
uses: PyO3/maturin-action@v1
59+
with:
60+
target: ${{ matrix.target }}
61+
args: --release --out dist --find-interpreter
62+
sccache: "true"
63+
64+
- name: Upload wheels
65+
uses: actions/upload-artifact@v3
66+
with:
67+
name: wheels
68+
path: dist
69+
70+
macos:
71+
runs-on: macos-latest
72+
strategy:
73+
matrix:
74+
target: [x86_64]
75+
python-version: ["3.8", "3.9", "3.10"]
76+
77+
steps:
78+
- uses: actions/checkout@v3
79+
- uses: actions/setup-python@v4
80+
with:
81+
python-version: ${{ matrix.python-version }}
82+
83+
- name: Build wheels
84+
uses: PyO3/maturin-action@v1
85+
with:
86+
target: ${{ matrix.target }}
87+
args: --release --out dist --find-interpreter
88+
sccache: "true"
89+
90+
- name: Upload wheels
91+
uses: actions/upload-artifact@v3
92+
with:
93+
name: wheels
94+
path: dist
95+
96+
sdist:
97+
runs-on: ubuntu-latest
98+
steps:
99+
- uses: actions/checkout@v3
100+
- name: Build sdist
101+
uses: PyO3/maturin-action@v1
102+
with:
103+
command: sdist
104+
args: --out dist
105+
106+
- name: Upload sdist
107+
uses: actions/upload-artifact@v3
108+
with:
109+
name: wheels
110+
path: dist
111+
112+
release:
113+
name: Release
114+
runs-on: ubuntu-latest
115+
if: "startsWith(github.ref, 'refs/tags/')"
116+
needs: [linux, windows, macos, sdist]
117+
steps:
118+
- uses: actions/download-artifact@v3
119+
with:
120+
name: wheels
121+
122+
- name: Publish to PyPI
123+
uses: PyO3/maturin-action@v1
124+
env:
125+
MATURIN_PYPI_TOKEN: ${{ secrets.TEST_PYPI_API_TOKEN }}
126+
MATURIN_REPOSITORY_URL: "https://test.pypi.org/legacy/"
127+
with:
128+
command: upload
129+
args: --skip-existing *

.gitignore

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
/target
2+
3+
# Byte-compiled / optimized / DLL files
4+
__pycache__/
5+
.pytest_cache/
6+
*.py[cod]
7+
8+
# C extensions
9+
*.so
10+
11+
# Distribution / packaging
12+
.Python
13+
.venv/
14+
env/
15+
bin/
16+
build/
17+
develop-eggs/
18+
dist/
19+
eggs/
20+
lib/
21+
lib64/
22+
parts/
23+
sdist/
24+
var/
25+
include/
26+
man/
27+
venv/
28+
*.egg-info/
29+
.installed.cfg
30+
*.egg
31+
32+
# Installer logs
33+
pip-log.txt
34+
pip-delete-this-directory.txt
35+
pip-selfcheck.json
36+
37+
# Unit test / coverage reports
38+
htmlcov/
39+
.tox/
40+
.coverage
41+
.cache
42+
nosetests.xml
43+
coverage.xml
44+
45+
# Translations
46+
*.mo
47+
48+
# Mr Developer
49+
.mr.developer.cfg
50+
.project
51+
.pydevproject
52+
53+
# Rope
54+
.ropeproject
55+
56+
# Django stuff:
57+
*.log
58+
*.pot
59+
60+
.DS_Store
61+
62+
# Sphinx documentation
63+
docs/_build/
64+
65+
# PyCharm
66+
.idea/
67+
68+
# VSCode
69+
.vscode/
70+
71+
# Pyenv
72+
.python-version

.pre-commit-config.yaml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
exclude: '^(\.tox|\.env|dist|\.vscode)(/|$)'
2+
repos:
3+
- repo: local
4+
hooks:
5+
- id: rustfmt
6+
name: rustfmt
7+
entry: cargo fmt -- --check
8+
language: system
9+
types: [rust]
10+
pass_filenames: false
11+
12+
- id: clippy
13+
name: clippy
14+
entry: cargo clippy -- -D warnings
15+
language: system
16+
types: [rust]
17+
pass_filenames: false
18+
19+
- repo: https://github.com/Argmaster/autocopyright
20+
rev: "v1.1.0"
21+
hooks:
22+
- id: autocopyright
23+
args:
24+
[
25+
-s,
26+
"//",
27+
-d,
28+
cssfinder_backend_numpy,
29+
-d,
30+
src,
31+
-g,
32+
"*.rs",
33+
-l,
34+
"./scripts/templates/MIT.md.jinja2",
35+
]
36+
37+
- repo: https://github.com/pre-commit/mirrors-prettier
38+
rev: "v2.7.1"
39+
hooks:
40+
- id: prettier
41+
42+
- repo: https://github.com/pre-commit/pre-commit-hooks
43+
rev: "v4.4.0"
44+
hooks:
45+
- id: check-merge-conflict
46+
args: [--assume-in-merge]
47+
- id: check-case-conflict
48+
- id: trailing-whitespace
49+
- id: end-of-file-fixer
50+
- id: debug-statements
51+
- id: check-added-large-files
52+
args: ["--maxkb=2000"]
53+
- id: check-toml
54+
# - id: check-json
55+
- id: mixed-line-ending
56+
args: ["--fix=lf"]
57+
- id: trailing-whitespace
58+
- id: debug-statements

0 commit comments

Comments
 (0)