Skip to content
This repository was archived by the owner on Jan 8, 2024. It is now read-only.

Commit ff19eed

Browse files
committed
A first pass basically ported from rpds.py.
0 parents  commit ff19eed

17 files changed

+1882
-0
lines changed

.github/dependabot.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "github-actions"
4+
directory: "/"
5+
schedule:
6+
interval: "weekly"
7+
8+
- package-ecosystem: "cargo"
9+
directory: "/"
10+
schedule:
11+
interval: "weekly"

.github/workflows/CI.yml

Lines changed: 162 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,162 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
tags:
8+
- "v[0-9].*"
9+
pull_request:
10+
release:
11+
types: [published]
12+
schedule:
13+
# Daily at 5:33
14+
- cron: "33 5 * * *"
15+
workflow_dispatch:
16+
17+
permissions:
18+
contents: write
19+
20+
jobs:
21+
pre-commit:
22+
runs-on: ubuntu-latest
23+
steps:
24+
- uses: actions/checkout@v3
25+
- uses: actions/setup-python@v4
26+
with:
27+
python-version: "3.x"
28+
- uses: pre-commit/[email protected]
29+
30+
list:
31+
runs-on: ubuntu-latest
32+
outputs:
33+
noxenvs: ${{ steps.noxenvs-matrix.outputs.noxenvs }}
34+
steps:
35+
- uses: actions/checkout@v3
36+
- name: Set up nox
37+
uses: wntrblm/[email protected]
38+
- id: noxenvs-matrix
39+
run: |
40+
echo >>$GITHUB_OUTPUT noxenvs=$(
41+
nox --list-sessions |
42+
grep '^* ' |
43+
cut -d ' ' -f 2- |
44+
jq --raw-input --slurp 'split("\n") | map(select(. != ""))'
45+
)
46+
47+
test:
48+
needs: list
49+
runs-on: ubuntu-latest
50+
strategy:
51+
fail-fast: false
52+
matrix:
53+
noxenv: ${{ fromJson(needs.list.outputs.noxenvs) }}
54+
55+
steps:
56+
- uses: actions/checkout@v3
57+
- name: Install dependencies
58+
run: sudo apt-get update && sudo apt-get install -y libenchant-2-dev
59+
if: runner.os == 'Linux' && startsWith(matrix.noxenv, 'docs')
60+
- name: Install dependencies
61+
run: brew install enchant
62+
if: runner.os == 'macOS' && startsWith(matrix.noxenv, 'docs')
63+
- name: Set up Python
64+
uses: actions/setup-python@v4
65+
with:
66+
python-version: "3.x"
67+
- name: Set up nox
68+
uses: wntrblm/[email protected]
69+
- name: Run nox
70+
run: nox -s "${{ matrix.noxenv }}"
71+
72+
linux:
73+
needs: test
74+
runs-on: ubuntu-latest
75+
strategy:
76+
matrix:
77+
target: [x86_64, x86, aarch64, armv7, s390x, ppc64le]
78+
steps:
79+
- uses: actions/checkout@v3
80+
- uses: actions/setup-python@v4
81+
with:
82+
python-version: "3.x"
83+
- name: Build wheels
84+
uses: PyO3/maturin-action@v1
85+
with:
86+
target: ${{ matrix.target }}
87+
args: --release --out dist --interpreter '3.8 3.9 3.10 3.11 pypy3.8 pypy3.9'
88+
manylinux: auto
89+
- name: Upload wheels
90+
uses: actions/upload-artifact@v3
91+
with:
92+
name: wheels
93+
path: dist
94+
95+
windows:
96+
needs: test
97+
runs-on: windows-latest
98+
strategy:
99+
matrix:
100+
target: [x64, x86]
101+
steps:
102+
- uses: actions/checkout@v3
103+
- uses: actions/setup-python@v4
104+
with:
105+
python-version: "3.x"
106+
architecture: ${{ matrix.target }}
107+
- name: Build wheels
108+
uses: PyO3/maturin-action@v1
109+
with:
110+
target: ${{ matrix.target }}
111+
args: --release --out dist --find-interpreter --sdist
112+
- name: Upload wheels
113+
uses: actions/upload-artifact@v3
114+
with:
115+
name: wheels
116+
path: dist
117+
118+
macos:
119+
needs: test
120+
runs-on: macos-latest
121+
strategy:
122+
matrix:
123+
target: [x86_64, aarch64]
124+
steps:
125+
- uses: actions/checkout@v3
126+
- uses: actions/setup-python@v4
127+
with:
128+
python-version: "3.x"
129+
- name: Build wheels
130+
uses: PyO3/maturin-action@v1
131+
with:
132+
target: ${{ matrix.target }}
133+
args: --release --out dist --find-interpreter
134+
- name: Upload wheels
135+
uses: actions/upload-artifact@v3
136+
with:
137+
name: wheels
138+
path: dist
139+
140+
release:
141+
name: Release
142+
runs-on: ubuntu-latest
143+
if: "startsWith(github.ref, 'refs/tags/')"
144+
needs: [linux, windows, macos]
145+
steps:
146+
- uses: actions/download-artifact@v3
147+
with:
148+
name: wheels
149+
- name: Publish to PyPI
150+
uses: PyO3/maturin-action@v1
151+
env:
152+
MATURIN_PYPI_TOKEN: ${{ secrets.pypi_password }}
153+
with:
154+
command: upload
155+
args: --skip-existing *
156+
- name: Create a GitHub Release
157+
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
158+
uses: softprops/action-gh-release@v1
159+
with:
160+
files: |
161+
*
162+
generate_release_notes: true

.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: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
repos:
2+
- repo: https://github.com/pre-commit/pre-commit-hooks
3+
rev: v4.4.0
4+
hooks:
5+
- id: check-ast
6+
- id: check-docstring-first
7+
- id: check-toml
8+
- id: check-vcs-permalinks
9+
- id: check-yaml
10+
- id: debug-statements
11+
- id: end-of-file-fixer
12+
- id: mixed-line-ending
13+
args: [--fix, lf]
14+
- id: trailing-whitespace
15+
- repo: https://github.com/doublify/pre-commit-rust
16+
rev: "v1.0"
17+
hooks:
18+
- id: fmt
19+
- repo: https://github.com/PyCQA/isort
20+
rev: 5.12.0
21+
hooks:
22+
- id: isort
23+
- repo: https://github.com/pycqa/flake8
24+
rev: "6.0.0"
25+
hooks:
26+
- id: flake8
27+
- repo: https://github.com/asottile/pyupgrade
28+
rev: v3.3.1
29+
hooks:
30+
- id: pyupgrade
31+
- repo: https://github.com/psf/black
32+
rev: 23.1.0
33+
hooks:
34+
- name: black
35+
id: black
36+
args: ["--line-length", "79"]
37+
- repo: https://github.com/pre-commit/mirrors-prettier
38+
rev: "v3.0.0-alpha.4"
39+
hooks:
40+
- id: prettier

0 commit comments

Comments
 (0)