polyxios 0.1.0.dev1__tar.gz → 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.
Files changed (168) hide show
  1. polyxios-0.3.0/.github/dependabot.yml +15 -0
  2. polyxios-0.3.0/.github/release.yml +14 -0
  3. polyxios-0.3.0/.github/workflows/build_docs.yml +207 -0
  4. polyxios-0.3.0/.github/workflows/check_format.yml +46 -0
  5. polyxios-0.3.0/.github/workflows/precommit_update.yml +26 -0
  6. polyxios-0.3.0/.github/workflows/release.yml +141 -0
  7. polyxios-0.3.0/.github/workflows/test.yml +58 -0
  8. {polyxios-0.1.0.dev1 → polyxios-0.3.0}/.gitignore +21 -3
  9. polyxios-0.3.0/.mailmap +11 -0
  10. polyxios-0.3.0/.pre-commit-config.yaml +37 -0
  11. {polyxios-0.1.0.dev1/polyxios → polyxios-0.3.0/.spin}/__init__.py +0 -0
  12. polyxios-0.3.0/.spin/cmds.py +667 -0
  13. polyxios-0.3.0/CHANGES.rst +175 -0
  14. {polyxios-0.1.0.dev1 → polyxios-0.3.0}/LICENSE +0 -0
  15. polyxios-0.3.0/PKG-INFO +288 -0
  16. polyxios-0.3.0/README.md +232 -0
  17. polyxios-0.3.0/docs/HANDOFF.md +353 -0
  18. polyxios-0.3.0/docs/Makefile +18 -0
  19. polyxios-0.3.0/docs/_ext/contributors.py +140 -0
  20. polyxios-0.3.0/docs/_ext/seo.py +320 -0
  21. polyxios-0.3.0/docs/_includes/formats_grid.html +261 -0
  22. polyxios-0.3.0/docs/_includes/homepage.html +211 -0
  23. polyxios-0.3.0/docs/_static/css/retro.css +800 -0
  24. polyxios-0.3.0/docs/_static/js/homepage.js +150 -0
  25. polyxios-0.3.0/docs/_templates/navbar-nav.html +22 -0
  26. polyxios-0.3.0/docs/_templates/py-version.html +2 -0
  27. polyxios-0.3.0/docs/_templates/sidebar-nav-bs.html +25 -0
  28. polyxios-0.3.0/docs/api/index.rst +13 -0
  29. polyxios-0.3.0/docs/changelog.rst +3 -0
  30. polyxios-0.3.0/docs/cli.rst +57 -0
  31. polyxios-0.3.0/docs/conf.py +214 -0
  32. polyxios-0.3.0/docs/contributing.rst +62 -0
  33. polyxios-0.3.0/docs/credits.rst +52 -0
  34. polyxios-0.3.0/docs/development.rst +196 -0
  35. polyxios-0.3.0/docs/formats/abaqus.rst +68 -0
  36. polyxios-0.3.0/docs/formats/avs.rst +68 -0
  37. polyxios-0.3.0/docs/formats/dolfin.rst +70 -0
  38. polyxios-0.3.0/docs/formats/flac3d.rst +68 -0
  39. polyxios-0.3.0/docs/formats/gmsh.rst +68 -0
  40. polyxios-0.3.0/docs/formats/index.rst +57 -0
  41. polyxios-0.3.0/docs/formats/meshb.rst +76 -0
  42. polyxios-0.3.0/docs/formats/mfem.rst +71 -0
  43. polyxios-0.3.0/docs/formats/nastran.rst +82 -0
  44. polyxios-0.3.0/docs/formats/netgen.rst +83 -0
  45. polyxios-0.3.0/docs/formats/obj.rst +68 -0
  46. polyxios-0.3.0/docs/formats/off.rst +68 -0
  47. polyxios-0.3.0/docs/formats/ply.rst +91 -0
  48. polyxios-0.3.0/docs/formats/splat.rst +74 -0
  49. polyxios-0.3.0/docs/formats/stl.rst +86 -0
  50. polyxios-0.3.0/docs/formats/su2.rst +68 -0
  51. polyxios-0.3.0/docs/formats/tecplot.rst +70 -0
  52. polyxios-0.3.0/docs/formats/tetgen.rst +70 -0
  53. polyxios-0.3.0/docs/formats/ugrid.rst +79 -0
  54. polyxios-0.3.0/docs/formats/vti.rst +78 -0
  55. polyxios-0.3.0/docs/formats/vtk.rst +86 -0
  56. polyxios-0.3.0/docs/formats/vtp.rst +67 -0
  57. polyxios-0.3.0/docs/formats/vtr.rst +67 -0
  58. polyxios-0.3.0/docs/formats/vts.rst +78 -0
  59. polyxios-0.3.0/docs/formats/vtu.rst +80 -0
  60. polyxios-0.3.0/docs/formats/wkt.rst +68 -0
  61. polyxios-0.3.0/docs/index.rst +29 -0
  62. polyxios-0.3.0/docs/installation.rst +36 -0
  63. polyxios-0.3.0/docs/lazy_loading.rst +30 -0
  64. polyxios-0.3.0/docs/plugins.rst +51 -0
  65. polyxios-0.3.0/docs/requirements.txt +6 -0
  66. polyxios-0.3.0/docs/transforms.rst +25 -0
  67. polyxios-0.3.0/docs/usage.rst +44 -0
  68. polyxios-0.3.0/examples/read_multiblock_vtp.py +98 -0
  69. polyxios-0.3.0/examples/read_parallel_vtk.py +266 -0
  70. polyxios-0.3.0/examples/render_fetched_model.py +33 -0
  71. polyxios-0.3.0/examples/visualize_mesh.py +129 -0
  72. polyxios-0.3.0/meson.build +20 -0
  73. polyxios-0.3.0/polyxios/__init__.py +100 -0
  74. polyxios-0.3.0/polyxios/_backend.py +30 -0
  75. polyxios-0.3.0/polyxios/_core.pxd +12 -0
  76. polyxios-0.3.0/polyxios/_core.pyx +138 -0
  77. polyxios-0.3.0/polyxios/_core_fallback.py +89 -0
  78. polyxios-0.3.0/polyxios/_element_types.py +237 -0
  79. polyxios-0.3.0/polyxios/_registry.py +133 -0
  80. polyxios-0.3.0/polyxios/_types.py +197 -0
  81. polyxios-0.3.0/polyxios/cli.py +428 -0
  82. polyxios-0.3.0/polyxios/codecs/__init__.py +0 -0
  83. polyxios-0.3.0/polyxios/codecs/_abaqus.py +243 -0
  84. polyxios-0.3.0/polyxios/codecs/_avs.py +209 -0
  85. polyxios-0.3.0/polyxios/codecs/_dolfin.py +230 -0
  86. polyxios-0.3.0/polyxios/codecs/_flac3d.py +782 -0
  87. polyxios-0.3.0/polyxios/codecs/_gmsh.py +919 -0
  88. polyxios-0.3.0/polyxios/codecs/_mesh.py +687 -0
  89. polyxios-0.3.0/polyxios/codecs/_meshb.py +360 -0
  90. polyxios-0.3.0/polyxios/codecs/_nastran.py +1158 -0
  91. polyxios-0.3.0/polyxios/codecs/_netgen.py +1265 -0
  92. polyxios-0.3.0/polyxios/codecs/_obj.py +269 -0
  93. polyxios-0.3.0/polyxios/codecs/_off.py +974 -0
  94. polyxios-0.3.0/polyxios/codecs/_ply.py +722 -0
  95. polyxios-0.3.0/polyxios/codecs/_pvti.py +44 -0
  96. polyxios-0.3.0/polyxios/codecs/_pvtp.py +44 -0
  97. polyxios-0.3.0/polyxios/codecs/_pvtr.py +44 -0
  98. polyxios-0.3.0/polyxios/codecs/_pvts.py +44 -0
  99. polyxios-0.3.0/polyxios/codecs/_pvtu.py +44 -0
  100. polyxios-0.3.0/polyxios/codecs/_splat.py +131 -0
  101. polyxios-0.3.0/polyxios/codecs/_stl.py +389 -0
  102. polyxios-0.3.0/polyxios/codecs/_su2.py +876 -0
  103. polyxios-0.3.0/polyxios/codecs/_tecplot.py +798 -0
  104. polyxios-0.3.0/polyxios/codecs/_tetgen.py +843 -0
  105. polyxios-0.3.0/polyxios/codecs/_ugrid.py +713 -0
  106. polyxios-0.3.0/polyxios/codecs/_vti.py +229 -0
  107. polyxios-0.3.0/polyxios/codecs/_vtk.py +1869 -0
  108. polyxios-0.3.0/polyxios/codecs/_vtk_parse.pyx +94 -0
  109. polyxios-0.3.0/polyxios/codecs/_vtk_xml.py +316 -0
  110. polyxios-0.3.0/polyxios/codecs/_vtm.py +44 -0
  111. polyxios-0.3.0/polyxios/codecs/_vtp.py +281 -0
  112. polyxios-0.3.0/polyxios/codecs/_vtp_base64.pyx +37 -0
  113. polyxios-0.3.0/polyxios/codecs/_vtr.py +227 -0
  114. polyxios-0.3.0/polyxios/codecs/_vts.py +219 -0
  115. polyxios-0.3.0/polyxios/codecs/_vtu.py +265 -0
  116. polyxios-0.3.0/polyxios/codecs/_wkt.py +956 -0
  117. polyxios-0.3.0/polyxios/codecs/meson.build +56 -0
  118. polyxios-0.3.0/polyxios/exceptions.py +50 -0
  119. polyxios-0.3.0/polyxios/fetcher.py +734 -0
  120. polyxios-0.3.0/polyxios/helper.py +300 -0
  121. polyxios-0.3.0/polyxios/meson.build +51 -0
  122. polyxios-0.3.0/polyxios/transforms.py +569 -0
  123. polyxios-0.3.0/polyxios/validate.py +149 -0
  124. polyxios-0.3.0/polyxios/version.py +9 -0
  125. polyxios-0.3.0/pyproject.toml +106 -0
  126. polyxios-0.3.0/tests/__init__.py +0 -0
  127. polyxios-0.3.0/tests/codecs/__init__.py +0 -0
  128. polyxios-0.3.0/tests/codecs/test_abaqus.py +142 -0
  129. polyxios-0.3.0/tests/codecs/test_avs.py +167 -0
  130. polyxios-0.3.0/tests/codecs/test_dolfin.py +224 -0
  131. polyxios-0.3.0/tests/codecs/test_flac3d.py +1181 -0
  132. polyxios-0.3.0/tests/codecs/test_gmsh.py +781 -0
  133. polyxios-0.3.0/tests/codecs/test_inline_models.py +341 -0
  134. polyxios-0.3.0/tests/codecs/test_mesh.py +220 -0
  135. polyxios-0.3.0/tests/codecs/test_meshb.py +148 -0
  136. polyxios-0.3.0/tests/codecs/test_nastran.py +1265 -0
  137. polyxios-0.3.0/tests/codecs/test_netgen.py +1280 -0
  138. polyxios-0.3.0/tests/codecs/test_obj.py +83 -0
  139. polyxios-0.3.0/tests/codecs/test_off.py +923 -0
  140. polyxios-0.3.0/tests/codecs/test_ply.py +180 -0
  141. polyxios-0.3.0/tests/codecs/test_splat.py +111 -0
  142. polyxios-0.3.0/tests/codecs/test_stl.py +228 -0
  143. polyxios-0.3.0/tests/codecs/test_su2.py +742 -0
  144. polyxios-0.3.0/tests/codecs/test_tecplot.py +944 -0
  145. polyxios-0.3.0/tests/codecs/test_tetgen.py +676 -0
  146. polyxios-0.3.0/tests/codecs/test_ugrid.py +588 -0
  147. polyxios-0.3.0/tests/codecs/test_vti.py +109 -0
  148. polyxios-0.3.0/tests/codecs/test_vtk.py +411 -0
  149. polyxios-0.3.0/tests/codecs/test_vtk_meta.py +99 -0
  150. polyxios-0.3.0/tests/codecs/test_vtp.py +91 -0
  151. polyxios-0.3.0/tests/codecs/test_vtr.py +104 -0
  152. polyxios-0.3.0/tests/codecs/test_vts.py +100 -0
  153. polyxios-0.3.0/tests/codecs/test_vtu.py +100 -0
  154. polyxios-0.3.0/tests/codecs/test_wkt.py +933 -0
  155. polyxios-0.3.0/tests/test_cli.py +582 -0
  156. polyxios-0.3.0/tests/test_fetcher.py +375 -0
  157. polyxios-0.3.0/tests/test_helper.py +162 -0
  158. polyxios-0.3.0/tests/test_registry.py +111 -0
  159. polyxios-0.3.0/tests/test_transforms.py +258 -0
  160. polyxios-0.3.0/tests/test_validate.py +68 -0
  161. polyxios-0.3.0/tests/test_validate_header.py +155 -0
  162. polyxios-0.3.0/tools/commit-msg.py +155 -0
  163. polyxios-0.3.0/tools/gen_switcher.py +284 -0
  164. polyxios-0.3.0/tools/github_stats.py +192 -0
  165. polyxios-0.3.0/tools/gitversion.py +86 -0
  166. polyxios-0.1.0.dev1/PKG-INFO +0 -36
  167. polyxios-0.1.0.dev1/README.md +0 -1
  168. polyxios-0.1.0.dev1/pyproject.toml +0 -10
