anb-estimator 0.3.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,144 @@
1
+ name: ci
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ tags: ["v*"]
7
+ pull_request:
8
+
9
+ concurrency:
10
+ group: ${{ github.workflow }}-${{ github.ref }}
11
+ cancel-in-progress: true
12
+
13
+ env:
14
+ CARGO_TERM_COLOR: always
15
+ RUST_BACKTRACE: full
16
+
17
+ jobs:
18
+ build_and_test:
19
+ name: Build, test and lint - ${{matrix.os}}
20
+ runs-on: ${{matrix.os}}
21
+ strategy:
22
+ fail-fast: false
23
+ matrix:
24
+ # Matches the platforms declared in pixi.toml (linux-64, osx-arm64, win-64).
25
+ os: [ubuntu-latest, macos-latest, windows-latest]
26
+ steps:
27
+ - uses: actions/checkout@v7
28
+ - name: Set up pixi (Linux/macOS)
29
+ # `prefix-dev/setup-pixi` is not allowed here: all actions must come from
30
+ # a repository owned by Alice-Bob-SW or created by GitHub.
31
+ if: runner.os != 'Windows'
32
+ run: |
33
+ curl -fsSL https://pixi.sh/install.sh | bash
34
+ echo "$HOME/.pixi/bin" >> "$GITHUB_PATH"
35
+ - name: Set up pixi (Windows)
36
+ if: runner.os == 'Windows'
37
+ run: |
38
+ iwr -useb https://pixi.sh/install.ps1 | iex
39
+ echo "$env:USERPROFILE\.pixi\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
40
+ shell: pwsh
41
+ - name: Cache cargo registry and build
42
+ uses: actions/cache@v6
43
+ with:
44
+ path: |
45
+ ~/.cargo
46
+ target
47
+ key: ${{runner.os}}-cargo-${{github.sha}}
48
+ restore-keys: ${{runner.os}}-cargo-
49
+ - name: Install environment and build the native extension
50
+ run: pixi install -e dev
51
+ - name: fmt
52
+ run: pixi run -e dev fmt-check
53
+ - name: clippy
54
+ run: pixi run -e dev clippy
55
+ - name: Build debug
56
+ run: pixi run -e dev cargo build
57
+ - name: build release
58
+ run: pixi run -e dev cargo build --release
59
+ - name: Save executable
60
+ uses: actions/upload-artifact@v7
61
+ with:
62
+ name: ${{matrix.os}}-anb_estimator_cli
63
+ path: target/release/anb_estimator_cli${{ runner.os == 'Windows' && '.exe' || ''}}
64
+ - name: test
65
+ run: pixi run -e dev test
66
+ - name: example elliptic_log
67
+ run: pixi run -e dev cargo run --example=elliptic_log
68
+ - name: example from_qsharp
69
+ run: pixi run -e dev cargo run --example=from_qsharp
70
+ - name: doc
71
+ run: pixi run -e dev cargo doc --release --no-deps
72
+ - name: Save doc
73
+ uses: actions/upload-artifact@v7
74
+ with:
75
+ name: ${{matrix.os}}-doc
76
+ path: target/doc
77
+ - name: Ruff lint
78
+ run: pixi run -e dev lint-py
79
+ - name: Ruff format check
80
+ run: pixi run -e dev fmt-py-check
81
+ - name: ty check
82
+ run: pixi run -e dev typecheck
83
+ - name: Import smoke test
84
+ run: pixi run -e dev import-check
85
+
86
+ build_wheels:
87
+ name: Build wheel - ${{matrix.os}}
88
+ if: startsWith(github.ref, 'refs/tags/v')
89
+ needs: [build_and_test]
90
+ runs-on: ${{matrix.os}}
91
+ strategy:
92
+ matrix:
93
+ os: [ubuntu-latest, macos-latest, windows-latest]
94
+ steps:
95
+ - uses: actions/checkout@v7
96
+ - name: Set up pixi (Linux/macOS)
97
+ if: runner.os != 'Windows'
98
+ run: |
99
+ curl -fsSL https://pixi.sh/install.sh | bash
100
+ echo "$HOME/.pixi/bin" >> "$GITHUB_PATH"
101
+ - name: Set up pixi (Windows)
102
+ if: runner.os == 'Windows'
103
+ run: |
104
+ iwr -useb https://pixi.sh/install.ps1 | iex
105
+ echo "$env:USERPROFILE\.pixi\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
106
+ shell: pwsh
107
+ - name: Install environment
108
+ run: pixi install -e dev
109
+ - name: Build wheel
110
+ run: pixi run -e dev maturin build --release -o dist
111
+ - name: Build sdist
112
+ if: runner.os == 'Linux'
113
+ run: pixi run -e dev maturin sdist -o dist
114
+ - name: Save distributables
115
+ uses: actions/upload-artifact@v7
116
+ with:
117
+ name: dist-${{matrix.os}}
118
+ path: dist/*
119
+
120
+ publish:
121
+ name: Publish release
122
+ if: startsWith(github.ref, 'refs/tags/v')
123
+ needs: build_wheels
124
+ runs-on: ubuntu-latest
125
+ permissions:
126
+ contents: write
127
+ id-token: write
128
+ steps:
129
+ - uses: actions/checkout@v7
130
+ - name: Download distributables
131
+ uses: actions/download-artifact@v8
132
+ with:
133
+ pattern: dist-*
134
+ path: dist
135
+ merge-multiple: true
136
+ - name: Create GitHub release
137
+ env:
138
+ GH_TOKEN: ${{ github.token }}
139
+ run: gh release create ${{ github.ref_name }} dist/* --title ${{ github.ref_name }} --generate-notes
140
+ - name: Publish to PyPI
141
+ uses: pypa/gh-action-pypi-publish@release/v1
142
+ with:
143
+ packages-dir: dist
144
+ skip-existing: true
@@ -0,0 +1,6 @@
1
+ /target
2
+ *.pyc
3
+ **/.DS_Store
4
+ .DS_Store
5
+ *.so
6
+ *.dylib