y-py-dart 0.6.3a5__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 (44) hide show
  1. y_py_dart-0.6.3a5/.github/workflows/test.yml +41 -0
  2. y_py_dart-0.6.3a5/.github/workflows/wheels.yml +229 -0
  3. y_py_dart-0.6.3a5/.gitignore +12 -0
  4. y_py_dart-0.6.3a5/Cargo.lock +547 -0
  5. y_py_dart-0.6.3a5/Cargo.toml +28 -0
  6. y_py_dart-0.6.3a5/LICENSE +23 -0
  7. y_py_dart-0.6.3a5/PKG-INFO +152 -0
  8. y_py_dart-0.6.3a5/README.md +127 -0
  9. y_py_dart-0.6.3a5/docs/Makefile +20 -0
  10. y_py_dart-0.6.3a5/docs/conf.py +64 -0
  11. y_py_dart-0.6.3a5/docs/index.rst +23 -0
  12. y_py_dart-0.6.3a5/docs/installation.rst +13 -0
  13. y_py_dart-0.6.3a5/docs/make.bat +35 -0
  14. y_py_dart-0.6.3a5/docs/modules.rst +6 -0
  15. y_py_dart-0.6.3a5/docs/requirements.txt +3 -0
  16. y_py_dart-0.6.3a5/docs/tutorial.rst +27 -0
  17. y_py_dart-0.6.3a5/environment-dev.yml +6 -0
  18. y_py_dart-0.6.3a5/examples/drawing/README.md +19 -0
  19. y_py_dart-0.6.3a5/examples/drawing/client.py +61 -0
  20. y_py_dart-0.6.3a5/examples/drawing/demo.py +33 -0
  21. y_py_dart-0.6.3a5/examples/drawing/draw.py +45 -0
  22. y_py_dart-0.6.3a5/examples/drawing/requirements.txt +6 -0
  23. y_py_dart-0.6.3a5/examples/drawing/server.py +27 -0
  24. y_py_dart-0.6.3a5/pyproject.toml +42 -0
  25. y_py_dart-0.6.3a5/src/json_builder.rs +152 -0
  26. y_py_dart-0.6.3a5/src/lib.rs +42 -0
  27. y_py_dart-0.6.3a5/src/shared_types.rs +178 -0
  28. y_py_dart-0.6.3a5/src/type_conversions.rs +456 -0
  29. y_py_dart-0.6.3a5/src/y_array.rs +666 -0
  30. y_py_dart-0.6.3a5/src/y_doc.rs +468 -0
  31. y_py_dart-0.6.3a5/src/y_map.rs +647 -0
  32. y_py_dart-0.6.3a5/src/y_text.rs +402 -0
  33. y_py_dart-0.6.3a5/src/y_transaction.rs +310 -0
  34. y_py_dart-0.6.3a5/src/y_xml.rs +1269 -0
  35. y_py_dart-0.6.3a5/tests/test_helper.py +15 -0
  36. y_py_dart-0.6.3a5/tests/test_lexical_parse.py +78 -0
  37. y_py_dart-0.6.3a5/tests/test_type_conversion.py +30 -0
  38. y_py_dart-0.6.3a5/tests/test_y_array.py +401 -0
  39. y_py_dart-0.6.3a5/tests/test_y_doc.py +128 -0
  40. y_py_dart-0.6.3a5/tests/test_y_map.py +284 -0
  41. y_py_dart-0.6.3a5/tests/test_y_text.py +228 -0
  42. y_py_dart-0.6.3a5/tests/test_y_transaction.py +55 -0
  43. y_py_dart-0.6.3a5/tests/test_y_xml.py +304 -0
  44. y_py_dart-0.6.3a5/y_py.pyi +1224 -0
