gtlv 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,52 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [dev, main] # dev = snapshot verification; main = formal (post-merge)
6
+ pull_request:
7
+ branches: [main] # gate the dev -> main PR
8
+
9
+ permissions:
10
+ contents: read
11
+
12
+ concurrency:
13
+ group: ci-${{ github.ref }}
14
+ cancel-in-progress: true
15
+
16
+ jobs:
17
+ ci:
18
+ name: Rust + Python (lint · test)
19
+ runs-on: ubuntu-latest
20
+ steps:
21
+ - uses: actions/checkout@v7
22
+
23
+ # Honor rust-toolchain.toml so CI uses the same toolchain as local `make lint`.
24
+ - name: Install pinned Rust toolchain
25
+ run: rustup show
26
+
27
+ - uses: Swatinem/rust-cache@v2
28
+
29
+ - uses: actions/setup-python@v7
30
+ with:
31
+ python-version: "3.10"
32
+
33
+ - name: Install dev dependencies
34
+ run: python -m pip install --upgrade "maturin>=1.0,<2.0" "mypy>=1.19"
35
+
36
+ - name: cargo fmt
37
+ run: cargo fmt --all -- --check
38
+
39
+ - name: cargo clippy
40
+ run: cargo clippy --all-targets -- -D warnings
41
+
42
+ # Building through maturin also exercises the models embedded in gtlv-core.
43
+ - name: Install the package
44
+ run: python -m pip install .
45
+
46
+ - name: mypy
47
+ env:
48
+ MYPYPATH: python
49
+ run: mypy --python-version 3.10 python/gtlv tests
50
+
51
+ - name: Python tests
52
+ run: python -m unittest discover -s tests
@@ -0,0 +1,114 @@
1
+ name: Release
2
+
3
+ # Build wheels and an sdist, then publish them to PyPI on a version tag.
4
+ # Publishing uses PyPI Trusted Publishing: GitHub mints a short-lived OIDC token
5
+ # that PyPI exchanges for upload credentials, so no API token is stored here.
6
+ #
7
+ # One-time setup on PyPI (Your projects -> Publishing, or a pending publisher for
8
+ # the first release) must match this workflow exactly:
9
+ # Owner cca2878
10
+ # Repository gtlv-py
11
+ # Workflow release.yml
12
+ # Environment pypi
13
+ on:
14
+ push:
15
+ tags: ["v*"]
16
+ workflow_dispatch: # builds and verifies the matrix without publishing
17
+
18
+ permissions:
19
+ contents: read
20
+
21
+ jobs:
22
+ guard:
23
+ name: Tag matches Cargo.toml
24
+ runs-on: ubuntu-latest
25
+ if: startsWith(github.ref, 'refs/tags/')
26
+ steps:
27
+ - uses: actions/checkout@v7
28
+ # PyPI versions are immutable, so catch a mismatch before anything uploads.
29
+ - run: |
30
+ tag="${GITHUB_REF_NAME#v}"
31
+ crate="$(sed -n '0,/^version = /s/^version = "\(.*\)"/\1/p' Cargo.toml)"
32
+ echo "tag=$tag cargo=$crate"
33
+ test "$tag" = "$crate"
34
+
35
+ wheels:
36
+ name: wheel ${{ matrix.platform.os }}-${{ matrix.platform.target }}
37
+ runs-on: ${{ matrix.platform.runner }}
38
+ strategy:
39
+ fail-fast: false
40
+ matrix:
41
+ platform:
42
+ - { os: linux, runner: ubuntu-latest, target: x86_64 }
43
+ - { os: linux, runner: ubuntu-latest, target: aarch64 }
44
+ - { os: macos, runner: macos-latest, target: aarch64 }
45
+ - { os: macos, runner: macos-15-intel, target: x86_64 }
46
+ - { os: windows, runner: windows-latest, target: x64 }
47
+ steps:
48
+ - uses: actions/checkout@v7
49
+ - uses: actions/setup-python@v7
50
+ with:
51
+ # Pinned rather than "3.x": abi3 fixes the output ABI at py310 no matter
52
+ # which interpreter builds it, so a floating latest only adds the risk of
53
+ # outrunning what this PyO3 release knows about.
54
+ python-version: "3.13"
55
+
56
+ # abi3-py310 yields a single wheel per platform, so no interpreter sweep.
57
+ - uses: PyO3/maturin-action@v1
58
+ env:
59
+ # The manylinux containers pick their own interpreter, which may be newer
60
+ # than the above; the stable ABI holds either way.
61
+ PYO3_USE_ABI3_FORWARD_COMPATIBILITY: 1
62
+ with:
63
+ target: ${{ matrix.platform.target }}
64
+ args: --release --out dist
65
+ manylinux: auto
66
+ sccache: "true"
67
+
68
+ # Smoke-test the actual artifact on the one runner that can load it.
69
+ # A wheel that fails to import must never reach PyPI.
70
+ - name: Install and test the built wheel
71
+ if: matrix.platform.os == 'linux' && matrix.platform.target == 'x86_64'
72
+ run: |
73
+ python -m pip install dist/*.whl
74
+ python -m unittest discover -s tests -v
75
+
76
+ - uses: actions/upload-artifact@v7
77
+ with:
78
+ name: dist-${{ matrix.platform.os }}-${{ matrix.platform.target }}
79
+ path: dist
80
+
81
+ sdist:
82
+ name: sdist
83
+ runs-on: ubuntu-latest
84
+ steps:
85
+ - uses: actions/checkout@v7
86
+ - uses: PyO3/maturin-action@v1
87
+ with:
88
+ command: sdist
89
+ args: --out dist
90
+ - uses: actions/upload-artifact@v7
91
+ with:
92
+ name: dist-sdist
93
+ path: dist
94
+
95
+ publish:
96
+ name: publish -> PyPI
97
+ needs: [guard, wheels, sdist]
98
+ if: startsWith(github.ref, 'refs/tags/')
99
+ runs-on: ubuntu-latest
100
+ environment:
101
+ name: pypi
102
+ url: https://pypi.org/p/gtlv
103
+ permissions:
104
+ id-token: write # required for Trusted Publishing; no token secret is used
105
+ steps:
106
+ - uses: actions/download-artifact@v8
107
+ with:
108
+ pattern: dist-*
109
+ path: dist
110
+ merge-multiple: true
111
+ # A rejected upload still burns the version number, so validate metadata
112
+ # and README rendering first.
113
+ - run: pipx run twine check dist/*
114
+ - uses: pypa/gh-action-pypi-publish@release/v1
gtlv-0.1.0/.gitignore ADDED
@@ -0,0 +1,11 @@
1
+ /target/
2
+ *.so
3
+ __pycache__/
4
+ *.egg-info/
5
+ /dist/
6
+ .coverage
7
+ .mypy_cache/
8
+ .pytest_cache/
9
+ .DS_Store
10
+ .idea/
11
+ .vscode/