mdmodels-core 0.1.2__tar.gz → 0.1.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.
Files changed (112) hide show
  1. mdmodels_core-0.1.3/.github/scripts/generate_types.sh +34 -0
  2. mdmodels_core-0.1.3/.github/workflows/assets.yml +67 -0
  3. {mdmodels_core-0.1.2 → mdmodels_core-0.1.3}/.github/workflows/docs.yml +1 -0
  4. {mdmodels_core-0.1.2 → mdmodels_core-0.1.3}/.github/workflows/format.yml +0 -8
  5. {mdmodels_core-0.1.2 → mdmodels_core-0.1.3}/.github/workflows/lint.yml +0 -8
  6. mdmodels_core-0.1.3/.github/workflows/npm_bundler.yml +46 -0
  7. mdmodels_core-0.1.3/.github/workflows/npm_web.yml +46 -0
  8. mdmodels_core-0.1.3/.github/workflows/publish_pypi.yml +190 -0
  9. mdmodels_core-0.1.3/.github/workflows/publish_test_pypi.yml +174 -0
  10. {mdmodels_core-0.1.2 → mdmodels_core-0.1.3}/.gitignore +6 -0
  11. {mdmodels_core-0.1.2 → mdmodels_core-0.1.3}/Cargo.lock +45 -21
  12. {mdmodels_core-0.1.2 → mdmodels_core-0.1.3}/Cargo.toml +10 -3
  13. mdmodels_core-0.1.3/LICENSE.md +19 -0
  14. {mdmodels_core-0.1.2 → mdmodels_core-0.1.3}/PKG-INFO +40 -3
  15. {mdmodels_core-0.1.2 → mdmodels_core-0.1.3}/README.md +38 -2
  16. mdmodels_core-0.1.3/build.rs +26 -0
  17. {mdmodels_core-0.1.2 → mdmodels_core-0.1.3}/docs/index.md +6 -5
  18. mdmodels_core-0.1.3/docs/syntax.md +391 -0
  19. {mdmodels_core-0.1.2 → mdmodels_core-0.1.3}/mkdocs.yml +2 -13
  20. {mdmodels_core-0.1.2 → mdmodels_core-0.1.3}/pyproject.toml +2 -0
  21. {mdmodels_core-0.1.2 → mdmodels_core-0.1.3}/src/attribute.rs +35 -20
  22. {mdmodels_core-0.1.2 → mdmodels_core-0.1.3}/src/bin/cli.rs +27 -4
  23. mdmodels_core-0.1.3/src/bindings/python.rs +157 -0
  24. mdmodels_core-0.1.3/src/bindings/wasm.rs +103 -0
  25. {mdmodels_core-0.1.2 → mdmodels_core-0.1.3}/src/datamodel.rs +32 -11
  26. {mdmodels_core-0.1.2 → mdmodels_core-0.1.3}/src/exporters.rs +31 -2
  27. {mdmodels_core-0.1.2 → mdmodels_core-0.1.3}/src/json/datatype.rs +23 -0
  28. {mdmodels_core-0.1.2 → mdmodels_core-0.1.3}/src/json/parser.rs +23 -0
  29. mdmodels_core-0.1.3/src/lib.rs +67 -0
  30. {mdmodels_core-0.1.2 → mdmodels_core-0.1.3}/src/markdown/frontmatter.rs +27 -7
  31. {mdmodels_core-0.1.2 → mdmodels_core-0.1.3}/src/markdown/parser.rs +34 -7
  32. {mdmodels_core-0.1.2 → mdmodels_core-0.1.3}/src/object.rs +28 -11
  33. {mdmodels_core-0.1.2 → mdmodels_core-0.1.3}/src/pipeline.rs +27 -1
  34. {mdmodels_core-0.1.2 → mdmodels_core-0.1.3}/src/primitives.rs +23 -0
  35. {mdmodels_core-0.1.2 → mdmodels_core-0.1.3}/src/schema.rs +23 -0
  36. mdmodels_core-0.1.3/src/validation.rs +566 -0
  37. {mdmodels_core-0.1.2 → mdmodels_core-0.1.3}/src/xmltype.rs +27 -2
  38. mdmodels_core-0.1.3/tests/data/model_invalid_names.md +26 -0
  39. {mdmodels_core-0.1.2 → mdmodels_core-0.1.3}/tests/integration_tests.rs +33 -0
  40. {mdmodels_core-0.1.2 → mdmodels_core-0.1.3}/types/equation/equation.json +17 -17
  41. mdmodels_core-0.1.2/.github/scripts/generate_types.sh +0 -11
  42. mdmodels_core-0.1.2/.idea/workspace.xml +0 -141
  43. mdmodels_core-0.1.2/LICENSE.md +0 -7
  44. mdmodels_core-0.1.2/build.rs +0 -3
  45. mdmodels_core-0.1.2/docs/syntax/configuration.md +0 -3
  46. mdmodels_core-0.1.2/docs/syntax/enumerations.md +0 -3
  47. mdmodels_core-0.1.2/docs/syntax/index.md +0 -3
  48. mdmodels_core-0.1.2/docs/syntax/ontologies.md +0 -3
  49. mdmodels_core-0.1.2/docs/syntax/types.md +0 -3
  50. mdmodels_core-0.1.2/src/lib.rs +0 -36
  51. mdmodels_core-0.1.2/src/python/bindings.rs +0 -32
  52. mdmodels_core-0.1.2/src/validation.rs +0 -268
  53. mdmodels_core-0.1.2/test.py +0 -15
  54. {mdmodels_core-0.1.2 → mdmodels_core-0.1.3}/.github/workflows/publish.yml +0 -0
  55. {mdmodels_core-0.1.2 → mdmodels_core-0.1.3}/.github/workflows/test.yml +0 -0
  56. {mdmodels_core-0.1.2 → mdmodels_core-0.1.3}/assets/schema.png +0 -0
  57. {mdmodels_core-0.1.2 → mdmodels_core-0.1.3}/docs/library/code-generation.md +0 -0
  58. {mdmodels_core-0.1.2 → mdmodels_core-0.1.3}/docs/library/conversion.md +0 -0
  59. {mdmodels_core-0.1.2 → mdmodels_core-0.1.3}/docs/library/index.md +0 -0
  60. {mdmodels_core-0.1.2 → mdmodels_core-0.1.3}/docs/library/pipelines.md +0 -0
  61. {mdmodels_core-0.1.2 → mdmodels_core-0.1.3}/docs/library/validation.md +0 -0
  62. {mdmodels_core-0.1.2 → mdmodels_core-0.1.3}/docs/types/equation.md +0 -0
  63. {mdmodels_core-0.1.2 → mdmodels_core-0.1.3}/docs/types/index.md +0 -0
  64. {mdmodels_core-0.1.2 → mdmodels_core-0.1.3}/docs/types/unit-definition.md +0 -0
  65. {mdmodels_core-0.1.2 → mdmodels_core-0.1.3}/templates/markdown-compact.jinja +0 -0
  66. {mdmodels_core-0.1.2 → mdmodels_core-0.1.3}/templates/markdown.jinja +0 -0
  67. {mdmodels_core-0.1.2 → mdmodels_core-0.1.3}/templates/mkdocs.jinja +0 -0
  68. {mdmodels_core-0.1.2 → mdmodels_core-0.1.3}/templates/python-dataclass.jinja +0 -0
  69. {mdmodels_core-0.1.2 → mdmodels_core-0.1.3}/templates/python-macros.jinja +0 -0
  70. {mdmodels_core-0.1.2 → mdmodels_core-0.1.3}/templates/python-pydantic-xml.jinja +0 -0
  71. {mdmodels_core-0.1.2 → mdmodels_core-0.1.3}/templates/python-pydantic.jinja +0 -0
  72. {mdmodels_core-0.1.2 → mdmodels_core-0.1.3}/templates/shacl.jinja +0 -0
  73. {mdmodels_core-0.1.2 → mdmodels_core-0.1.3}/templates/shex.jinja +0 -0
  74. {mdmodels_core-0.1.2 → mdmodels_core-0.1.3}/templates/typescript.jinja +0 -0
  75. {mdmodels_core-0.1.2 → mdmodels_core-0.1.3}/templates/xml-schema.jinja +0 -0
  76. {mdmodels_core-0.1.2 → mdmodels_core-0.1.3}/tests/data/expected_json_schema.json +0 -0
  77. {mdmodels_core-0.1.2 → mdmodels_core-0.1.3}/tests/data/expected_mkdocs.md +0 -0
  78. {mdmodels_core-0.1.2 → mdmodels_core-0.1.3}/tests/data/expected_pydantic.py +0 -0
  79. {mdmodels_core-0.1.2 → mdmodels_core-0.1.3}/tests/data/expected_python_dc.py +0 -0
  80. {mdmodels_core-0.1.2 → mdmodels_core-0.1.3}/tests/data/expected_python_pydantic_xml.py +0 -0
  81. {mdmodels_core-0.1.2 → mdmodels_core-0.1.3}/tests/data/expected_sdrdm_full_schema.json +0 -0
  82. {mdmodels_core-0.1.2 → mdmodels_core-0.1.3}/tests/data/expected_sdrdm_schema.json +0 -0
  83. {mdmodels_core-0.1.2 → mdmodels_core-0.1.3}/tests/data/expected_sdrdm_schema_inheritance.json +0 -0
  84. {mdmodels_core-0.1.2 → mdmodels_core-0.1.3}/tests/data/expected_shacl.ttl +0 -0
  85. {mdmodels_core-0.1.2 → mdmodels_core-0.1.3}/tests/data/expected_shex.shex +0 -0
  86. {mdmodels_core-0.1.2 → mdmodels_core-0.1.3}/tests/data/expected_typescript.ts +0 -0
  87. {mdmodels_core-0.1.2 → mdmodels_core-0.1.3}/tests/data/expected_xml_schema.xsd +0 -0
  88. {mdmodels_core-0.1.2 → mdmodels_core-0.1.3}/tests/data/model.md +0 -0
  89. {mdmodels_core-0.1.2 → mdmodels_core-0.1.3}/tests/data/model_duplicates.md +0 -0
  90. {mdmodels_core-0.1.2 → mdmodels_core-0.1.3}/tests/data/model_full_documentation.md +0 -0
  91. {mdmodels_core-0.1.2 → mdmodels_core-0.1.3}/tests/data/model_inheritance.md +0 -0
  92. {mdmodels_core-0.1.2 → mdmodels_core-0.1.3}/tests/data/model_inheritance_invalid.md +0 -0
  93. {mdmodels_core-0.1.2 → mdmodels_core-0.1.3}/tests/data/model_merge.md +0 -0
  94. {mdmodels_core-0.1.2 → mdmodels_core-0.1.3}/tests/data/model_merge_invalid.md +0 -0
  95. {mdmodels_core-0.1.2 → mdmodels_core-0.1.3}/tests/data/model_missing_types.md +0 -0
  96. {mdmodels_core-0.1.2 → mdmodels_core-0.1.3}/tests/data/model_multiple_keyword.md +0 -0
  97. {mdmodels_core-0.1.2 → mdmodels_core-0.1.3}/tests/data/model_no_frontmatter.md +0 -0
  98. {mdmodels_core-0.1.2 → mdmodels_core-0.1.3}/tests/data/model_no_objects.md +0 -0
  99. {mdmodels_core-0.1.2 → mdmodels_core-0.1.3}/tests/data/model_w_html.md +0 -0
  100. {mdmodels_core-0.1.2 → mdmodels_core-0.1.3}/tests/test_pipeline.toml +0 -0
  101. {mdmodels_core-0.1.2 → mdmodels_core-0.1.3}/tests/test_pipeline_per_spec.toml +0 -0
  102. {mdmodels_core-0.1.2 → mdmodels_core-0.1.3}/tests/test_pipeline_per_spec_invalid.toml +0 -0
  103. {mdmodels_core-0.1.2 → mdmodels_core-0.1.3}/types/README.md +0 -0
  104. {mdmodels_core-0.1.2 → mdmodels_core-0.1.3}/types/equation/equation-internal.json +0 -0
  105. {mdmodels_core-0.1.2 → mdmodels_core-0.1.3}/types/equation/equation.md +0 -0
  106. {mdmodels_core-0.1.2 → mdmodels_core-0.1.3}/types/equation/equation.xsd +0 -0
  107. {mdmodels_core-0.1.2 → mdmodels_core-0.1.3}/types/equation/gen.toml +0 -0
  108. {mdmodels_core-0.1.2 → mdmodels_core-0.1.3}/types/unit-definition/gen.toml +0 -0
  109. {mdmodels_core-0.1.2 → mdmodels_core-0.1.3}/types/unit-definition/unit-definition-internal.json +0 -0
  110. {mdmodels_core-0.1.2 → mdmodels_core-0.1.3}/types/unit-definition/unit-definition.json +0 -0
  111. {mdmodels_core-0.1.2 → mdmodels_core-0.1.3}/types/unit-definition/unit-definition.md +0 -0
  112. {mdmodels_core-0.1.2 → mdmodels_core-0.1.3}/types/unit-definition/unit-definition.xsd +0 -0
