harper-py 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- harper_py-0.1.0/.github/workflows/release.yml +40 -0
- harper_py-0.1.0/.github/workflows/wheels.yml +102 -0
- harper_py-0.1.0/.gitignore +9 -0
- harper_py-0.1.0/CHANGELOG.md +8 -0
- harper_py-0.1.0/Cargo.lock +5861 -0
- harper_py-0.1.0/Cargo.toml +25 -0
- harper_py-0.1.0/DEVIATIONS.md +111 -0
- harper_py-0.1.0/LICENSE +201 -0
- harper_py-0.1.0/PKG-INFO +102 -0
- harper_py-0.1.0/README.md +71 -0
- harper_py-0.1.0/benchmarks/bench.py +52 -0
- harper_py-0.1.0/benchmarks/essay.md +15 -0
- harper_py-0.1.0/context7.json +12 -0
- harper_py-0.1.0/docs/guide.md +175 -0
- harper_py-0.1.0/docs/spec.md +79 -0
- harper_py-0.1.0/pyproject.toml +58 -0
- harper_py-0.1.0/python/harper/__init__.py +44 -0
- harper_py-0.1.0/python/harper/__init__.pyi +271 -0
- harper_py-0.1.0/python/harper/py.typed +0 -0
- harper_py-0.1.0/src/lib.rs +907 -0
- harper_py-0.1.0/tests/parity/corpus.json +210 -0
- harper_py-0.1.0/tests/parity/expected.json +1482 -0
- harper_py-0.1.0/tests/parity/regen.py +40 -0
- harper_py-0.1.0/tests/parity/test_parity.py +51 -0
- harper_py-0.1.0/tests/test_api.py +177 -0
- harper_py-0.1.0/tests/test_linter.py +422 -0
- harper_py-0.1.0/tests/test_readme.py +16 -0
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
name: release
|
|
2
|
+
|
|
3
|
+
# PyPI trusted publishing: the publisher on PyPI must name this workflow (release.yml)
|
|
4
|
+
# and the environment `pypi`.
|
|
5
|
+
on:
|
|
6
|
+
push:
|
|
7
|
+
tags: ["v*"]
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
check-version:
|
|
11
|
+
runs-on: ubuntu-24.04
|
|
12
|
+
steps:
|
|
13
|
+
- uses: actions/checkout@v7
|
|
14
|
+
- name: Check tag matches project version
|
|
15
|
+
run: |
|
|
16
|
+
v=$(grep -m1 '^version' Cargo.toml | cut -d'"' -f2)
|
|
17
|
+
[ "v$v" = "${GITHUB_REF_NAME}" ] || {
|
|
18
|
+
echo "tag ${GITHUB_REF_NAME} does not match Cargo.toml version $v"; exit 1; }
|
|
19
|
+
|
|
20
|
+
wheels:
|
|
21
|
+
needs: check-version
|
|
22
|
+
uses: ./.github/workflows/wheels.yml
|
|
23
|
+
|
|
24
|
+
publish:
|
|
25
|
+
needs: wheels
|
|
26
|
+
runs-on: ubuntu-24.04
|
|
27
|
+
environment: pypi
|
|
28
|
+
permissions:
|
|
29
|
+
id-token: write
|
|
30
|
+
attestations: write
|
|
31
|
+
steps:
|
|
32
|
+
- uses: actions/download-artifact@v8
|
|
33
|
+
with:
|
|
34
|
+
pattern: wheels-*
|
|
35
|
+
path: dist
|
|
36
|
+
merge-multiple: true
|
|
37
|
+
|
|
38
|
+
- uses: pypa/gh-action-pypi-publish@release/v1
|
|
39
|
+
with:
|
|
40
|
+
attestations: true
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
name: wheels
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
pull_request:
|
|
7
|
+
workflow_dispatch:
|
|
8
|
+
workflow_call:
|
|
9
|
+
|
|
10
|
+
jobs:
|
|
11
|
+
build:
|
|
12
|
+
name: ${{ matrix.name }}
|
|
13
|
+
runs-on: ${{ matrix.os }}
|
|
14
|
+
strategy:
|
|
15
|
+
fail-fast: false
|
|
16
|
+
matrix:
|
|
17
|
+
include:
|
|
18
|
+
- { name: manylinux x86_64, os: ubuntu-24.04, target: x86_64, manylinux: auto }
|
|
19
|
+
- { name: manylinux aarch64, os: ubuntu-24.04-arm, target: aarch64, manylinux: auto }
|
|
20
|
+
- { name: musllinux x86_64, os: ubuntu-24.04, target: x86_64-unknown-linux-musl, manylinux: musllinux_1_2 }
|
|
21
|
+
- { name: musllinux aarch64, os: ubuntu-24.04-arm, target: aarch64-unknown-linux-musl, manylinux: musllinux_1_2 }
|
|
22
|
+
- { name: macos arm64, os: macos-14, target: aarch64-apple-darwin, python-arch: arm64 }
|
|
23
|
+
- { name: macos x86_64, os: macos-14, target: x86_64-apple-darwin, python-arch: x64, run: arch -x86_64 }
|
|
24
|
+
- { name: windows x64, os: windows-2022, target: x86_64-pc-windows-msvc, python-arch: x64 }
|
|
25
|
+
- { name: windows arm64, os: windows-11-arm, target: aarch64-pc-windows-msvc, python-arch: arm64 }
|
|
26
|
+
steps:
|
|
27
|
+
- uses: actions/checkout@v7
|
|
28
|
+
|
|
29
|
+
# x64 Python on the arm64 macOS runner runs under Rosetta (`arch -x86_64`: the installed
|
|
30
|
+
# Python is universal2), so the x86_64 wheel is tested too.
|
|
31
|
+
- uses: actions/setup-python@v7
|
|
32
|
+
with:
|
|
33
|
+
python-version: "3.13"
|
|
34
|
+
architecture: ${{ matrix.python-arch }}
|
|
35
|
+
|
|
36
|
+
# abi3-py310: one wheel per platform covers CPython 3.10+.
|
|
37
|
+
- uses: PyO3/maturin-action@v1
|
|
38
|
+
with:
|
|
39
|
+
command: build
|
|
40
|
+
args: --release --out dist
|
|
41
|
+
target: ${{ matrix.target }}
|
|
42
|
+
manylinux: ${{ matrix.manylinux }}
|
|
43
|
+
sccache: "true"
|
|
44
|
+
|
|
45
|
+
- name: Test the wheel
|
|
46
|
+
if: ${{ !matrix.manylinux || matrix.manylinux == 'auto' }}
|
|
47
|
+
shell: bash
|
|
48
|
+
run: |
|
|
49
|
+
${{ matrix.run }} python -m pip install dist/*.whl pytest hypothesis
|
|
50
|
+
${{ matrix.run }} python -m pytest tests
|
|
51
|
+
|
|
52
|
+
- name: Test the wheel on Alpine
|
|
53
|
+
if: matrix.manylinux == 'musllinux_1_2'
|
|
54
|
+
run: >
|
|
55
|
+
docker run --rm -v "$PWD:/io" -w /io python:3.13-alpine
|
|
56
|
+
sh -c "pip install dist/*.whl pytest hypothesis && python -m pytest tests"
|
|
57
|
+
|
|
58
|
+
# The floor of abi3 and the newest interpreter. One runner is enough: the abi3
|
|
59
|
+
# boundary is per interpreter, not per platform.
|
|
60
|
+
- uses: actions/setup-python@v7
|
|
61
|
+
if: matrix.name == 'manylinux x86_64'
|
|
62
|
+
with:
|
|
63
|
+
python-version: |
|
|
64
|
+
3.10
|
|
65
|
+
3.14
|
|
66
|
+
allow-prereleases: true
|
|
67
|
+
|
|
68
|
+
- name: Test the wheel on Python 3.10 and 3.14
|
|
69
|
+
if: matrix.name == 'manylinux x86_64'
|
|
70
|
+
run: |
|
|
71
|
+
for v in 3.10 3.14; do
|
|
72
|
+
python$v -m venv /tmp/venv$v
|
|
73
|
+
/tmp/venv$v/bin/pip install dist/*.whl pytest hypothesis
|
|
74
|
+
/tmp/venv$v/bin/python -m pytest tests
|
|
75
|
+
done
|
|
76
|
+
|
|
77
|
+
- uses: actions/upload-artifact@v7
|
|
78
|
+
with:
|
|
79
|
+
name: wheels-${{ matrix.os }}-${{ matrix.target }}
|
|
80
|
+
path: dist/*.whl
|
|
81
|
+
|
|
82
|
+
sdist:
|
|
83
|
+
name: sdist
|
|
84
|
+
runs-on: ubuntu-24.04
|
|
85
|
+
steps:
|
|
86
|
+
- uses: actions/checkout@v7
|
|
87
|
+
|
|
88
|
+
- uses: PyO3/maturin-action@v1
|
|
89
|
+
with:
|
|
90
|
+
command: sdist
|
|
91
|
+
args: --out dist
|
|
92
|
+
|
|
93
|
+
- name: Install from sdist and run tests
|
|
94
|
+
run: |
|
|
95
|
+
python -m venv /tmp/sdist-venv
|
|
96
|
+
/tmp/sdist-venv/bin/pip install dist/*.tar.gz pytest hypothesis
|
|
97
|
+
/tmp/sdist-venv/bin/python -m pytest tests
|
|
98
|
+
|
|
99
|
+
- uses: actions/upload-artifact@v7
|
|
100
|
+
with:
|
|
101
|
+
name: wheels-sdist
|
|
102
|
+
path: dist/*.tar.gz
|