@@ -0,0 +1,41 @@
1
+ name: Tests
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+ branches: [main]
8
+ env:
9
+ CARGO_TERM_COLOR: always
10
+
11
+ jobs:
12
+ test:
13
+ name: Run Python tests on ${{ matrix.os }}
14
+ runs-on: ${{ matrix.os }}
15
+
16
+ strategy:
17
+ matrix:
18
+ os: [ubuntu-latest, windows-latest, macos-latest]
19
+ python-version: ["3.7", "3.11"] # Empty string will trigger a build with the latest python version
20
+ defaults:
21
+ run:
22
+ shell: bash -l {0}
23
+ steps:
24
+ - name: Checkout Repository
25
+ uses: actions/checkout@v3
26
+
27
+ - name: Install micromamba
28
+ uses: mamba-org/setup-micromamba@v1
29
+ with:
30
+ environment-file: environment-dev.yml
31
+ environment-name: ypy
32
+ create-args: python=${{ matrix.python-version }}
33
+
34
+ - name: Install Dependencies
35
+ run: pip install pytest maturin
36
+
37
+ - name: Build Ypy
38
+ run: maturin develop
39
+
40
+ - name: Run Tests
41
+ run: pytest
@@ -0,0 +1,229 @@
1
+ name: Build and Release
2
+
3
+ on:
4
+ release:
5
+ types: [published]
6
+ pull_request:
7
+
8
+ concurrency:
9
+ group: ${{ github.workflow }}-${{ github.ref }}
10
+ cancel-in-progress: true
11
+
12
+ env:
13
+ PACKAGE_NAME: y_py
14
+
15
+ jobs:
16
+ macos:
17
+ runs-on: macos-latest
18
+ steps:
19
+ - uses: actions/checkout@v3
20
+ - uses: actions/setup-python@v4
21
+ with:
22
+ python-version: '3.11'
23
+ architecture: x64
24
+ - uses: dtolnay/rust-toolchain@stable
25
+ - name: Build wheels - x86_64
26
+ uses: PyO3/maturin-action@v1
27
+ with:
28
+ target: x86_64
29
+ args: --release --out dist --sdist -i 3.7 3.8 3.9 3.10 3.11 3.12 pypy3.8 pypy3.9
30
+ - name: Build wheels - universal2
31
+ uses: PyO3/maturin-action@v1
32
+ with:
33
+ args: --release --target universal2-apple-darwin --out dist -i 3.8 3.9 3.10 3.11 3.12 pypy3.8 pypy3.9
34
+ - name: Upload wheels
35
+ uses: actions/upload-artifact@v2
36
+ with:
37
+ name: wheels
38
+ path: dist
39
+
40
+ windows:
41
+ runs-on: windows-latest
42
+ name: windows (${{ matrix.platform.target }})
43
+ strategy:
44
+ matrix:
45
+ platform:
46
+ - target: x64
47
+ interpreter: 3.7 3.8 3.9 3.10 3.11
48
+ - target: x86
49
+ interpreter: 3.7 3.8 3.9 3.10 3.11
50
+ steps:
51
+ - uses: actions/checkout@v3
52
+ - uses: actions/setup-python@v4
53
+ with:
54
+ python-version: '3.11'
55
+ architecture: ${{ matrix.platform.target }}
56
+ - uses: dtolnay/rust-toolchain@stable
57
+ - name: Build wheels
58
+ uses: PyO3/maturin-action@v1
59
+ with:
60
+ target: ${{ matrix.platform.target }}
61
+ args: --release --out dist -i ${{ matrix.platform.interpreter }}
62
+ - name: Test built wheel
63
+ run: |
64
+ pip install y-py-dart --no-index --find-links dist --force-reinstall
65
+ pip install pytest
66
+ pytest
67
+ - name: Upload wheels
68
+ uses: actions/upload-artifact@v2
69
+ with:
70
+ name: wheels
71
+ path: dist
72
+
73
+ linux:
74
+ runs-on: ubuntu-latest
75
+ strategy:
76
+ matrix:
77
+ target: [x86_64, i686]
78
+ steps:
79
+ - uses: actions/checkout@v3
80
+ - uses: actions/setup-python@v4
81
+ with:
82
+ python-version: '3.11'
83
+ architecture: x64
84
+ - name: Build wheels
85
+ uses: PyO3/maturin-action@v1
86
+ with:
87
+ rust-toolchain: stable
88
+ target: ${{ matrix.target }}
89
+ manylinux: auto
90
+ args: --release --out dist -i 3.7 3.8 3.9 3.10 3.11 3.12 pypy3.8 pypy3.9
91
+ - name: Test built wheel
92
+ if: matrix.target == 'x86_64'
93
+ run: |
94
+ pip install y-py-dart --no-index --find-links dist --force-reinstall
95
+ pip install pytest
96
+ pytest
97
+ - name: Upload wheels
98
+ uses: actions/upload-artifact@v2
99
+ with:
100
+ name: wheels
101
+ path: dist
102
+
103
+ linux-cross:
104
+ runs-on: ubuntu-latest
105
+ strategy:
106
+ matrix:
107
+ target: [aarch64, armv7, s390x, ppc64le]
108
+ steps:
109
+ - uses: actions/checkout@v3
110
+ - uses: actions/setup-python@v4
111
+ with:
112
+ python-version: '3.11'
113
+ - name: Build wheels
114
+ uses: PyO3/maturin-action@v1
115
+ with:
116
+ rust-toolchain: stable
117
+ target: ${{ matrix.target }}
118
+ manylinux: auto
119
+ args: --release --out dist -i 3.7 3.8 3.9 3.10 3.11 3.12 pypy3.8 pypy3.9
120
+
121
+ - uses: uraimo/run-on-arch-action@v2.3.0
122
+ if: matrix.target != 'ppc64'
123
+ name: Test built wheel
124
+ with:
125
+ arch: ${{ matrix.target }}
126
+ distro: ubuntu20.04
127
+ githubToken: ${{ github.token }}
128
+ install: |
129
+ apt-get update
130
+ apt-get install -y --no-install-recommends python3 python3-pip
131
+ pip3 install -U pip pytest
132
+ run: |
133
+ pip3 install y-py-dart --no-index --find-links dist/ --force-reinstall
134
+ pytest
135
+
136
+ - name: Upload wheels
137
+ uses: actions/upload-artifact@v3
138
+ with:
139
+ name: wheels
140
+ path: dist
141
+
142
+ wasm:
143
+ runs-on: ubuntu-20.04
144
+ # Pyodide began supporting `micropip.install` from emscripten-compiled binary wheels
145
+ # in Pyodide 0.21.0 (Aug 2022), so no need to build wheels for versions before then.
146
+ # As of Nov 2022, the matrix for emscripten/python versions since then is simple.
147
+ # Update this matrix when new Pyodide versions come out that bump the Python interpreter
148
+ # or emscripten version. Ref: https://pyodide.org/en/stable/project/changelog.html
149
+ strategy:
150
+ matrix:
151
+ python-version: ["3.10.2"]
152
+ emscripten-version: ["3.1.14"]
153
+ steps:
154
+ - uses: actions/checkout@v2
155
+ - uses: actions/setup-python@v2
156
+ with:
157
+ python-version: ${{ matrix.python-version }}
158
+ architecture: x64
159
+ - name: Install Rust
160
+ # if this isn't here, wasm wheel build fails with error: failed to run `rustc` to learn about target-specific information
161
+ uses: actions-rs/toolchain@v1
162
+ with:
163
+ # maturin build will generate args -Z link-native-libraries=no which is only accepted on nightly compiler
164
+ toolchain: nightly
165
+ profile: minimal
166
+ override: true
167
+ - name: Rustup add wasm32 target
168
+ # maturin build --target wasm32-unknown-emscripten requires rust to add that target first
169
+ run: rustup target add wasm32-unknown-emscripten
170
+ - name: Setup emsdk
171
+ uses: mymindstorm/setup-emsdk@v11
172
+ with:
173
+ version: ${{ matrix.emscripten-version }}
174
+ - name: Build wheels
175
+ uses: messense/maturin-action@v1
176
+ with:
177
+ target: wasm32-unknown-emscripten
178
+ args: --release --out wasm_wheel --find-interpreter
179
+ - name: Upload wheels
180
+ uses: actions/upload-artifact@v2
181
+ with:
182
+ name: wasm_wheel
183
+ path: wasm_wheel
184
+
185
+ pypi-release:
186
+ name: Publish to Pypi on Release
187
+ runs-on: ubuntu-latest
188
+ needs:
189
+ - macos
190
+ - windows
191
+ - linux
192
+ - linux-cross
193
+ if: startsWith(github.ref, 'refs/tags/')
194
+ steps:
195
+ - uses: actions/download-artifact@v2
196
+ with:
197
+ name: wheels
198
+ - uses: actions/setup-python@v2
199
+ - name: Publish to PyPi
200
+ env:
201
+ TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
202
+ TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
203
+ run: |
204
+ pip install --upgrade twine
205
+ twine upload --skip-existing *
206
+
207
+ # Can't upload emscripten wheels to Pypi, see https://github.com/pypi/warehouse/issues/10416.
208
+ # For now, this will attach the binary wheels to the Release page in Github. Users can
209
+ # download those into a pyodide environment and micropip.install from there.
210
+ wasm-release:
211
+ name: Attach wasm wheel to Release
212
+ runs-on: ubuntu-latest
213
+ needs:
214
+ - wasm
215
+ if: startsWith(github.ref, 'refs/tags/')
216
+ steps:
217
+ - uses: actions/download-artifact@v3
218
+ with:
219
+ name: wasm_wheel
220
+
221
+ - name: Attach assets to Release
222
+ uses: softprops/action-gh-release@v1
223
+ with:
224
+ files: '*.whl'
225
+ # 'name' (release name) defaults to the tag ref in this action.
226
+ # If release naming pattern changes, will need to configure 'name' here.
227
+
228
+
229
+
@@ -0,0 +1,12 @@
1
+ tests/__pycache__
2
+ debug/
3
+ target/
4
+ perf.data
5
+ perf.data.old
6
+ .vscode
7
+ Cargo.lock
8
+ .pytest_cache
9
+ docs/_*
10
+ .DS_Store
11
+ *.pyc
12
+ dist