@@ -0,0 +1,34 @@
1
+ #!/bin/bash
2
+
3
+ #
4
+ # Copyright (c) 2024 Jan Range
5
+ #
6
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ # of this software and associated documentation files (the "Software"), to deal
8
+ # in the Software without restriction, including without limitation the rights
9
+ # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ # copies of the Software, and to permit persons to whom the Software is
11
+ # furnished to do so, subject to the following conditions:
12
+ #
13
+ # The above copyright notice and this permission notice shall be included in
14
+ # all copies or substantial portions of the Software.
15
+ #
16
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22
+ # THE SOFTWARE.
23
+ #
24
+ #
25
+
26
+ # Grep all *.toml files in the types directory recursively
27
+ GEN_FILES=$(find types -name '*.toml')
28
+
29
+ # Iterate over each file
30
+ for file in $GEN_FILES; do
31
+ # Generate the go file
32
+ echo "Generating $file"
33
+ md-models pipeline -i $file
34
+ done
@@ -0,0 +1,67 @@
1
+ name: Compile and release
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - "v?[0-9]+.[0-9]+.[0-9]+"
7
+
8
+ permissions:
9
+ contents: write
10
+
11
+ jobs:
12
+ build-and-upload:
13
+ name: Build and upload
14
+ runs-on: ${{ matrix.os }}
15
+
16
+ strategy:
17
+ matrix:
18
+ include:
19
+ - build: linux
20
+ os: ubuntu-latest
21
+ target: x86_64-unknown-linux-gnu
22
+ - build: macos
23
+ os: macos-latest
24
+ target: x86_64-apple-darwin
25
+
26
+ - build: macos
27
+ os: macos-latest
28
+ target: aarch64-apple-darwin
29
+
30
+ - build: windows
31
+ os: windows-latest
32
+ target: x86_64-pc-windows-msvc
33
+
34
+ steps:
35
+ - name: Checkout
36
+ uses: actions/checkout@v3
37
+
38
+ - name: Get the release version from the tag
39
+ shell: bash
40
+ run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
41
+
42
+ - name: Install Rust
43
+ uses: dtolnay/rust-toolchain@stable
44
+ with:
45
+ targets: ${{ matrix.target }}
46
+
47
+ - name: Build
48
+ run: cargo build --verbose --release --target ${{ matrix.target }}
49
+
50
+ - name: Build binary
51
+ shell: bash
52
+ run: |
53
+ if [ "${{ matrix.os }}" = "windows-latest" ]; then
54
+ fname="target/${{ matrix.target }}/release/md-models-${{ matrix.target }}.exe"
55
+ mv target/${{ matrix.target }}/release/md-models.exe $fname
56
+ echo "ASSET=$fname" >> $GITHUB_ENV
57
+ else
58
+ fname="target/${{ matrix.target }}/release/md-models-${{ matrix.target }}"
59
+ mv target/${{ matrix.target }}/release/md-models $fname
60
+ echo "ASSET=$fname" >> $GITHUB_ENV
61
+ fi
62
+
63
+ - name: Release
64
+ uses: softprops/action-gh-release@v1
65
+ with:
66
+ files: |
67
+ ${{ env.ASSET }}
@@ -8,6 +8,7 @@ on:
8
8
  - "docs/**"
