trapy 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.
@@ -0,0 +1,5 @@
1
+ [net]
2
+ git-fetch-with-cli = true
3
+
4
+ [build]
5
+ rustflags = ["--cfg", "tracing_unstable"]
@@ -0,0 +1,67 @@
1
+ name: Check
2
+
3
+ # trapy links pyo3 unconditionally, so every `cargo test` binary links libpython
4
+ # and needs an interpreter on every runner. There is no musl cell for the same
5
+ # reason: no musl libpython to link against.
6
+ #
7
+ # The default feature set is the *consumer* build (capsule forwarding only), so
8
+ # the subscriber backend and the two wheel ABI features get their own steps —
9
+ # nothing else in the matrix compiles them.
10
+
11
+ on:
12
+ push:
13
+ branches: [main]
14
+ pull_request:
15
+
16
+ jobs:
17
+ check:
18
+ strategy:
19
+ fail-fast: false
20
+ matrix:
21
+ platform:
22
+ - { os: macos-latest, target: aarch64-apple-darwin }
23
+ - { os: windows-latest, target: x86_64-pc-windows-msvc }
24
+ - { os: ubuntu-latest, target: x86_64-unknown-linux-gnu }
25
+ - { os: ubuntu-24.04-arm, target: aarch64-unknown-linux-gnu }
26
+
27
+ runs-on: ${{ matrix.platform.os }}
28
+ name: ${{ matrix.platform.target }}
29
+
30
+ steps:
31
+ - uses: actions/checkout@v4
32
+
33
+ - uses: dtolnay/rust-toolchain@stable
34
+ with:
35
+ targets: ${{ matrix.platform.target }}
36
+ components: clippy
37
+
38
+ - uses: actions/setup-python@v5
39
+ with:
40
+ python-version: "3.10"
41
+
42
+ - uses: Swatinem/rust-cache@v2
43
+ with:
44
+ key: ${{ matrix.platform.target }}
45
+
46
+ - name: Cargo check
47
+ run: cargo check --target ${{ matrix.platform.target }}
48
+
49
+ - name: Clippy
50
+ run: cargo clippy --target ${{ matrix.platform.target }} --all-targets -- -D warnings
51
+
52
+ - name: Cargo check (-F subscribers)
53
+ run: cargo check --target ${{ matrix.platform.target }} -F subscribers
54
+
55
+ - name: Clippy (-F subscribers)
56
+ run: cargo clippy --target ${{ matrix.platform.target }} --all-targets -F subscribers -- -D warnings
57
+
58
+ - name: Cargo check (-F abi3)
59
+ if: matrix.platform.target == 'x86_64-unknown-linux-gnu'
60
+ run: cargo check --target ${{ matrix.platform.target }} -F abi3
61
+
62
+ - name: Cargo check (-F abi3t)
63
+ if: matrix.platform.target == 'x86_64-unknown-linux-gnu'
64
+ run: cargo check --target ${{ matrix.platform.target }} -F abi3t
65
+
66
+ - name: Tests
67
+ run: cargo test --target ${{ matrix.platform.target }} -F subscribers
@@ -0,0 +1,32 @@
1
+ name: Format
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+
8
+ jobs:
9
+ rust:
10
+ runs-on: ubuntu-latest
11
+ name: cargo fmt
12
+
13
+ steps:
14
+ - uses: actions/checkout@v4
15
+
16
+ - uses: dtolnay/rust-toolchain@stable
17
+ with:
18
+ components: rustfmt
19
+
20
+ - run: cargo fmt --check
21
+
22
+ python:
23
+ runs-on: ubuntu-latest
24
+ name: ruff
25
+
26
+ steps:
27
+ - uses: actions/checkout@v4
28
+
29
+ - uses: astral-sh/setup-uv@v5
30
+
31
+ - run: uv tool run ruff check --ignore F403,F405 .
32
+ - run: uv tool run ruff format --check
@@ -0,0 +1,155 @@
1
+ name: Publish
2
+
3
+ # Public repo: publishes to PyPI + crates.io.
4
+ #
5
+ # Build jobs run on every PR and push to main as a dry run of the real release
6
+ # pipeline — same targets, same ABIs — so a publish-time breakage (unsupported
7
+ # interpreter, packaging error, bad metadata) surfaces in CI before a tag is
8
+ # cut. Only the upload jobs are gated on v* tags.
9
+ #
10
+ # Every target builds on a runner of its own architecture — aarch64 Linux on
11
+ # `ubuntu-24.04-arm` and aarch64 Windows on `windows-11-arm` — so nothing is
12
+ # cross-compiled. Each platform is built three ways from one source: an `abi3`
13
+ # wheel pinned to the minimum supported Python (cp310-abi3, the abi3 cargo
14
+ # feature), a version-specific free-threaded `cp314t` wheel (3.14t predates the
15
+ # stable free-threaded ABI), and an `abi3t` wheel (the abi3t cargo feature, PEP
16
+ # 803) that covers free-threaded and GIL builds of Python 3.15 and newer. abi3
17
+ # is selected by the cargo feature alone and needs no interpreter; abi3t needs
18
+ # one present, so it is built with `-i python3.15t` (3.15 is in beta — the
19
+ # non-Linux runners install it via setup-python with allow-prereleases, and the
20
+ # manylinux containers ship it under /opt/python). The cargo feature controls
21
+ # the wheel tag, so this stays an abi3t wheel.
22
+ on:
23
+ push:
24
+ branches: [main]
25
+ tags:
26
+ - "v*"
27
+ pull_request:
28
+
29
+ permissions:
30
+ contents: read
31
+
32
+ jobs:
33
+ build-wheels:
34
+ strategy:
35
+ fail-fast: false
36
+ matrix:
37
+ platform:
38
+ - { os: ubuntu-latest, target: x86_64-unknown-linux-gnu }
39
+ - { os: ubuntu-24.04-arm, target: aarch64-unknown-linux-gnu }
40
+ - { os: macos-latest, target: aarch64-apple-darwin }
41
+ - { os: windows-latest, target: x86_64-pc-windows-msvc }
42
+ - { os: windows-11-arm, target: aarch64-pc-windows-msvc }
43
+ wheel:
44
+ - { name: abi3, args: "-F abi3", python: "" }
45
+ - { name: abi3t, args: "-F abi3t -i python3.15t", python: "3.15t" }
46
+ - { name: cp314t, args: "-i python3.14t", python: "3.14t" }
47
+
48
+ runs-on: ${{ matrix.platform.os }}
49
+ name: ${{ matrix.wheel.name }} wheel (${{ matrix.platform.target }})
50
+
51
+ steps:
52
+ - uses: actions/checkout@v4
53
+
54
+ - uses: actions/setup-python@v5
55
+ if: matrix.wheel.python != '' && !contains(matrix.platform.target, 'linux')
56
+ with:
57
+ python-version: ${{ matrix.wheel.python }}
58
+ allow-prereleases: true
59
+
60
+ - uses: PyO3/maturin-action@v1
61
+ with:
62
+ target: ${{ matrix.platform.target }}
63
+ args: --release --out dist ${{ matrix.wheel.args }}
64
+ manylinux: auto
65
+ docker-options: -e CARGO_NET_RETRY -e CARGO_HTTP_MULTIPLEXING
66
+ env:
67
+ CARGO_NET_RETRY: "10"
68
+ CARGO_HTTP_MULTIPLEXING: "false"
69
+
70
+ - uses: actions/upload-artifact@v4
71
+ with:
72
+ name: wheel-${{ matrix.wheel.name }}-${{ matrix.platform.target }}
73
+ path: dist/*.whl
74
+
75
+ sdist:
76
+ runs-on: ubuntu-latest
77
+ name: Build sdist
78
+
79
+ steps:
80
+ - uses: actions/checkout@v4
81
+
82
+ - uses: PyO3/maturin-action@v1
83
+ with:
84
+ command: sdist
85
+ args: --out dist
86
+
87
+ - uses: actions/upload-artifact@v4
88
+ with:
89
+ name: sdist
90
+ path: dist/*.tar.gz
91
+
92
+ check-dist:
93
+ runs-on: ubuntu-latest
94
+ name: twine check
95
+ needs: [build-wheels, sdist]
96
+
97
+ steps:
98
+ - uses: actions/download-artifact@v4
99
+ with:
100
+ path: dist
101
+ merge-multiple: true
102
+
103
+ - uses: astral-sh/setup-uv@v5
104
+
105
+ - run: uv tool run twine check --strict dist/*
106
+
107
+ crates-dry-run:
108
+ runs-on: ubuntu-latest
109
+ name: cargo publish --dry-run
110
+ if: ${{ !startsWith(github.ref, 'refs/tags/') }}
111
+
112
+ steps:
113
+ - uses: actions/checkout@v4
114
+
115
+ - uses: dtolnay/rust-toolchain@stable
116
+
117
+ - uses: Swatinem/rust-cache@v2
118
+ with:
119
+ key: publish-dry-run
120
+
121
+ - run: cargo publish --dry-run
122
+
123
+ publish-pypi:
124
+ runs-on: ubuntu-latest
125
+ name: Publish to PyPI
126
+ if: startsWith(github.ref, 'refs/tags/v')
127
+ needs: [check-dist]
128
+
129
+ steps:
130
+ - uses: actions/download-artifact@v4
131
+ with:
132
+ path: dist
133
+ merge-multiple: true
134
+
135
+ - uses: astral-sh/setup-uv@v5
136
+
137
+ - name: Publish to PyPI
138
+ run: uv publish dist/*
139
+ env:
140
+ UV_PUBLISH_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
141
+
142
+ publish-crates:
143
+ runs-on: ubuntu-latest
144
+ name: Publish to crates.io
145
+ if: startsWith(github.ref, 'refs/tags/v')
146
+
147
+ steps:
148
+ - uses: actions/checkout@v4
149
+
150
+ - uses: dtolnay/rust-toolchain@stable
151
+
152
+ - name: Publish to crates.io
153
+ run: cargo publish
154
+ env:
155
+ CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
trapy-0.1.0/.gitignore ADDED
@@ -0,0 +1,26 @@
1
+ __pycache__/*
2
+ .DS_Store
3
+ build/
4
+ **/build/**
5
+ **/build-*/
6
+ **/cmake-build-*/
7
+ **/dist/**
8
+ CMakeFiles/
9
+ CMakeCache.txt
10
+ compile_commands.json
11
+ *.o
12
+ *.a
13
+ *.so
14
+ *.dylib
15
+ *.pdb
16
+ *.exe
17
+ dist/
18
+ *.egg-info/
19
+ __pycache__/
20
+ .test/**
21
+ **/target/
22
+ **/Cargo.lock
23
+ .venv/
24
+ .ruff_cache/
25
+ .claude/
26
+ .integration/