pyamtrack 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,11 @@
1
+ # To get started with Dependabot version updates, you'll need to specify which
2
+ # package ecosystems to update and where the package manifests are located.
3
+ # Please see the documentation for all configuration options:
4
+ # https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
5
+
6
+ version: 2
7
+ updates:
8
+ - package-ecosystem: "github-actions" # See documentation for possible values
9
+ directory: "/" # Location of package manifests
10
+ schedule:
11
+ interval: "weekly"
@@ -0,0 +1,42 @@
1
+ name: "CodeQL Advanced"
2
+
3
+ on:
4
+ push:
5
+ branches: [ "master" ]
6
+ schedule:
7
+ - cron: '26 15 * * 2'
8
+
9
+ jobs:
10
+ analyze:
11
+ name: Analyze (${{ matrix.language }})
12
+ runs-on: 'ubuntu-latest'
13
+ permissions:
14
+ security-events: write
15
+ packages: read
16
+ actions: read
17
+ contents: read
18
+
19
+ strategy:
20
+ fail-fast: false
21
+ matrix:
22
+ include:
23
+ - language: actions
24
+ build-mode: none
25
+ - language: c-cpp
26
+ build-mode: autobuild
27
+ - language: python
28
+ build-mode: none
29
+ steps:
30
+ - name: Checkout repository
31
+ uses: actions/checkout@v4
32
+
33
+ - name: Initialize CodeQL
34
+ uses: github/codeql-action/init@v3
35
+ with:
36
+ languages: ${{ matrix.language }}
37
+ build-mode: ${{ matrix.build-mode }}
38
+
39
+ - name: Perform CodeQL Analysis
40
+ uses: github/codeql-action/analyze@v3
41
+ with:
42
+ category: "/language:${{matrix.language}}"
@@ -0,0 +1,45 @@
1
+ name: Linux Build & Test
2
+ permissions:
3
+ contents: read
4
+ pull-requests: write
5
+
6
+ on:
7
+ workflow_call:
8
+ # (Add inputs if needed later)
9
+
10
+ jobs:
11
+ build_and_test_linux:
12
+ runs-on: ubuntu-latest
13
+ outputs:
14
+ linux_status: ${{ job.status }}
15
+ steps:
16
+ - uses: actions/checkout@v4
17
+ with:
18
+ fetch-depth: 0
19
+
20
+ - name: Install system packages
21
+ run: sudo apt-get install -y --no-install-recommends libgsl-dev python3-pip python3-venv
22
+
23
+ - name: Install Python build tools
24
+ run: pip install --upgrade build
25
+
26
+ - name: Build Python Wheel
27
+ run: python -m build
28
+
29
+ - name: Install and Test Python Wheel
30
+ run: |
31
+ python3 -m venv testenv
32
+ source testenv/bin/activate
33
+ pip install dist/*.whl
34
+ pip show -f pyamtrack
35
+ python -c "import pyamtrack; print(pyamtrack.__doc__); print(dir(pyamtrack)); print(pyamtrack.calculate_velocity(2));"
36
+ python -c "import pyamtrack; print(pyamtrack.beta_from_energy(150));"
37
+ python -c "import pyamtrack; print(pyamtrack.electron_range(150));"
38
+
39
+ - name: Upload Linux Artifacts
40
+ uses: actions/upload-artifact@v4
41
+ with:
42
+ name: libamtrack-linux
43
+ path: dist/*.whl
44
+ if-no-files-found: error
45
+ retention-days: 5
@@ -0,0 +1,49 @@
1
+ name: macOS Build & Test
2
+ permissions:
3
+ contents: read
4
+ pull-requests: write
5
+
6
+ on:
7
+ workflow_call:
8
+ inputs:
9
+ linux_status:
10
+ description: 'Status of the Linux Build job'
11
+ required: true
12
+ type: string
13
+
14
+ jobs:
15
+ build_and_test_macos:
16
+ runs-on: macos-latest
17
+ outputs:
18
+ macos_status: ${{ job.status }}
19
+ steps:
20
+ - uses: actions/checkout@v4
21
+ with:
22
+ fetch-depth: 0
23
+
24
+ - name: Install system packages
25
+ run: brew install gsl
26
+
27
+ - name: Install Python dependencies
28
+ run: pip install --upgrade build
29
+
30
+ - name: Build MacOS Wheel
31
+ run: python -m build
32
+
33
+ - name: Test Wheel Installation
34
+ run: |
35
+ python3 -m venv venv
36
+ source venv/bin/activate
37
+ pip install dist/*.whl
38
+ pip show -f pyamtrack
39
+ python -c "import pyamtrack; print(pyamtrack.__doc__); print(dir(pyamtrack)); print(pyamtrack.calculate_velocity(2));"
40
+ python -c "import pyamtrack; print(pyamtrack.beta_from_energy(150));"
41
+ python -c "import pyamtrack; print(pyamtrack.electron_range(150));"
42
+
43
+ - name: Upload macOS Artifact
44
+ uses: actions/upload-artifact@v4
45
+ with:
46
+ name: libamtrack-macos
47
+ path: dist/*.whl
48
+ if-no-files-found: error
49
+ retention-days: 5
@@ -0,0 +1,38 @@
1
+ name: CI Pipeline
2
+ permissions:
3
+ contents: read
4
+ pull-requests: write
5
+
6
+ concurrency:
7
+ group: ${{ github.workflow }}-${{ github.ref }}
8
+ cancel-in-progress: true
9
+
10
+ on:
11
+ push:
12
+ branches: [ master ]
13
+ tags: ['v*']
14
+ pull_request:
15
+ branches: [ master ]
16
+ release:
17
+ types: [published]
18
+
19
+ jobs:
20
+ build_and_test_linux:
21
+ name: Linux Build & Test
22
+ uses: ./.github/workflows/linux-reusable.yml
23
+
24
+ build_and_test_macos:
25
+ name: macOS Build & Test
26
+ needs: build_and_test_linux
27
+ if: ${{ needs.build_and_test_linux.result == 'success' }}
28
+ uses: ./.github/workflows/macos-reusable.yml
29
+ with:
30
+ linux_status: ${{ needs.build_and_test_linux.result }}
31
+
32
+ build_and_test_windows:
33
+ name: Windows Build & Test
34
+ needs: build_and_test_linux
35
+ if: ${{ needs.build_and_test_linux.result == 'success' }}
36
+ uses: ./.github/workflows/windows-reusable.yml
37
+ with:
38
+ linux_status: ${{ needs.build_and_test_linux.result }}
@@ -0,0 +1,100 @@
1
+ name: Wheels
2
+ permissions:
3
+ contents: read
4
+ pull-requests: write
5
+
6
+ on:
7
+ workflow_dispatch:
8
+ push:
9
+ branches:
10
+ - master
11
+ release:
12
+ types:
13
+ - published
14
+ schedule:
15
+ - cron: '46 18 * * 2'
16
+
17
+ env:
18
+ FORCE_COLOR: 3
19
+
20
+ concurrency:
21
+ group: ${{ github.workflow }}-${{ github.ref }}
22
+ cancel-in-progress: true
23
+
24
+ jobs:
25
+ build_sdist:
26
+ name: Build SDist
27
+ runs-on: ubuntu-latest
28
+ steps:
29
+ - uses: actions/checkout@v4
30
+ with:
31
+ submodules: true
32
+
33
+ - name: Build SDist
34
+ run: pipx run build --sdist
35
+
36
+ - name: Check metadata
37
+ run: pipx run twine check dist/*
38
+
39
+ - uses: actions/upload-artifact@v4
40
+ with:
41
+ name: cibw-sdist
42
+ path: dist/*.tar.gz
43
+
44
+
45
+ build_wheels:
46
+ name: Wheels on ${{ matrix.os }}
47
+ runs-on: ${{ matrix.os }}
48
+ strategy:
49
+ fail-fast: false
50
+ matrix:
51
+ os: [ubuntu-latest]
52
+
53
+ steps:
54
+ - uses: actions/checkout@v4
55
+ with:
56
+ submodules: true
57
+
58
+ - uses: astral-sh/setup-uv@v4
59
+
60
+ - uses: pypa/cibuildwheel@v2.22
61
+
62
+ - name: Verify clean directory
63
+ run: git diff --exit-code
64
+ shell: bash
65
+
66
+ - uses: actions/upload-artifact@v4
67
+ with:
68
+ name: cibw-wheels-${{ matrix.os }}
69
+ path: wheelhouse/*.whl
70
+
71
+
72
+ upload_all:
73
+ name: Upload if release
74
+ needs: [build_wheels, build_sdist]
75
+ runs-on: ubuntu-latest
76
+ if: github.event_name == 'release' && github.event.action == 'published'
77
+ environment: pypi
78
+ permissions:
79
+ id-token: write
80
+ attestations: write
81
+
82
+ steps:
83
+ - uses: actions/setup-python@v5
84
+ with:
85
+ python-version: "3.x"
86
+
87
+ - uses: actions/download-artifact@v4
88
+ with:
89
+ pattern: cibw-*
90
+ merge-multiple: true
91
+ path: dist
92
+
93
+ - name: Generate artifact attestation for sdist and wheels
94
+ uses: actions/attest-build-provenance@v1
95
+ with:
96
+ subject-path: "dist/*"
97
+
98
+ - uses: pypa/gh-action-pypi-publish@release/v1
99
+ with:
100
+ attestations: true
@@ -0,0 +1,106 @@
1
+ name: Windows Build & Test
2
+ permissions:
3
+ contents: read
4
+ pull-requests: write
5
+
6
+ on:
7
+ workflow_call:
8
+ inputs:
9
+ linux_status:
10
+ description: 'Status of the Linux Build job'
11
+ required: true
12
+ type: string
13
+
14
+ jobs:
15
+ build_and_test_windows:
16
+ runs-on: windows-latest
17
+ if: ${{ inputs.linux_status == 'success' }}
18
+ steps:
19
+ - uses: actions/checkout@v4
20
+ with:
21
+ fetch-depth: 0
22
+
23
+ - name: Create vcpkg and build directories
24
+ run: |
25
+ mkdir -Force "${{ github.workspace }}/vcpkg_cache"
26
+ mkdir -Force "${{ github.workspace }}/vcpkg_installed"
27
+ mkdir -Force build
28
+ shell: pwsh
29
+
30
+ - name: Restore vcpkg cache
31
+ id: cache-vcpkg
32
+ uses: actions/cache@v4
33
+ with:
34
+ path: vcpkg
35
+ key: vcpkg-${{ runner.os }}-${{ hashFiles('vcpkg.json') }}
36
+ restore-keys: vcpkg-${{ runner.os }}-
37
+
38
+ - name: Install vcpkg
39
+ if: steps.cache-vcpkg.outputs.cache-hit != 'true'
40
+ run: |
41
+ git clone --depth 1 https://github.com/microsoft/vcpkg
42
+ .\vcpkg\bootstrap-vcpkg.bat -disableMetrics
43
+ shell: pwsh
44
+
45
+ - name: Restore vcpkg deps cache
46
+ id: cache-vcpkg-deps
47
+ uses: actions/cache@v4
48
+ with:
49
+ path: ${{ github.workspace }}/vcpkg_cache
50
+ key: vcpkg-deps-${{ runner.os }}-${{ hashFiles('vcpkg.json') }}
51
+ restore-keys: vcpkg-deps-${{ runner.os }}-
52
+
53
+ - name: Restore vcpkg installed cache
54
+ id: cache-vcpkg-installed
55
+ uses: actions/cache@v4
56
+ with:
57
+ path: ${{ github.workspace }}/vcpkg_installed
58
+ key: vcpkg-installed-${{ runner.os }}-${{ hashFiles('vcpkg.json') }}
59
+ restore-keys: vcpkg-installed-${{ runner.os }}-
60
+
61
+ - name: Create vcpkg directories if needed
62
+ if: steps.cache-vcpkg-deps.outputs.cache-hit != 'true' || steps.cache-vcpkg-installed.outputs.cache-hit != 'true'
63
+ run: |
64
+ mkdir -Force "${{ github.workspace }}/vcpkg_cache"
65
+ mkdir -Force "${{ github.workspace }}/vcpkg_installed"
66
+ shell: pwsh
67
+
68
+ - name: Install vcpkg dependencies
69
+ if: steps.cache-vcpkg-deps.outputs.cache-hit != 'true' || steps.cache-vcpkg-installed.outputs.cache-hit != 'true'
70
+ env:
71
+ VCPKG_DEFAULT_BINARY_CACHE: ${{ github.workspace }}/vcpkg_cache
72
+ VCPKG_INSTALLED_DIR: ${{ github.workspace }}/vcpkg_installed
73
+ run: .\vcpkg\vcpkg.exe install
74
+
75
+ - name: Install Python dependencies
76
+ run: pip install --upgrade build
77
+
78
+ - name: Build Windows Wheel
79
+ env:
80
+ VCPKG_INSTALLED_DIR: ${{ github.workspace }}/vcpkg_installed
81
+ run: python -m build
82
+
83
+ - name: Test Wheel Installation
84
+ shell: pwsh
85
+ run: |
86
+ python -m venv venv
87
+ .\venv\Scripts\Activate.ps1
88
+ # Find the first wheel file that matches the pattern in the dist folder.
89
+ $wheel = Get-ChildItem -Path "dist\pyamtrack-*.whl" | Select-Object -First 1
90
+ if (-not $wheel) {
91
+ Write-Error "No wheel file matching 'dist\pyamtrack-*.whl' found!"
92
+ } else {
93
+ pip install $wheel.FullName
94
+ }
95
+ pip show -f pyamtrack
96
+ python -c "import pyamtrack; print(pyamtrack.__doc__); print(dir(pyamtrack)); print(pyamtrack.calculate_velocity(2));"
97
+ python -c "import pyamtrack; print(pyamtrack.beta_from_energy(150));"
98
+ python -c "import pyamtrack; print(pyamtrack.electron_range(150));"
99
+
100
+ - name: Upload Windows Artifact
101
+ uses: actions/upload-artifact@v4
102
+ with:
103
+ name: libamtrack-windows
104
+ path: dist/*.whl
105
+ if-no-files-found: error
106
+ retention-days: 5
@@ -0,0 +1,271 @@
1
+ # Created by https://www.toptal.com/developers/gitignore/api/python,c,cmake,visualstudiocode
2
+ # Edit at https://www.toptal.com/developers/gitignore?templates=python,c,cmake,visualstudiocode
3
+
4
+ ### C ###
5
+ # Prerequisites
6
+ *.d
7
+
8
+ # Object files
9
+ *.o
10
+ *.ko
11
+ *.obj
12
+ *.elf
13
+
14
+ # Linker output
15
+ *.ilk
16
+ *.map
17
+ *.exp
18
+
19
+ # Precompiled Headers
20
+ *.gch
21
+ *.pch
22
+
23
+ # Libraries
24
+ *.lib
25
+ *.a
26
+ *.la
27
+ *.lo
28
+
29
+ # Shared objects (inc. Windows DLLs)
30
+ *.dll
31
+ *.so
32
+ *.so.*
33
+ *.dylib
34
+
35
+ # Executables
36
+ *.exe
37
+ *.out
38
+ *.app
39
+ *.i*86
40
+ *.x86_64
41
+ *.hex
42
+
43
+ # Debug files
44
+ *.dSYM/
45
+ *.su
46
+ *.idb
47
+ *.pdb
48
+
49
+ # Kernel Module Compile Results
50
+ *.mod*
51
+ *.cmd
52
+ .tmp_versions/
53
+ modules.order
54
+ Module.symvers
55
+ Mkfile.old
56
+ dkms.conf
57
+
58
+ ### CMake ###
59
+ CMakeLists.txt.user
60
+ CMakeCache.txt
61
+ CMakeFiles
62
+ CMakeScripts
63
+ Testing
64
+ Makefile
65
+ cmake_install.cmake
66
+ install_manifest.txt
67
+ compile_commands.json
68
+ CTestTestfile.cmake
69
+ _deps
70
+
71
+ ### CMake Patch ###
72
+ CMakeUserPresets.json
73
+
74
+ # External projects
75
+ *-prefix/
76
+
77
+ ### Python ###
78
+ # Byte-compiled / optimized / DLL files
79
+ __pycache__/
80
+ *.py[cod]
81
+ *$py.class
82
+
83
+ # C extensions
84
+
85
+ # Distribution / packaging
86
+ .Python
87
+ build/
88
+ develop-eggs/
89
+ dist/
90
+ downloads/
91
+ eggs/
92
+ .eggs/
93
+ lib/
94
+ lib64/
95
+ parts/
96
+ sdist/
97
+ var/
98
+ wheels/
99
+ share/python-wheels/
100
+ *.egg-info/
101
+ .installed.cfg
102
+ *.egg
103
+ MANIFEST
104
+
105
+ # PyInstaller
106
+ # Usually these files are written by a python script from a template
107
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
108
+ *.manifest
109
+ *.spec
110
+
111
+ # Installer logs
112
+ pip-log.txt
113
+ pip-delete-this-directory.txt
114
+
115
+ # Unit test / coverage reports
116
+ htmlcov/
117
+ .tox/
118
+ .nox/
119
+ .coverage
120
+ .coverage.*
121
+ .cache
122
+ nosetests.xml
123
+ coverage.xml
124
+ *.cover
125
+ *.py,cover
126
+ .hypothesis/
127
+ .pytest_cache/
128
+ cover/
129
+
130
+ # Translations
131
+ *.mo
132
+ *.pot
133
+
134
+ # Django stuff:
135
+ *.log
136
+ local_settings.py
137
+ db.sqlite3
138
+ db.sqlite3-journal
139
+
140
+ # Flask stuff:
141
+ instance/
142
+ .webassets-cache
143
+
144
+ # Scrapy stuff:
145
+ .scrapy
146
+
147
+ # Sphinx documentation
148
+ docs/_build/
149
+
150
+ # PyBuilder
151
+ .pybuilder/
152
+ target/
153
+
154
+ # Jupyter Notebook
155
+ .ipynb_checkpoints
156
+
157
+ # IPython
158
+ profile_default/
159
+ ipython_config.py
160
+
161
+ # pyenv
162
+ # For a library or package, you might want to ignore these files since the code is
163
+ # intended to run in multiple environments; otherwise, check them in:
164
+ # .python-version
165
+
166
+ # pipenv
167
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
168
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
169
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
170
+ # install all needed dependencies.
171
+ #Pipfile.lock
172
+
173
+ # poetry
174
+ # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
175
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
176
+ # commonly ignored for libraries.
177
+ # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
178
+ #poetry.lock
179
+
180
+ # pdm
181
+ # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
182
+ #pdm.lock
183
+ # pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
184
+ # in version control.
185
+ # https://pdm.fming.dev/#use-with-ide
186
+ .pdm.toml
187
+
188
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
189
+ __pypackages__/
190
+
191
+ # Celery stuff
192
+ celerybeat-schedule
193
+ celerybeat.pid
194
+
195
+ # SageMath parsed files
196
+ *.sage.py
197
+
198
+ # Environments
199
+ .env
200
+ .venv
201
+ env/
202
+ venv/
203
+ ENV/
204
+ env.bak/
205
+ venv.bak/
206
+
207
+ # Spyder project settings
208
+ .spyderproject
209
+ .spyproject
210
+
211
+ # Rope project settings
212
+ .ropeproject
213
+
214
+ # mkdocs documentation
215
+ /site
216
+
217
+ # mypy
218
+ .mypy_cache/
219
+ .dmypy.json
220
+ dmypy.json
221
+
222
+ # Pyre type checker
223
+ .pyre/
224
+
225
+ # pytype static type analyzer
226
+ .pytype/
227
+
228
+ # Cython debug symbols
229
+ cython_debug/
230
+
231
+ # PyCharm
232
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
233
+ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
234
+ # and can be added to the global gitignore or merged into this file. For a more nuclear
235
+ # option (not recommended) you can uncomment the following to ignore the entire idea folder.
236
+ #.idea/
237
+
238
+ ### Python Patch ###
239
+ # Poetry local configuration file - https://python-poetry.org/docs/configuration/#local-configuration
240
+ poetry.toml
241
+
242
+ # ruff
243
+ .ruff_cache/
244
+
245
+ # LSP config files
246
+ pyrightconfig.json
247
+
248
+ ### VisualStudioCode ###
249
+ .vscode/*
250
+ !.vscode/settings.json
251
+ !.vscode/tasks.json
252
+ !.vscode/launch.json
253
+ !.vscode/extensions.json
254
+ !.vscode/*.code-snippets
255
+
256
+ # Local History for Visual Studio Code
257
+ .history/
258
+
259
+ # Built Visual Studio Code Extensions
260
+ *.vsix
261
+
262
+ ### VisualStudioCode Patch ###
263
+ # Ignore all local history of files
264
+ .history
265
+ .ionide
266
+
267
+ # End of https://www.toptal.com/developers/gitignore/api/python,c,cmake,visualstudiocode
268
+
269
+ vcpkg
270
+ vcpkg_installed
271
+ usr