9
9
  - "types/**"
10
10
  - "mkdocs.yml"
11
+ workflow_dispatch:
11
12
 
12
13
  permissions:
13
14
  id-token: write
@@ -9,14 +9,6 @@ on:
9
9
  - "Cargo.lock"
10
10
  - "templates/**"
11
11
  - "types/**"
12
- pull_request:
13
- paths:
14
- - "src/**"
15
- - "tests/**"
16
- - "Cargo.toml"
17
- - "Cargo.lock"
18
- - "templates/**"
19
- - "types/**"
20
12
 
21
13
  jobs:
22
14
  rustfmt:
@@ -8,14 +8,6 @@ on:
8
8
  - "Cargo.lock"
9
9
  - "templates/**"
10
10
  - "types/**"
11
- pull_request:
12
- paths:
13
- - "src/**"
14
- - "tests/**"
15
- - "Cargo.toml"
16
- - "Cargo.lock"
17
- - "templates/**"
18
- - "types/**"
19
11
 
20
12
  # Make sure CI fails on all warnings, including Clippy lints
21
13
  env:
@@ -0,0 +1,46 @@
1
+ name: Publish to NPM (Bundler)
2
+
3
+ on:
4
+ release:
5
+ types: [ published ]
6
+
7
+ permissions:
8
+ contents: write
9
+ id-token: write
10
+
11
+ jobs:
12
+ build-and-upload:
13
+ name: Build and upload
14
+ runs-on: ubuntu-latest
15
+
16
+ steps:
17
+ - name: Checkout
18
+ uses: actions/checkout@v3
19
+
20
+ - name: Install Rust
21
+ uses: dtolnay/rust-toolchain@stable
22
+
23
+ - uses: jetli/wasm-pack-action@v0.4.0
24
+ with:
25
+ version: "latest"
26
+
27
+ - name: Build WASM for npm (bundle)
28
+ run: wasm-pack build --out-name mdmodels-core --release --features wasm
29
+
30
+ - uses: actions/setup-node@v4
31
+ with:
32
+ node-version: "20.x"
33
+ registry-url: "https://registry.npmjs.org"
34
+
35
+ - name: Update package name
36
+ run: |
37
+ jq '.name = "mdmodels-core"' pkg/package.json > pkg/package.json.tmp
38
+ mv pkg/package.json.tmp pkg/package.json
39
+
40
+ - run: |
41
+ cd pkg/
42
+ npm install --package-lock-only
43
+ npm ci
44
+ npm publish --access public
45
+ env:
46
+ NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
@@ -0,0 +1,46 @@
1
+ name: Publish to NPM (Web CDN)
2
+
3
+ on:
4
+ release:
5
+ types: [ published ]
6
+
7
+ permissions:
8
+ contents: write
9
+ id-token: write
10
+
11
+ jobs:
12
+ build-and-upload:
13
+ name: Build and upload
14
+ runs-on: ubuntu-latest
15
+
16
+ steps:
17
+ - name: Checkout
18
+ uses: actions/checkout@v3
19
+
20
+ - name: Install Rust
21
+ uses: dtolnay/rust-toolchain@stable
22
+
23
+ - uses: jetli/wasm-pack-action@v0.4.0
24
+ with:
25
+ version: "latest"
26
+
27
+ - name: Build WASM for npm (bundle)
28
+ run: wasm-pack build --release --out-name mdmodels-web --target web --features wasm
29
+
30
+ - uses: actions/setup-node@v4
31
+ with:
32
+ node-version: "20.x"
33
+ registry-url: "https://registry.npmjs.org"
34
+
35
+ - name: Update package name
36
+ run: |
37
+ jq '.name = "mdmodels-web"' pkg/package.json > pkg/package.json.tmp
38
+ mv pkg/package.json.tmp pkg/package.json
39
+
40
+ - run: |
41
+ cd pkg/
42
+ npm install --package-lock-only
43
+ npm ci
44
+ npm publish --access public
45
+ env:
46
+ NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
@@ -0,0 +1,190 @@
1
+ # This file is autogenerated by maturin v1.5.1
2
+ # To update, run
3
+ #
4
+ # maturin generate-ci --platform all -o .github/workflows/publish_pypi.yml -m Cargo.toml github
5
+ #
6
+ name: Publish to PyPI
7
+
8
+ on:
9
+ release:
10
+ types: [published]
11
+
12
+ permissions:
13
+ contents: read
14
+
15
+ jobs:
16
+ linux:
17
+ runs-on: ${{ matrix.platform.runner }}
18
+ strategy:
19
+ matrix:
20
+ platform:
21
+ - runner: ubuntu-latest
22
+ target: x86_64
23
+ - runner: ubuntu-latest
24
+ target: x86
25
+ - runner: ubuntu-latest
26
+ target: aarch64
27
+ - runner: ubuntu-latest
28
+ target: armv7
29
+ - runner: ubuntu-latest
30
+ target: ppc64le
31
+ steps:
32
+ - uses: actions/checkout@v4
33
+ - uses: actions/setup-python@v5
34
+ with:
35
+ python-version: "3.10"
36
+ - name: Build wheels
37
+ uses: PyO3/maturin-action@v1
38
+ with:
39
+ target: ${{ matrix.platform.target }}
40
+ args: --release --out dist --find-interpreter --features python
41
+ sccache: "true"
42
+ manylinux: auto
43
+ before-script-linux: |
44
+ # If we're running on rhel centos, install needed packages.
45
+ if command -v yum &> /dev/null; then
46
+ yum update -y && yum install -y perl-core openssl openssl-devel pkgconfig libatomic
47
+
48
+ # If we're running on i686 we need to symlink libatomic
49
+ # in order to build openssl with -latomic flag.
50
+ if [[ ! -d "/usr/lib64" ]]; then
51
+ ln -s /usr/lib/libatomic.so.1 /usr/lib/libatomic.so
52
+ fi
53
+ else
54
+ # If we're running on debian-based system.
55
+ apt update -y && apt-get install -y libssl-dev openssl pkg-config
56
+ fi
57
+ - name: Upload wheels
58
+ uses: actions/upload-artifact@v4
59
+ with:
60
+ name: wheels-linux-${{ matrix.platform.target }}
61
+ path: dist
62
+
63
+ windows:
64
+ runs-on: ${{ matrix.platform.runner }}
65
+ strategy:
66
+ matrix:
67
+ platform:
68
+ - runner: windows-latest
69
+ target: x64
70
+ - runner: windows-latest
71
+ target: x86
72
+ steps:
73
+ - uses: actions/checkout@v4
74
+ - uses: actions/setup-python@v5
75
+ with:
76
+ python-version: "3.10"
77
+ architecture: ${{ matrix.platform.target }}
78
+ - name: Build wheels
79
+ uses: PyO3/maturin-action@v1
80
+ with:
81
+ target: ${{ matrix.platform.target }}
82
+ args: --release --out dist --find-interpreter --features python
83
+ sccache: "true"
84
+ - name: Upload wheels
85
+ uses: actions/upload-artifact@v4
86
+ with:
87
+ name: wheels-windows-${{ matrix.platform.target }}
88
+ path: dist
89
+
90
+ macos:
91
+ runs-on: ${{ matrix.platform.runner }}
92
+ strategy:
93
+ matrix:
94
+ platform:
95
+ - runner: macos-latest
96
+ target: x86_64
97
+ - runner: macos-14
98
+ target: aarch64
99
+ steps:
100
+ - uses: actions/checkout@v4
101
+ - uses: actions/setup-python@v5
102
+ with:
103
+ python-version: "3.10"
104
+ - name: Build wheels
105
+ uses: PyO3/maturin-action@v1
106
+ with:
107
+ target: ${{ matrix.platform.target }}
108
+ args: --release --out dist --find-interpreter --features python
109
+ sccache: "true"
110
+ - name: Upload wheels
111
+ uses: actions/upload-artifact@v4
112
+ with:
113
+ name: wheels-macos-${{ matrix.platform.target }}
114
+ path: dist
115
+
116
+ emscripten:
117
+ runs-on: ${{ matrix.platform.runner }}
118
+ strategy:
119
+ matrix:
120
+ platform:
121
+ - runner: ubuntu-latest
122
+ target: wasm32-unknown-emscripten
123
+ steps:
124
+ - uses: actions/checkout@v4
125
+ - run: pip install pyodide-build
126
+ - name: Get Emscripten and Python version info
127
+ shell: bash
128
+ run: |
129
+ echo EMSCRIPTEN_VERSION=$(pyodide config get emscripten_version) >> $GITHUB_ENV
130
+ echo PYTHON_VERSION=$(pyodide config get python_version | cut -d '.' -f 1-2) >> $GITHUB_ENV
131
+ pip uninstall -y pyodide-build
132
+ - uses: mymindstorm/setup-emsdk@v12
133
+ with:
134
+ version: ${{ env.EMSCRIPTEN_VERSION }}
135
+ actions-cache-folder: emsdk-cache-${{ github.run_id }} # Adding run_id to ensure unique cache
136
+ - uses: actions/setup-python@v5
137
+ with:
138
+ python-version: ${{ env.PYTHON_VERSION }}
139
+ - run: pip install pyodide-build
140
+ - name: Build wheels
141
+ uses: PyO3/maturin-action@v1
142
+ with:
143
+ target: ${{ matrix.platform.target }}
144
+ args: --release --out dist -i ${{ env.PYTHON_VERSION }} --features python
145
+ sccache: "true"
146
+ rust-toolchain: nightly
147
+ - name: Upload wheels
148
+ uses: actions/upload-artifact@v4
149
+ with:
150
+ name: wasm-wheels
151
+ path: dist
152
+
153
+ sdist:
154
+ runs-on: ubuntu-latest
155
+ steps:
156
+ - uses: actions/checkout@v4
157
+ - name: Build sdist
158
+ uses: PyO3/maturin-action@v1
159
+ with:
160
+ command: sdist
161
+ args: --out dist
162
+ - name: Upload sdist
163
+ uses: actions/upload-artifact@v4
164
+ with:
165
+ name: wheels-sdist
166
+ path: dist
167
+
168
+ release:
169
+ name: Release
170
+ runs-on: ubuntu-latest
171
+ if: "startsWith(github.ref, 'refs/tags/')"
172
+ needs: [linux, windows, macos, emscripten, sdist]
173
+ permissions:
174
+ # Used to upload release artifacts
175
+ contents: write
176
+ steps:
177
+ - uses: actions/download-artifact@v4
178
+ - name: Publish to PyPI
179
+ uses: PyO3/maturin-action@v1
180
+ env:
181
+ MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
182
+ with:
183
+ command: upload
184
+ args: --non-interactive --skip-existing wheels-*/*
185
+ - name: Upload to GitHub Release
186
+ uses: softprops/action-gh-release@v1
187
+ with:
188
+ files: |
189
+ wasm-wheels/*.whl
190
+ prerelease: ${{ contains(github.ref, 'alpha') || contains(github.ref, 'beta') }}
@@ -0,0 +1,174 @@
1
+ # This file is autogenerated by maturin v1.5.1
2
+ # To update, run
3
+ #
4
+ # maturin generate-ci --platform all -o .github/workflows/publish_pypi.yml -m Cargo.toml github
5
+ #
6
+ name: Publish to Test PyPI
7
+
8
+ on:
9
+ workflow_dispatch:
10
+ inputs:
11
+ version:
12
+ description: 'The version to publish'
13
+ required: true
14
+
15
+ permissions:
16
+ contents: read
17
+
18
+ jobs:
19
+ linux:
20
+ runs-on: ${{ matrix.platform.runner }}
21
+ strategy:
22
+ matrix:
23
+ platform:
24
+ - runner: ubuntu-latest
25
+ target: x86_64
26
+ - runner: ubuntu-latest
27
+ target: x86
28
+ - runner: ubuntu-latest
29
+ target: aarch64
30
+ - runner: ubuntu-latest
31
+ target: armv7
32
+ - runner: ubuntu-latest
33
+ target: s390x
34
+ - runner: ubuntu-latest
35
+ target: ppc64le
36
+ steps:
37
+ - uses: actions/checkout@v4
38
+ - uses: actions/setup-python@v5
39
+ with:
40
+ python-version: "3.10"
41
+ - name: Build wheels
42
+ uses: PyO3/maturin-action@v1
43
+ with:
44
+ target: ${{ matrix.platform.target }}
45
+ args: --release --out dist --find-interpreter --features python
46
+ sccache: "true"
47
+ manylinux: auto
48
+ - name: Upload wheels
49
+ uses: actions/upload-artifact@v4
50
+ with:
51
+ name: wheels-linux-${{ matrix.platform.target }}
52
+ path: dist
53
+
54
+ windows:
55
+ runs-on: ${{ matrix.platform.runner }}
56
+ strategy:
57
+ matrix:
58
+ platform:
59
+ - runner: windows-latest
60
+ target: x64
61
+ - runner: windows-latest
62
+ target: x86
63
+ steps:
64
+ - uses: actions/checkout@v4
65
+ - uses: actions/setup-python@v5
66
+ with:
67
+ python-version: "3.10"
68
+ architecture: ${{ matrix.platform.target }}
69
+ - name: Build wheels
70
+ uses: PyO3/maturin-action@v1
71
+ with:
72
+ target: ${{ matrix.platform.target }}
73
+ args: --release --out dist --find-interpreter --features python
74
+ sccache: "true"
75
+ - name: Upload wheels
76
+ uses: actions/upload-artifact@v4
77
+ with:
78
+ name: wheels-windows-${{ matrix.platform.target }}
79
+ path: dist
80
+
81
+ macos:
82
+ runs-on: ${{ matrix.platform.runner }}
83
+ strategy:
84
+ matrix:
85
+ platform:
86
+ - runner: macos-latest
87
+ target: x86_64
88
+ - runner: macos-14
89
+ target: aarch64
90
+ steps:
91
+ - uses: actions/checkout@v4
92
+ - uses: actions/setup-python@v5
93
+ with:
94
+ python-version: "3.10"
95
+ - name: Build wheels
96
+ uses: PyO3/maturin-action@v1
97
+ with:
98
+ target: ${{ matrix.platform.target }}
99
+ args: --release --out dist --find-interpreter --features python
100
+ sccache: "true"
101
+ - name: Upload wheels
102
+ uses: actions/upload-artifact@v4
103
+ with:
104
+ name: wheels-macos-${{ matrix.platform.target }}
105
+ path: dist
106
+
107
+ emscripten:
108
+ runs-on: ${{ matrix.platform.runner }}
109
+ strategy:
110
+ matrix:
111
+ platform:
112
+ - runner: ubuntu-latest
113
+ target: wasm32-unknown-emscripten
114
+ steps:
115
+ - uses: actions/checkout@v4
116
+ - run: pip install pyodide-build
117
+ - name: Get Emscripten and Python version info
118
+ shell: bash
119
+ run: |
120
+ echo EMSCRIPTEN_VERSION=$(pyodide config get emscripten_version) >> $GITHUB_ENV
121
+ echo PYTHON_VERSION=$(pyodide config get python_version | cut -d '.' -f 1-2) >> $GITHUB_ENV
122
+ pip uninstall -y pyodide-build
123
+ - uses: mymindstorm/setup-emsdk@v12
124
+ with:
125
+ version: ${{ env.EMSCRIPTEN_VERSION }}
126
+ actions-cache-folder: emsdk-cache-${{ github.run_id }} # Adding run_id to ensure unique cache
127
+ - uses: actions/setup-python@v5
128
+ with:
129
+ python-version: ${{ env.PYTHON_VERSION }}
130
+ - run: pip install pyodide-build
131
+ - name: Build wheels
132
+ uses: PyO3/maturin-action@v1
133
+ with:
134
+ target: ${{ matrix.platform.target }}
135
+ args: --release --out dist -i ${{ env.PYTHON_VERSION }} --features python
136
+ sccache: "true"
137
+ rust-toolchain: nightly
138
+ - name: Upload wheels
139
+ uses: actions/upload-artifact@v4
140
+ with:
141
+ name: wasm-wheels
142
+ path: dist
143
+
144
+ sdist:
145
+ runs-on: ubuntu-latest
146
+ steps:
147
+ - uses: actions/checkout@v4
148
+ - name: Build sdist
149
+ uses: PyO3/maturin-action@v1
150
+ with:
151
+ command: sdist
152
+ args: --out dist
153
+ - name: Upload sdist
154
+ uses: actions/upload-artifact@v4
155
+ with:
156
+ name: wheels-sdist
157
+ path: dist
158
+
159
+ release:
160
+ name: Release
161
+ runs-on: ubuntu-latest
162
+ needs: [linux, windows, macos, emscripten, sdist]
163
+ permissions:
164
+ contents: write
165
+ steps:
166
+ - uses: actions/download-artifact@v4
167
+ - name: Publish to Test PyPI
168
+ uses: PyO3/maturin-action@v1
169
+ env:
170
+ MATURIN_PYPI_TOKEN: ${{ secrets.TEST_PYPI_API_TOKEN }}
171
+ MATURIN_REPOSITORY_URL: https://test.pypi.org/legacy/
172
+ with:
173
+ command: upload
174
+ args: --non-interactive --skip-existing wheels-*/*
@@ -7,3 +7,9 @@ tests/intermediates
7
7
 
8
8
  # Ignore tarpaulin report
9
9
  tarpaulin-report.html
10
+
11
+ # Ignore IntelliJ IDEA files
12
+ .idea
13
+
14
+ # Ignore wasm-pack output
15
+ pkg