mdmodels-core 0.1.2__tar.gz → 0.1.4__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.4/.github/scripts/generate_types.sh +34 -0
  2. mdmodels_core-0.1.4/.github/workflows/assets.yml +67 -0
  3. {mdmodels_core-0.1.2 → mdmodels_core-0.1.4}/.github/workflows/docs.yml +1 -0
  4. {mdmodels_core-0.1.2 → mdmodels_core-0.1.4}/.github/workflows/format.yml +0 -8
  5. {mdmodels_core-0.1.2 → mdmodels_core-0.1.4}/.github/workflows/lint.yml +0 -8
  6. mdmodels_core-0.1.4/.github/workflows/npm_bundler.yml +46 -0
  7. mdmodels_core-0.1.4/.github/workflows/npm_web.yml +46 -0
  8. mdmodels_core-0.1.4/.github/workflows/publish_pypi.yml +191 -0
  9. mdmodels_core-0.1.4/.github/workflows/publish_test_pypi.yml +186 -0
  10. {mdmodels_core-0.1.2 → mdmodels_core-0.1.4}/.gitignore +6 -0
  11. {mdmodels_core-0.1.2 → mdmodels_core-0.1.4}/Cargo.lock +45 -21
  12. {mdmodels_core-0.1.2 → mdmodels_core-0.1.4}/Cargo.toml +10 -3
  13. mdmodels_core-0.1.4/LICENSE.md +19 -0
  14. {mdmodels_core-0.1.2 → mdmodels_core-0.1.4}/PKG-INFO +41 -4
  15. {mdmodels_core-0.1.2 → mdmodels_core-0.1.4}/README.md +38 -2
  16. mdmodels_core-0.1.4/build.rs +26 -0
  17. {mdmodels_core-0.1.2 → mdmodels_core-0.1.4}/docs/index.md +6 -5
  18. mdmodels_core-0.1.4/docs/syntax.md +391 -0
  19. {mdmodels_core-0.1.2 → mdmodels_core-0.1.4}/mkdocs.yml +2 -13
  20. {mdmodels_core-0.1.2 → mdmodels_core-0.1.4}/pyproject.toml +2 -0
  21. {mdmodels_core-0.1.2 → mdmodels_core-0.1.4}/src/attribute.rs +212 -20
  22. {mdmodels_core-0.1.2 → mdmodels_core-0.1.4}/src/bin/cli.rs +27 -4
  23. mdmodels_core-0.1.4/src/bindings/python.rs +157 -0
  24. mdmodels_core-0.1.4/src/bindings/wasm.rs +103 -0
  25. {mdmodels_core-0.1.2 → mdmodels_core-0.1.4}/src/datamodel.rs +32 -11
  26. {mdmodels_core-0.1.2 → mdmodels_core-0.1.4}/src/exporters.rs +31 -2
  27. {mdmodels_core-0.1.2 → mdmodels_core-0.1.4}/src/json/datatype.rs +23 -0
  28. {mdmodels_core-0.1.2 → mdmodels_core-0.1.4}/src/json/parser.rs +23 -0
  29. mdmodels_core-0.1.4/src/lib.rs +67 -0
  30. {mdmodels_core-0.1.2 → mdmodels_core-0.1.4}/src/markdown/frontmatter.rs +27 -7
  31. {mdmodels_core-0.1.2 → mdmodels_core-0.1.4}/src/markdown/parser.rs +34 -7
  32. {mdmodels_core-0.1.2 → mdmodels_core-0.1.4}/src/object.rs +28 -11
  33. {mdmodels_core-0.1.2 → mdmodels_core-0.1.4}/src/pipeline.rs +27 -1
  34. {mdmodels_core-0.1.2 → mdmodels_core-0.1.4}/src/primitives.rs +23 -0
  35. {mdmodels_core-0.1.2 → mdmodels_core-0.1.4}/src/schema.rs +23 -0
  36. mdmodels_core-0.1.4/src/validation.rs +566 -0
  37. {mdmodels_core-0.1.2 → mdmodels_core-0.1.4}/src/xmltype.rs +27 -2
  38. mdmodels_core-0.1.4/tests/data/model_invalid_names.md +26 -0
  39. {mdmodels_core-0.1.2 → mdmodels_core-0.1.4}/tests/integration_tests.rs +33 -0
  40. {mdmodels_core-0.1.2 → mdmodels_core-0.1.4}/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.4}/.github/workflows/publish.yml +0 -0
  55. {mdmodels_core-0.1.2 → mdmodels_core-0.1.4}/.github/workflows/test.yml +0 -0
  56. {mdmodels_core-0.1.2 → mdmodels_core-0.1.4}/assets/schema.png +0 -0
  57. {mdmodels_core-0.1.2 → mdmodels_core-0.1.4}/docs/library/code-generation.md +0 -0
  58. {mdmodels_core-0.1.2 → mdmodels_core-0.1.4}/docs/library/conversion.md +0 -0
  59. {mdmodels_core-0.1.2 → mdmodels_core-0.1.4}/docs/library/index.md +0 -0
  60. {mdmodels_core-0.1.2 → mdmodels_core-0.1.4}/docs/library/pipelines.md +0 -0
  61. {mdmodels_core-0.1.2 → mdmodels_core-0.1.4}/docs/library/validation.md +0 -0
  62. {mdmodels_core-0.1.2 → mdmodels_core-0.1.4}/docs/types/equation.md +0 -0
  63. {mdmodels_core-0.1.2 → mdmodels_core-0.1.4}/docs/types/index.md +0 -0
  64. {mdmodels_core-0.1.2 → mdmodels_core-0.1.4}/docs/types/unit-definition.md +0 -0
  65. {mdmodels_core-0.1.2 → mdmodels_core-0.1.4}/templates/markdown-compact.jinja +0 -0
  66. {mdmodels_core-0.1.2 → mdmodels_core-0.1.4}/templates/markdown.jinja +0 -0
  67. {mdmodels_core-0.1.2 → mdmodels_core-0.1.4}/templates/mkdocs.jinja +0 -0
  68. {mdmodels_core-0.1.2 → mdmodels_core-0.1.4}/templates/python-dataclass.jinja +0 -0
  69. {mdmodels_core-0.1.2 → mdmodels_core-0.1.4}/templates/python-macros.jinja +0 -0
  70. {mdmodels_core-0.1.2 → mdmodels_core-0.1.4}/templates/python-pydantic-xml.jinja +0 -0
  71. {mdmodels_core-0.1.2 → mdmodels_core-0.1.4}/templates/python-pydantic.jinja +0 -0
  72. {mdmodels_core-0.1.2 → mdmodels_core-0.1.4}/templates/shacl.jinja +0 -0
  73. {mdmodels_core-0.1.2 → mdmodels_core-0.1.4}/templates/shex.jinja +0 -0
  74. {mdmodels_core-0.1.2 → mdmodels_core-0.1.4}/templates/typescript.jinja +0 -0
  75. {mdmodels_core-0.1.2 → mdmodels_core-0.1.4}/templates/xml-schema.jinja +0 -0
  76. {mdmodels_core-0.1.2 → mdmodels_core-0.1.4}/tests/data/expected_json_schema.json +0 -0
  77. {mdmodels_core-0.1.2 → mdmodels_core-0.1.4}/tests/data/expected_mkdocs.md +0 -0
  78. {mdmodels_core-0.1.2 → mdmodels_core-0.1.4}/tests/data/expected_pydantic.py +0 -0
  79. {mdmodels_core-0.1.2 → mdmodels_core-0.1.4}/tests/data/expected_python_dc.py +0 -0
  80. {mdmodels_core-0.1.2 → mdmodels_core-0.1.4}/tests/data/expected_python_pydantic_xml.py +0 -0
  81. {mdmodels_core-0.1.2 → mdmodels_core-0.1.4}/tests/data/expected_sdrdm_full_schema.json +0 -0
  82. {mdmodels_core-0.1.2 → mdmodels_core-0.1.4}/tests/data/expected_sdrdm_schema.json +0 -0
  83. {mdmodels_core-0.1.2 → mdmodels_core-0.1.4}/tests/data/expected_sdrdm_schema_inheritance.json +0 -0
  84. {mdmodels_core-0.1.2 → mdmodels_core-0.1.4}/tests/data/expected_shacl.ttl +0 -0
  85. {mdmodels_core-0.1.2 → mdmodels_core-0.1.4}/tests/data/expected_shex.shex +0 -0
  86. {mdmodels_core-0.1.2 → mdmodels_core-0.1.4}/tests/data/expected_typescript.ts +0 -0
  87. {mdmodels_core-0.1.2 → mdmodels_core-0.1.4}/tests/data/expected_xml_schema.xsd +0 -0
  88. {mdmodels_core-0.1.2 → mdmodels_core-0.1.4}/tests/data/model.md +0 -0
  89. {mdmodels_core-0.1.2 → mdmodels_core-0.1.4}/tests/data/model_duplicates.md +0 -0
  90. {mdmodels_core-0.1.2 → mdmodels_core-0.1.4}/tests/data/model_full_documentation.md +0 -0
  91. {mdmodels_core-0.1.2 → mdmodels_core-0.1.4}/tests/data/model_inheritance.md +0 -0
  92. {mdmodels_core-0.1.2 → mdmodels_core-0.1.4}/tests/data/model_inheritance_invalid.md +0 -0
  93. {mdmodels_core-0.1.2 → mdmodels_core-0.1.4}/tests/data/model_merge.md +0 -0
  94. {mdmodels_core-0.1.2 → mdmodels_core-0.1.4}/tests/data/model_merge_invalid.md +0 -0
  95. {mdmodels_core-0.1.2 → mdmodels_core-0.1.4}/tests/data/model_missing_types.md +0 -0
  96. {mdmodels_core-0.1.2 → mdmodels_core-0.1.4}/tests/data/model_multiple_keyword.md +0 -0
  97. {mdmodels_core-0.1.2 → mdmodels_core-0.1.4}/tests/data/model_no_frontmatter.md +0 -0
  98. {mdmodels_core-0.1.2 → mdmodels_core-0.1.4}/tests/data/model_no_objects.md +0 -0
  99. {mdmodels_core-0.1.2 → mdmodels_core-0.1.4}/tests/data/model_w_html.md +0 -0
  100. {mdmodels_core-0.1.2 → mdmodels_core-0.1.4}/tests/test_pipeline.toml +0 -0
  101. {mdmodels_core-0.1.2 → mdmodels_core-0.1.4}/tests/test_pipeline_per_spec.toml +0 -0
  102. {mdmodels_core-0.1.2 → mdmodels_core-0.1.4}/tests/test_pipeline_per_spec_invalid.toml +0 -0
  103. {mdmodels_core-0.1.2 → mdmodels_core-0.1.4}/types/README.md +0 -0
  104. {mdmodels_core-0.1.2 → mdmodels_core-0.1.4}/types/equation/equation-internal.json +0 -0
  105. {mdmodels_core-0.1.2 → mdmodels_core-0.1.4}/types/equation/equation.md +0 -0
  106. {mdmodels_core-0.1.2 → mdmodels_core-0.1.4}/types/equation/equation.xsd +0 -0
  107. {mdmodels_core-0.1.2 → mdmodels_core-0.1.4}/types/equation/gen.toml +0 -0
  108. {mdmodels_core-0.1.2 → mdmodels_core-0.1.4}/types/unit-definition/gen.toml +0 -0
  109. {mdmodels_core-0.1.2 → mdmodels_core-0.1.4}/types/unit-definition/unit-definition-internal.json +0 -0
  110. {mdmodels_core-0.1.2 → mdmodels_core-0.1.4}/types/unit-definition/unit-definition.json +0 -0
  111. {mdmodels_core-0.1.2 → mdmodels_core-0.1.4}/types/unit-definition/unit-definition.md +0 -0
  112. {mdmodels_core-0.1.2 → mdmodels_core-0.1.4}/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,191 @@
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
+ workflow_dispatch:
12
+
13
+ permissions:
14
+ contents: read
15
+
16
+ jobs:
17
+ linux:
18
+ runs-on: ${{ matrix.platform.runner }}
19
+ strategy:
20
+ matrix:
21
+ platform:
22
+ - runner: ubuntu-latest
23
+ target: x86_64
24
+ - runner: ubuntu-latest
25
+ target: x86
26
+ - runner: ubuntu-latest
27
+ target: aarch64
28
+ - runner: ubuntu-latest
29
+ target: armv7
30
+ - runner: ubuntu-latest
31
+ target: ppc64le
32
+ steps:
33
+ - uses: actions/checkout@v4
34
+ - uses: actions/setup-python@v5
35
+ with:
36
+ python-version: "3.10"
37
+ - name: Build wheels
38
+ uses: PyO3/maturin-action@v1
39
+ with:
40
+ target: ${{ matrix.platform.target }}
41
+ args: --release --out dist --find-interpreter --features python
42
+ sccache: "true"
43
+ manylinux: auto
44
+ before-script-linux: |
45
+ # If we're running on rhel centos, install needed packages.
46
+ if command -v yum &> /dev/null; then
47
+ yum update -y && yum install -y perl-core openssl openssl-devel pkgconfig libatomic
48
+
49
+ # If we're running on i686 we need to symlink libatomic
50
+ # in order to build openssl with -latomic flag.
51
+ if [[ ! -d "/usr/lib64" ]]; then
52
+ ln -s /usr/lib/libatomic.so.1 /usr/lib/libatomic.so
53
+ fi
54
+ else
55
+ # If we're running on debian-based system.
56
+ apt update -y && apt-get install -y libssl-dev openssl pkg-config
57
+ fi
58
+ - name: Upload wheels
59
+ uses: actions/upload-artifact@v4
60
+ with:
61
+ name: wheels-linux-${{ matrix.platform.target }}
62
+ path: dist
63
+
64
+ windows:
65
+ runs-on: ${{ matrix.platform.runner }}
66
+ strategy:
67
+ matrix:
68
+ platform:
69
+ - runner: windows-latest
70
+ target: x64
71
+ - runner: windows-latest
72
+ target: x86
73
+ steps:
74
+ - uses: actions/checkout@v4
75
+ - uses: actions/setup-python@v5
76
+ with:
77
+ python-version: "3.10"
78
+ architecture: ${{ matrix.platform.target }}
79
+ - name: Build wheels
80
+ uses: PyO3/maturin-action@v1
81
+ with:
82
+ target: ${{ matrix.platform.target }}
83
+ args: --release --out dist --find-interpreter --features python
84
+ sccache: "true"
85
+ - name: Upload wheels
86
+ uses: actions/upload-artifact@v4
87
+ with:
88
+ name: wheels-windows-${{ matrix.platform.target }}
89
+ path: dist
90
+
91
+ macos:
92
+ runs-on: ${{ matrix.platform.runner }}
93
+ strategy:
94
+ matrix:
95
+ platform:
96
+ - runner: macos-latest
97
+ target: x86_64
98
+ - runner: macos-14
99
+ target: aarch64
100
+ steps:
101
+ - uses: actions/checkout@v4
102
+ - uses: actions/setup-python@v5
103
+ with:
104
+ python-version: "3.10"
105
+ - name: Build wheels
106
+ uses: PyO3/maturin-action@v1
107
+ with:
108
+ target: ${{ matrix.platform.target }}
109
+ args: --release --out dist --find-interpreter --features python
110
+ sccache: "true"
111
+ - name: Upload wheels
112
+ uses: actions/upload-artifact@v4
113
+ with:
114
+ name: wheels-macos-${{ matrix.platform.target }}
115
+ path: dist
116
+
117
+ emscripten:
118
+ runs-on: ${{ matrix.platform.runner }}
119
+ strategy:
120
+ matrix:
121
+ platform:
122
+ - runner: ubuntu-latest
123
+ target: wasm32-unknown-emscripten
124
+ steps:
125
+ - uses: actions/checkout@v4
126
+ - run: pip install pyodide-build
127
+ - name: Get Emscripten and Python version info
128
+ shell: bash
129
+ run: |
130
+ echo EMSCRIPTEN_VERSION=$(pyodide config get emscripten_version) >> $GITHUB_ENV
131
+ echo PYTHON_VERSION=$(pyodide config get python_version | cut -d '.' -f 1-2) >> $GITHUB_ENV
132
+ pip uninstall -y pyodide-build
133
+ - uses: mymindstorm/setup-emsdk@v12
134
+ with:
135
+ version: ${{ env.EMSCRIPTEN_VERSION }}
136
+ actions-cache-folder: emsdk-cache-${{ github.run_id }} # Adding run_id to ensure unique cache
137
+ - uses: actions/setup-python@v5
138
+ with:
139
+ python-version: ${{ env.PYTHON_VERSION }}
140
+ - run: pip install pyodide-build
141
+ - name: Build wheels
142
+ uses: PyO3/maturin-action@v1
143
+ with:
144
+ target: ${{ matrix.platform.target }}
145
+ args: --release --out dist -i ${{ env.PYTHON_VERSION }} --features python
146
+ sccache: "true"
147
+ rust-toolchain: nightly
148
+ - name: Upload wheels
149
+ uses: actions/upload-artifact@v4
150
+ with:
151
+ name: wasm-wheels
152
+ path: dist
153
+
154
+ sdist:
155
+ runs-on: ubuntu-latest
156
+ steps:
157
+ - uses: actions/checkout@v4
158
+ - name: Build sdist
159
+ uses: PyO3/maturin-action@v1
160
+ with:
161
+ command: sdist
162
+ args: --out dist
163
+ - name: Upload sdist
164
+ uses: actions/upload-artifact@v4
165
+ with:
166
+ name: wheels-sdist
167
+ path: dist
168
+
169
+ release:
170
+ name: Release
171
+ runs-on: ubuntu-latest
172
+ if: "startsWith(github.ref, 'refs/tags/')"
173
+ needs: [linux, windows, macos, emscripten, sdist]
174
+ permissions:
175
+ # Used to upload release artifacts
176
+ contents: write
177
+ steps:
178
+ - uses: actions/download-artifact@v4
179
+ - name: Publish to PyPI
180
+ uses: PyO3/maturin-action@v1
181
+ env:
182
+ MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
183
+ with:
184
+ command: upload
185
+ args: --non-interactive --skip-existing wheels-*/*
186
+ - name: Upload to GitHub Release
187
+ uses: softprops/action-gh-release@v1
188
+ with:
189
+ files: |
190
+ wasm-wheels/*.whl
191
+ prerelease: ${{ contains(github.ref, 'alpha') || contains(github.ref, 'beta') }}
@@ -0,0 +1,186 @@
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: ppc64le
34
+ steps:
35
+ - uses: actions/checkout@v4
36
+ - uses: actions/setup-python@v5
37
+ with:
38
+ python-version: "3.10"
39
+ - name: Build wheels
40
+ uses: PyO3/maturin-action@v1
41
+ with:
42
+ target: ${{ matrix.platform.target }}
43
+ args: --release --out dist --find-interpreter --features python
44
+ sccache: "true"
45
+ manylinux: auto
46
+ before-script-linux: |
47
+ # If we're running on rhel centos, install needed packages.
48
+ if command -v yum &> /dev/null; then
49
+ yum update -y && yum install -y perl-core openssl openssl-devel pkgconfig libatomic
50
+
51
+ # If we're running on i686 we need to symlink libatomic
52
+ # in order to build openssl with -latomic flag.
53
+ if [[ ! -d "/usr/lib64" ]]; then
54
+ ln -s /usr/lib/libatomic.so.1 /usr/lib/libatomic.so
55
+ fi
56
+ else
57
+ # If we're running on debian-based system.
58
+ apt update -y && apt-get install -y libssl-dev openssl pkg-config
59
+ fi
60
+ - name: Upload wheels
61
+ uses: actions/upload-artifact@v4
62
+ with:
63
+ name: wheels-linux-${{ matrix.platform.target }}
64
+ path: dist
65
+
66
+ windows:
67
+ runs-on: ${{ matrix.platform.runner }}
68
+ strategy:
69
+ matrix:
70
+ platform:
71
+ - runner: windows-latest
72
+ target: x64
73
+ - runner: windows-latest
74
+ target: x86
75
+ steps:
76
+ - uses: actions/checkout@v4
77
+ - uses: actions/setup-python@v5
78
+ with:
79
+ python-version: "3.10"
80
+ architecture: ${{ matrix.platform.target }}
81
+ - name: Build wheels
82
+ uses: PyO3/maturin-action@v1
83
+ with:
84
+ target: ${{ matrix.platform.target }}
85
+ args: --release --out dist --find-interpreter --features python
86
+ sccache: "true"
87
+ - name: Upload wheels
88
+ uses: actions/upload-artifact@v4
89
+ with:
90
+ name: wheels-windows-${{ matrix.platform.target }}
91
+ path: dist
92
+
93
+ macos:
94
+ runs-on: ${{ matrix.platform.runner }}
95
+ strategy:
96
+ matrix:
97
+ platform:
98
+ - runner: macos-latest
99
+ target: x86_64
100
+ - runner: macos-14
101
+ target: aarch64
102
+ steps:
103
+ - uses: actions/checkout@v4
104
+ - uses: actions/setup-python@v5
105
+ with:
106
+ python-version: "3.10"
107
+ - name: Build wheels
108
+ uses: PyO3/maturin-action@v1
109
+ with:
110
+ target: ${{ matrix.platform.target }}
111
+ args: --release --out dist --find-interpreter --features python
112
+ sccache: "true"
113
+ - name: Upload wheels
114
+ uses: actions/upload-artifact@v4
115
+ with:
116
+ name: wheels-macos-${{ matrix.platform.target }}
117
+ path: dist
118
+
119
+ emscripten:
120
+ runs-on: ${{ matrix.platform.runner }}
121
+ strategy:
122
+ matrix:
123
+ platform:
124
+ - runner: ubuntu-latest
125
+ target: wasm32-unknown-emscripten
126
+ steps:
127
+ - uses: actions/checkout@v4
128
+ - run: pip install pyodide-build
129
+ - name: Get Emscripten and Python version info
130
+ shell: bash
131
+ run: |
132
+ echo EMSCRIPTEN_VERSION=$(pyodide config get emscripten_version) >> $GITHUB_ENV
133
+ echo PYTHON_VERSION=$(pyodide config get python_version | cut -d '.' -f 1-2) >> $GITHUB_ENV
134
+ pip uninstall -y pyodide-build
135
+ - uses: mymindstorm/setup-emsdk@v12
136
+ with:
137
+ version: ${{ env.EMSCRIPTEN_VERSION }}
138
+ actions-cache-folder: emsdk-cache-${{ github.run_id }} # Adding run_id to ensure unique cache
139
+ - uses: actions/setup-python@v5
140
+ with:
141
+ python-version: ${{ env.PYTHON_VERSION }}
142
+ - run: pip install pyodide-build
143
+ - name: Build wheels
144
+ uses: PyO3/maturin-action@v1
145
+ with:
146
+ target: ${{ matrix.platform.target }}
147
+ args: --release --out dist -i ${{ env.PYTHON_VERSION }} --features python
148
+ sccache: "true"
149
+ rust-toolchain: nightly
150
+ - name: Upload wheels
151
+ uses: actions/upload-artifact@v4
152
+ with:
153
+ name: wasm-wheels
154
+ path: dist
155
+
156
+ sdist:
157
+ runs-on: ubuntu-latest
158
+ steps:
159
+ - uses: actions/checkout@v4
160
+ - name: Build sdist
161
+ uses: PyO3/maturin-action@v1
162
+ with:
163
+ command: sdist
164
+ args: --out dist
165
+ - name: Upload sdist
166
+ uses: actions/upload-artifact@v4
167
+ with:
168
+ name: wheels-sdist
169
+ path: dist
170
+
171
+ release:
172
+ name: Release
173
+ runs-on: ubuntu-latest
174
+ needs: [linux, windows, macos, emscripten, sdist]
175
+ permissions:
176
+ contents: write
177
+ steps:
178
+ - uses: actions/download-artifact@v4
179
+ - name: Publish to Test PyPI
180
+ uses: PyO3/maturin-action@v1
181
+ env:
182
+ MATURIN_PYPI_TOKEN: ${{ secrets.TEST_PYPI_API_TOKEN }}
183
+ MATURIN_REPOSITORY_URL: https://test.pypi.org/legacy/
184
+ with:
185
+ command: upload
186
+ 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