imodfile 0.2.3__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,79 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [master]
6
+ pull_request:
7
+ branches: [master]
8
+
9
+ jobs:
10
+ rust:
11
+ runs-on: ubuntu-latest
12
+
13
+ steps:
14
+ - uses: actions/checkout@v4
15
+
16
+ - name: Install Rust toolchain
17
+ uses: dtolnay/rust-toolchain@stable
18
+ with:
19
+ components: clippy
20
+
21
+ - name: Build
22
+ run: cargo build --locked
23
+
24
+ - name: Test
25
+ run: cargo test --locked
26
+
27
+ - name: Clippy
28
+ run: cargo clippy --all-targets --features python --locked -- -D warnings
29
+
30
+ - name: Doc
31
+ run: cargo doc --no-deps --locked
32
+
33
+ python:
34
+ runs-on: ubuntu-latest
35
+ strategy:
36
+ fail-fast: false
37
+ matrix:
38
+ python-version: ["3.9", "3.13"]
39
+
40
+ steps:
41
+ - uses: actions/checkout@v4
42
+
43
+ - name: Install Rust toolchain
44
+ uses: dtolnay/rust-toolchain@stable
45
+
46
+ - name: Set up Python
47
+ uses: actions/setup-python@v5
48
+ with:
49
+ python-version: ${{ matrix.python-version }}
50
+
51
+ - name: Install uv
52
+ run: pip install uv
53
+
54
+ - name: Sync environment
55
+ run: uv sync --locked
56
+
57
+ - name: Lint, format, and type check
58
+ if: matrix.python-version == '3.13'
59
+ run: |
60
+ uv run ruff check .
61
+ uv run ruff format --check .
62
+ uv run ty check
63
+
64
+ - name: Build wheel
65
+ run: uv run maturin build --release --locked --features python --out dist
66
+
67
+ - name: Build sdist
68
+ if: matrix.python-version == '3.13'
69
+ run: uv run maturin sdist --out dist
70
+
71
+ - name: Check distribution metadata
72
+ if: matrix.python-version == '3.13'
73
+ run: uvx twine check dist/*
74
+
75
+ - name: Install built wheel
76
+ run: uv pip install --force-reinstall --no-deps dist/imodfile-*.whl
77
+
78
+ - name: Python tests
79
+ run: uv run --no-sync pytest tests/test_python.py -v
@@ -0,0 +1,134 @@
1
+ name: Release
2
+
3
+ # Publish to PyPI on a version tag (e.g. `git tag v0.2.3 && git push --tags`).
4
+ #
5
+ # Uses PyPI Trusted Publishing (OIDC) — no API token secret is needed, but the
6
+ # publisher must be configured once on PyPI:
7
+ # https://pypi.org/manage/project/imodfile/settings/publishing/
8
+ # with: repository elemeng/imodfile, workflow release.yml, environment `pypi`.
9
+ #
10
+ # Also create the matching `pypi` environment under the repo's
11
+ # Settings -> Environments. GitHub creates it automatically on the first run,
12
+ # but the VS Code GitHub Actions extension flags the name as invalid until the
13
+ # environment exists.
14
+
15
+ on:
16
+ push:
17
+ tags: ["v*"]
18
+ workflow_dispatch:
19
+
20
+ permissions:
21
+ contents: read
22
+
23
+ jobs:
24
+ test:
25
+ name: Verify release
26
+ runs-on: ubuntu-latest
27
+
28
+ steps:
29
+ - uses: actions/checkout@v4
30
+
31
+ - name: Install Rust toolchain
32
+ uses: dtolnay/rust-toolchain@stable
33
+
34
+ - name: Set up Python
35
+ uses: actions/setup-python@v5
36
+ with:
37
+ python-version: "3.13"
38
+
39
+ - name: Install uv
40
+ run: pip install uv
41
+
42
+ - name: Check tag matches Cargo.toml version
43
+ if: startsWith(github.ref, 'refs/tags/')
44
+ run: |
45
+ tag="${GITHUB_REF_NAME#v}"
46
+ version="$(sed -n 's/^version = "\(.*\)"/\1/p' Cargo.toml | head -n1)"
47
+ echo "tag=$tag cargo_version=$version"
48
+ test "$tag" = "$version"
49
+
50
+ - name: Sync environment
51
+ run: uv sync --locked
52
+
53
+ - name: Lint, format, and type check
54
+ run: |
55
+ uv run ruff check .
56
+ uv run ruff format --check .
57
+ uv run ty check
58
+
59
+ - name: Python tests
60
+ run: uv run pytest tests/test_python.py -v
61
+
62
+ sdist:
63
+ name: Build sdist
64
+ runs-on: ubuntu-latest
65
+ steps:
66
+ - uses: actions/checkout@v4
67
+
68
+ - name: Build sdist
69
+ uses: PyO3/maturin-action@v1
70
+ with:
71
+ command: sdist
72
+ args: --out dist
73
+
74
+ - name: Upload sdist
75
+ uses: actions/upload-artifact@v4
76
+ with:
77
+ name: sdist
78
+ path: dist/*.tar.gz
79
+
80
+ wheels:
81
+ name: Wheel ${{ matrix.target }} (${{ matrix.os }})
82
+ runs-on: ${{ matrix.os }}
83
+ strategy:
84
+ fail-fast: false
85
+ matrix:
86
+ include:
87
+ - os: ubuntu-latest
88
+ target: x86_64
89
+ manylinux: auto
90
+ - os: ubuntu-latest
91
+ target: aarch64
92
+ manylinux: auto
93
+ - os: macos-latest
94
+ target: aarch64
95
+ - os: macos-latest
96
+ target: x86_64
97
+ - os: windows-latest
98
+ target: x64
99
+
100
+ steps:
101
+ - uses: actions/checkout@v4
102
+
103
+ - name: Build wheel
104
+ uses: PyO3/maturin-action@v1
105
+ with:
106
+ target: ${{ matrix.target }}
107
+ manylinux: ${{ matrix.manylinux || 'auto' }}
108
+ args: --release --locked --features python --out dist
109
+
110
+ - name: Upload wheel
111
+ uses: actions/upload-artifact@v4
112
+ with:
113
+ name: wheels-${{ matrix.os }}-${{ matrix.target }}
114
+ path: dist/*.whl
115
+
116
+ publish:
117
+ name: Publish to PyPI
118
+ needs: [test, sdist, wheels]
119
+ runs-on: ubuntu-latest
120
+ environment:
121
+ name: pypi
122
+ url: https://pypi.org/project/imodfile/
123
+ permissions:
124
+ id-token: write
125
+
126
+ steps:
127
+ - name: Download all distributions
128
+ uses: actions/download-artifact@v4
129
+ with:
130
+ path: dist
131
+ merge-multiple: true
132
+
133
+ - name: Publish
134
+ uses: pypa/gh-action-pypi-publish@release/v1
@@ -0,0 +1,44 @@
1
+ # Rust build output
2
+ /target
3
+ fuzz/target/
4
+
5
+ # Fuzz testing artifacts (cargo-fuzz)
6
+ fuzz/corpus/
7
+ fuzz/artifacts/
8
+ fuzz/coverage/
9
+
10
+ # Editor / IDE
11
+ *.swp
12
+ *.swo
13
+ *~
14
+ .vscode/
15
+ .idea/
16
+ *.iml
17
+ .history/
18
+
19
+ # macOS
20
+ .DS_Store
21
+
22
+ # Windows
23
+ Thumbs.db
24
+
25
+ # Python
26
+ __pycache__/
27
+ *.pyc
28
+ *.pyo
29
+ *.pyd
30
+ .pytest_cache/
31
+ *.egg-info/
32
+ dist/
33
+ build/
34
+ *.whl
35
+ venv/
36
+ .venv/
37
+
38
+ # Rust tooling
39
+ *.rs.bk
40
+
41
+ # Coverage / profiling
42
+ *.profraw
43
+ lcov.info
44
+ coverage/