@@ -0,0 +1,15 @@
1
+ # Set update schedule for GitHub Actions
2
+
3
+ version: 2
4
+ updates:
5
+
6
+ - package-ecosystem: "github-actions"
7
+ directory: "/"
8
+ schedule:
9
+ interval: "weekly"
10
+ commit-message:
11
+ prefix: "MNT"
12
+ groups:
13
+ actions:
14
+ patterns:
15
+ - "*"
@@ -0,0 +1,14 @@
1
+ changelog:
2
+ categories:
3
+ - title: Breaking changes
4
+ labels: [breaking]
5
+ - title: New features
6
+ labels: [enhancement, feature, new]
7
+ - title: Bug fixes
8
+ labels: [bug, fix, regression]
9
+ - title: Documentation
10
+ labels: [documentation, docs]
11
+ - title: Maintenance
12
+ labels: [maintenance, dependencies, ci, refactor]
13
+ - title: Other changes
14
+ labels: ['*']
@@ -0,0 +1,207 @@
1
+ name: Build Docs
2
+
3
+ on:
4
+ push:
5
+ branches: [master]
6
+ # Releases publish /X.Y/ and /stable/ from the tag itself. The `release`
7
+ # event below never fires for us: release.yml creates the GitHub release
8
+ # with GITHUB_TOKEN, and GitHub refuses to start new workflow runs from
9
+ # events raised by that token. The tag push is the trigger that works.
10
+ tags: ['v[0-9]*']
11
+ pull_request:
12
+ branches: [master]
13
+ release:
14
+ types: [published]
15
+ workflow_dispatch:
16
+ inputs:
17
+ tag:
18
+ description: 'Tag to publish as a release version (blank = build dev)'
19
+ required: false
20
+ default: ''
21
+
22
+ permissions:
23
+ contents: read
24
+
25
+ # One deploy at a time: two jobs pushing to gh-pages would race on the same
26
+ # branch. A running deploy is never cancelled - a half-pushed site is worse
27
+ # than a slow one - but redundant PR builds are.
28
+ concurrency:
29
+ group: docs-${{ github.ref }}
30
+ cancel-in-progress: ${{ github.event_name == 'pull_request' }}
31
+
32
+ jobs:
33
+ build:
34
+ runs-on: ubuntu-latest
35
+ timeout-minutes: 30
36
+
37
+ outputs:
38
+ target: ${{ steps.target.outputs.dir }}
39
+ is_release: ${{ steps.target.outputs.is_release }}
40
+
41
+ steps:
42
+ - uses: actions/checkout@v7
43
+ with:
44
+ # A manual run naming a tag builds that tag, not the branch it was
45
+ # dispatched from; every other event already points at the right ref.
46
+ ref: ${{ inputs.tag || github.ref }}
47
+ # Full history: docs/_ext/contributors.py builds the credits page
48
+ # from `git shortlog`, and a shallow clone would truncate it.
49
+ fetch-depth: 0
50
+
51
+ - uses: actions/setup-python@v7
52
+ with:
53
+ python-version: "3.12"
54
+
55
+ - name: Decide which version directory this build is
56
+ id: target
57
+ env:
58
+ # A tag reaches us three ways: the release event, a tag push, or a
59
+ # manual run with the tag typed in. Anything else is a dev build.
60
+ RELEASE_TAG: >-
61
+ ${{ github.event.release.tag_name
62
+ || inputs.tag
63
+ || (github.ref_type == 'tag' && github.ref_name)
64
+ || '' }}
65
+ run: |
66
+ set -euo pipefail
67
+ if [ -n "${RELEASE_TAG}" ]; then
68
+ series="$(printf '%s' "${RELEASE_TAG#v}" | cut -d. -f1,2)"
69
+ if ! printf '%s' "$series" | grep -Eq '^[0-9]+\.[0-9]+$'; then
70
+ echo "::error::tag '${RELEASE_TAG}' does not parse to an X.Y series"
71
+ exit 1
72
+ fi
73
+ echo "dir=$series" >> "$GITHUB_OUTPUT"
74
+ echo "switcher=$series" >> "$GITHUB_OUTPUT"
75
+ echo "is_release=true" >> "$GITHUB_OUTPUT"
76
+ # Only this build becomes /stable/, so only it may be indexed.
77
+ # Backfilling an old tag therefore overwrites /stable/ with that
78
+ # older copy - re-run the newest tag afterwards to put it back.
79
+ echo "is_stable=true" >> "$GITHUB_OUTPUT"
80
+ else
81
+ echo "dir=dev" >> "$GITHUB_OUTPUT"
82
+ echo "switcher=dev" >> "$GITHUB_OUTPUT"
83
+ echo "is_release=false" >> "$GITHUB_OUTPUT"
84
+ echo "is_stable=false" >> "$GITHUB_OUTPUT"
85
+ fi
86
+
87
+ - name: Install build dependencies
88
+ run: |
89
+ python -m pip install --upgrade pip
90
+ pip install "meson-python>=0.15" "Cython>=3.0" "numpy>=1.24" meson ninja
91
+
92
+ - name: Install polyxios with doc extras
93
+ run: pip install --no-build-isolation -e ".[doc]"
94
+
95
+ - name: Build documentation
96
+ env:
97
+ # Pins which switcher entry this build highlights, rather than
98
+ # letting conf.py infer it from the installed version.
99
+ SWITCHER_VERSION: ${{ steps.target.outputs.switcher }}
100
+ # Everything that is not the stable copy is built noindex, so the
101
+ # duplicate pages at /dev/ and /X.Y/ do not compete with /stable/.
102
+ DOCS_IS_STABLE: ${{ steps.target.outputs.is_stable }}
103
+ # The Makefile already builds with -W --keep-going, so this matches a
104
+ # local `make html` exactly.
105
+ run: make -C docs html
106
+
107
+ - name: Upload docs artifact
108
+ uses: actions/upload-artifact@v7
109
+ with:
110
+ name: docs-html
111
+ path: docs/_build/html/
112
+ retention-days: 7
113
+
114
+ deploy:
115
+ # Pull requests build but never publish: they can run from forks without
116
+ # write access, and a PR preview would overwrite the live dev docs.
117
+ if: github.event_name != 'pull_request'
118
+ needs: build
119
+ runs-on: ubuntu-latest
120
+ timeout-minutes: 15
121
+
122
+ # `spin release` pushes master and the tag in one go, so two runs reach
123
+ # this job at once. The workflow-level group keys on the ref and would let
124
+ # them both through; this one is global, so they queue instead of racing
125
+ # to push gh-pages.
126
+ concurrency:
127
+ group: docs-deploy
128
+ cancel-in-progress: false
129
+
130
+ permissions:
131
+ contents: write
132
+
133
+ steps:
134
+ - uses: actions/checkout@v7
135
+ with:
136
+ path: src
137
+
138
+ - uses: actions/setup-python@v7
139
+ with:
140
+ python-version: "3.12"
141
+
142
+ - uses: actions/download-artifact@v8
143
+ with:
144
+ name: docs-html
145
+ path: html
146
+
147
+ - name: Check out gh-pages, creating it on first run
148
+ env:
149
+ REPO: ${{ github.repository }}
150
+ run: |
151
+ set -euo pipefail
152
+ if git ls-remote --exit-code --heads "https://github.com/${REPO}.git" gh-pages >/dev/null 2>&1; then
153
+ git clone --branch gh-pages --single-branch --depth 1 \
154
+ "https://github.com/${REPO}.git" site
155
+ else
156
+ echo "gh-pages does not exist yet, creating it"
157
+ git clone --depth 1 "https://github.com/${REPO}.git" site
158
+ cd site
159
+ git checkout --orphan gh-pages
160
+ git rm -rq --cached . || true
161
+ find . -mindepth 1 -maxdepth 1 -not -name .git -exec rm -rf {} +
162
+ fi
163
+
164
+ - name: Place this build under its version directory
165
+ env:
166
+ TARGET: ${{ needs.build.outputs.target }}
167
+ IS_RELEASE: ${{ needs.build.outputs.is_release }}
168
+ run: |
169
+ set -euo pipefail
170
+ rm -rf "site/${TARGET}"
171
+ mkdir -p "site/${TARGET}"
172
+ cp -a html/. "site/${TARGET}/"
173
+
174
+ # A release is also served from /stable/, which is the URL worth
175
+ # linking to because it survives the next release.
176
+ if [ "${IS_RELEASE}" = "true" ]; then
177
+ rm -rf site/stable
178
+ mkdir -p site/stable
179
+ cp -a html/. site/stable/
180
+ fi
181
+
182
+ - name: Regenerate switcher.json and the root redirect
183
+ env:
184
+ # The custom domain, not the github.io address, which only 301s here.
185
+ # Canonical links, the sitemap and switcher.json must name the final
186
+ # URL. Keep in step with SITE_URL in docs/conf.py.
187
+ SITE_URL: https://polyxios.org
188
+ run: python src/tools/gen_switcher.py site --base-url "$SITE_URL"
189
+
190
+ - name: Commit and push
191
+ env:
192
+ GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
193
+ REPO: ${{ github.repository }}
194
+ SHA: ${{ github.sha }}
195
+ TARGET: ${{ needs.build.outputs.target }}
196
+ run: |
197
+ set -euo pipefail
198
+ cd site
199
+ git config user.name "github-actions[bot]"
200
+ git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
201
+ git add -A
202
+ if git diff --cached --quiet; then
203
+ echo "site unchanged, nothing to push"
204
+ exit 0
205
+ fi
206
+ git commit -m "DOC: publish ${TARGET} from ${SHA:0:7}"
207
+ git push "https://x-access-token:${GH_TOKEN}@github.com/${REPO}.git" gh-pages
@@ -0,0 +1,46 @@
1
+ name: Code Format
2
+
3
+ on:
4
+ push:
5
+ branches: [master]
6
+ pull_request:
7
+ branches: [master]
8
+
9
+ permissions:
10
+ contents: read
11
+
12
+ jobs:
13
+ pre-commit:
14
+ runs-on: ubuntu-latest
15
+ timeout-minutes: 10
16
+ steps:
17
+ - uses: actions/checkout@v7
18
+ with:
19
+ fetch-depth: 0
20
+
21
+ - uses: actions/setup-python@v7
22
+ with:
23
+ python-version: "3.12"
24
+
25
+ - uses: pre-commit/action@v3.0.1
26
+
27
+ commit-messages:
28
+ runs-on: ubuntu-latest
29
+ timeout-minutes: 5
30
+ if: github.event_name == 'pull_request'
31
+ steps:
32
+ - uses: actions/checkout@v7
33
+ with:
34
+ fetch-depth: 0
35
+
36
+ - uses: actions/setup-python@v7
37
+ with:
38
+ python-version: "3.12"
39
+
40
+ - name: Check commit messages
41
+ run: |
42
+ for sha in $(git log origin/${{ github.base_ref }}..HEAD --format=%H); do
43
+ git log -1 --format=%B "$sha" > /tmp/commit_msg
44
+ echo "Checking: $(git log -1 --format=%s $sha)"
45
+ python tools/commit-msg.py /tmp/commit_msg || exit 1
46
+ done
@@ -0,0 +1,26 @@
1
+ name: Pre-commit auto-update
2
+
3
+ on:
4
+ schedule:
5
+ - cron: "0 2 * * Mon" # weekly
6
+ workflow_dispatch:
7
+
8
+ jobs:
9
+ auto-update:
10
+ if: github.repository_owner == 'fury-gl'
11
+ runs-on: ubuntu-latest
12
+ steps:
13
+ - uses: actions/checkout@v7
14
+
15
+ - uses: actions/setup-python@v7
16
+
17
+ - uses: browniebroke/pre-commit-autoupdate-action@v1.0.1
18
+
19
+ - uses: peter-evans/create-pull-request@v8.1.1
20
+ if: always()
21
+ with:
22
+ token: ${{ secrets.GITHUB_TOKEN }}
23
+ branch: update/pre-commit-hooks
24
+ title: "MNT: update pre-commit hooks"
25
+ commit-message: "MNT: update pre-commit hooks"
26
+ body: Update versions of pre-commit hooks to latest.
@@ -0,0 +1,141 @@
1
+ name: Release
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - 'v[0-9]*'
7
+ workflow_dispatch:
8
+ inputs:
9
+ tag:
10
+ description: 'Tag name (use *-test suffix to skip PyPI)'
11
+ required: true
12
+ default: 'v0.0.0-test'
13
+
14
+ env:
15
+ RELEASE_TAG: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.tag || github.ref_name }}
16
+
17
+ concurrency:
18
+ group: release-${{ github.ref }}
19
+ cancel-in-progress: false
20
+
21
+ jobs:
22
+ build_wheels:
23
+ name: Wheels / ${{ matrix.os }}
24
+ runs-on: ${{ matrix.os }}
25
+ strategy:
26
+ fail-fast: false
27
+ matrix:
28
+ os: [ubuntu-latest, macos-latest, windows-latest]
29
+
30
+ steps:
31
+ - uses: actions/checkout@v7
32
+ with:
33
+ fetch-depth: 0
34
+
35
+ - name: Build wheels
36
+ uses: pypa/cibuildwheel@v4.2.0
37
+
38
+ - uses: actions/upload-artifact@v7
39
+ with:
40
+ name: dist-wheels-${{ matrix.os }}
41
+ path: wheelhouse/*.whl
42
+
43
+ build_sdist:
44
+ name: Source distribution
45
+ runs-on: ubuntu-latest
46
+
47
+ steps:
48
+ - uses: actions/checkout@v7
49
+ with:
50
+ fetch-depth: 0
51
+
52
+ - uses: actions/setup-python@v7
53
+ with:
54
+ python-version: '3.12'
55
+
56
+ - name: Build sdist
57
+ run: |
58
+ pip install build
59
+ python -m build --sdist
60
+
61
+ - uses: actions/upload-artifact@v7
62
+ with:
63
+ name: dist-sdist
64
+ path: dist/*.tar.gz
65
+
66
+ github_release:
67
+ name: GitHub Release
68
+ needs: [build_wheels, build_sdist]
69
+ runs-on: ubuntu-latest
70
+ permissions:
71
+ contents: write
72
+
73
+ steps:
74
+ - uses: actions/checkout@v7
75
+
76
+ - uses: actions/download-artifact@v8
77
+ with:
78
+ pattern: dist-*
79
+ merge-multiple: true
80
+ path: dist/
81
+
82
+ - name: Extract changelog section
83
+ id: changelog
84
+ run: |
85
+ python - <<'EOF'
86
+ import re, os, sys
87
+ tag = os.environ["TAG"].lstrip("v")
88
+ try:
89
+ with open("CHANGES.rst") as f:
90
+ content = f.read()
91
+ pattern = rf"(?ms)^{re.escape(tag)}[^\n]*\n[-]+\n(.*?)(?=\n\S[^\n]*\n[-]+|\Z)"
92
+ m = re.search(pattern, content)
93
+ notes = m.group(1).strip() if m else ""
94
+ except Exception:
95
+ notes = ""
96
+ with open(os.environ["GITHUB_OUTPUT"], "a") as fh:
97
+ print(f"notes<<EOF_NOTES\n{notes}\nEOF_NOTES", file=fh)
98
+ EOF
99
+ env:
100
+ TAG: ${{ env.RELEASE_TAG }}
101
+
102
+ - name: Create release
103
+ env:
104
+ GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
105
+ run: |
106
+ NOTES="${{ steps.changelog.outputs.notes }}"
107
+ if [ -n "$NOTES" ]; then
108
+ echo "$NOTES" > release_notes.md
109
+ echo "" >> release_notes.md
110
+ echo "---" >> release_notes.md
111
+ gh release create "${{ env.RELEASE_TAG }}" \
112
+ dist/* \
113
+ --title "polyxios ${{ env.RELEASE_TAG }}" \
114
+ --notes-file release_notes.md \
115
+ --generate-notes
116
+ else
117
+ gh release create "${{ env.RELEASE_TAG }}" \
118
+ dist/* \
119
+ --title "polyxios ${{ env.RELEASE_TAG }}" \
120
+ --generate-notes
121
+ fi
122
+
123
+ publish_pypi:
124
+ name: PyPI
125
+ needs: [github_release]
126
+ if: ${{ !contains(github.event_name == 'workflow_dispatch' && inputs.tag || github.ref_name, 'test') }}
127
+ runs-on: ubuntu-latest
128
+ environment:
129
+ name: pypi
130
+ url: https://pypi.org/project/polyxios/
131
+ permissions:
132
+ id-token: write
133
+
134
+ steps:
135
+ - uses: actions/download-artifact@v8
136
+ with:
137
+ pattern: dist-*
138
+ merge-multiple: true
139
+ path: dist/
140
+
141
+ - uses: pypa/gh-action-pypi-publish@release/v1
@@ -0,0 +1,58 @@
1
+ name: Tests
2
+
3
+ on:
4
+ push:
5
+ branches: [master]
6
+ pull_request:
7
+ branches: [master]
8
+ schedule:
9
+ - cron: "0 2 * * Mon" # weekly
10
+
11
+ concurrency:
12
+ group: test-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
13
+ cancel-in-progress: true
14
+
15
+ permissions:
16
+ contents: read
17
+
18
+ defaults:
19
+ run:
20
+ shell: bash
21
+
22
+ jobs:
23
+ test:
24
+ if: github.event_name != 'schedule' || github.repository_owner == 'fury-gl'
25
+ runs-on: ${{ matrix.os }}
26
+ timeout-minutes: 30
27
+ strategy:
28
+ fail-fast: false
29
+ matrix:
30
+ python-version: ["3.11", "3.12", "3.13"]
31
+ os: [ubuntu-latest, macos-latest, windows-latest]
32
+
33
+ steps:
34
+ - uses: actions/checkout@v7
35
+ with:
36
+ fetch-depth: 0
37
+
38
+ - name: Set up Python ${{ matrix.python-version }}
39
+ uses: actions/setup-python@v7
40
+ with:
41
+ python-version: ${{ matrix.python-version }}
42
+
43
+ - name: Install OpenMP (macOS)
44
+ if: runner.os == 'macOS'
45
+ run: |
46
+ brew install libomp
47
+ echo "CC=clang" >> "$GITHUB_ENV"
48
+
49
+ - name: Install build dependencies
50
+ run: |
51
+ python -m pip install --upgrade pip
52
+ pip install "meson-python>=0.15" "Cython>=3.0" "numpy>=1.24" meson ninja
53
+
54
+ - name: Install polyxios
55
+ run: pip install --no-build-isolation -e ".[dev]"
56
+
57
+ - name: Run tests
58
+ run: pytest tests/ -v --durations=10
@@ -71,6 +71,8 @@ instance/
71
71
 
72
72
  # Sphinx documentation
73
73
  docs/_build/
74
+ # generated at build time by docs/_ext/contributors.py
75
+ docs/_includes/contributors.rst
74
76
 
75
77
  # PyBuilder
76
78
  .pybuilder/
@@ -197,9 +199,9 @@ cython_debug/
197
199
  .abstra/
198
200
 
199
201
  # Visual Studio Code
200
- # Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
202
+ # Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
201
203
  # that can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore
202
- # and can be added to the global gitignore or merged into this file. However, if you prefer,
204
+ # and can be added to the global gitignore or merged into this file. However, if you prefer,
203
205
  # you could uncomment the following to ignore the entire vscode folder
204
206
  # .vscode/
205
207
  # Temporary file for partial code execution
@@ -208,6 +210,17 @@ tempCodeRunnerFile.py
208
210
  # Ruff stuff:
209
211
  .ruff_cache/
210
212
 
213
+ # Claude Code
214
+ CLAUDE.md
215
+ .claude/
216
+
217
+ # Auto-generated version file
218
+ polyxios/version.py
219
+
220
+ # Cython generated C files
221
+ *.c
222
+ *.cpp
223
+
211
224
  # PyPI configuration file
212
225
  .pypirc
213
226
 
@@ -217,4 +230,9 @@ marimo/_lsp/
217
230
  __marimo__/
218
231
 
219
232
  # Streamlit
220
- .streamlit/secrets.toml
233
+ .streamlit/secrets.toml
234
+ prompts/
235
+ tmp/
236
+ generated/
237
+ .vscode/
238
+ AGENTS.md
@@ -0,0 +1,11 @@
1
+ # Canonical name and address per contributor.
2
+ #
3
+ # git shortlog, git log and the generated credits page all honour this file, so
4
+ # one person committing under several addresses is counted once. Add a line
5
+ # here rather than editing the credits page when a duplicate shows up.
6
+ #
7
+ # Format: Canonical Name <canonical@email> Other Name <other@email>
8
+
9
+ Serge Koudoro <skab12@gmail.com> <23106443+skoudoro@users.noreply.github.com>
10
+ Serge Koudoro <skab12@gmail.com> skoudoro <skab12@gmail.com>
11
+ Praneeth Shetty <praneethshetty10@gmail.com> <64432063+ganimtron-10@users.noreply.github.com>
@@ -0,0 +1,37 @@
1
+ ci:
2
+ autoupdate_schedule: monthly
3
+
4
+ repos:
5
+ - repo: https://github.com/pre-commit/pre-commit-hooks
6
+ rev: v6.0.0
7
+ hooks:
8
+ - id: trailing-whitespace
9
+ - id: end-of-file-fixer
10
+ - id: mixed-line-ending
11
+ - id: check-yaml
12
+ - id: check-toml
13
+ - id: check-added-large-files
14
+ - id: check-case-conflict
15
+ - id: check-merge-conflict
16
+ - id: detect-private-key
17
+
18
+ - repo: https://github.com/astral-sh/ruff-pre-commit
19
+ rev: v0.16.3
20
+ hooks:
21
+ - id: ruff
22
+ args: [--fix, --show-fixes]
23
+ - id: ruff-format
24
+
25
+ - repo: https://github.com/codespell-project/codespell
26
+ rev: v2.4.3
27
+ hooks:
28
+ - id: codespell
29
+ additional_dependencies: [tomli]
30
+
31
+ - repo: local
32
+ hooks:
33
+ - id: polyxios-commit-msg
34
+ name: polyxios commit message
35
+ entry: python tools/commit-msg.py
36
+ language: python
37
+ stages: [commit-msg]