ddi-l-native 0.2.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.
- ddi_l_native-0.2.0/Cargo.lock +303 -0
- ddi_l_native-0.2.0/Cargo.toml +29 -0
- ddi_l_native-0.2.0/PKG-INFO +30 -0
- ddi_l_native-0.2.0/README.md +17 -0
- ddi_l_native-0.2.0/fallback/README.md +9 -0
- ddi_l_native-0.2.0/fallback/ddi_l_native/__init__.py +9 -0
- ddi_l_native-0.2.0/fallback/pyproject.toml +20 -0
- ddi_l_native-0.2.0/pyproject.toml +24 -0
- ddi_l_native-0.2.0/python/ddi_l_native/__init__.py +41 -0
- ddi_l_native-0.2.0/src/attrib.rs +249 -0
- ddi_l_native-0.2.0/src/digest.rs +97 -0
- ddi_l_native-0.2.0/src/element.rs +791 -0
- ddi_l_native-0.2.0/src/lib.rs +155 -0
- ddi_l_native-0.2.0/src/parse.rs +886 -0
- ddi_l_native-0.2.0/src/table.rs +412 -0
- ddi_l_native-0.2.0/src/tree.rs +393 -0
- ddi_l_native-0.2.0/src/validate.rs +1059 -0
|
@@ -0,0 +1,303 @@
|
|
|
1
|
+
# This file is automatically @generated by Cargo.
|
|
2
|
+
# It is not intended for manual editing.
|
|
3
|
+
version = 4
|
|
4
|
+
|
|
5
|
+
[[package]]
|
|
6
|
+
name = "aho-corasick"
|
|
7
|
+
version = "1.1.5"
|
|
8
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
9
|
+
checksum = "c982642fa9e8606056828ee9a8505737230110bb1099153c79efe865c59d12ba"
|
|
10
|
+
dependencies = [
|
|
11
|
+
"memchr",
|
|
12
|
+
]
|
|
13
|
+
|
|
14
|
+
[[package]]
|
|
15
|
+
name = "blake2"
|
|
16
|
+
version = "0.10.6"
|
|
17
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
18
|
+
checksum = "46502ad458c9a52b69d4d4d32775c788b7a1b85e8bc9d482d92250fc0e3f8efe"
|
|
19
|
+
dependencies = [
|
|
20
|
+
"digest",
|
|
21
|
+
]
|
|
22
|
+
|
|
23
|
+
[[package]]
|
|
24
|
+
name = "block-buffer"
|
|
25
|
+
version = "0.10.4"
|
|
26
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
27
|
+
checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71"
|
|
28
|
+
dependencies = [
|
|
29
|
+
"generic-array",
|
|
30
|
+
]
|
|
31
|
+
|
|
32
|
+
[[package]]
|
|
33
|
+
name = "crypto-common"
|
|
34
|
+
version = "0.1.7"
|
|
35
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
36
|
+
checksum = "78c8292055d1c1df0cce5d180393dc8cce0abec0a7102adb6c7b1eef6016d60a"
|
|
37
|
+
dependencies = [
|
|
38
|
+
"generic-array",
|
|
39
|
+
"typenum",
|
|
40
|
+
]
|
|
41
|
+
|
|
42
|
+
[[package]]
|
|
43
|
+
name = "ddi-l-native"
|
|
44
|
+
version = "0.2.0"
|
|
45
|
+
dependencies = [
|
|
46
|
+
"blake2",
|
|
47
|
+
"memchr",
|
|
48
|
+
"pyo3",
|
|
49
|
+
"regex",
|
|
50
|
+
"serde",
|
|
51
|
+
"serde_json",
|
|
52
|
+
]
|
|
53
|
+
|
|
54
|
+
[[package]]
|
|
55
|
+
name = "digest"
|
|
56
|
+
version = "0.10.7"
|
|
57
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
58
|
+
checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292"
|
|
59
|
+
dependencies = [
|
|
60
|
+
"block-buffer",
|
|
61
|
+
"crypto-common",
|
|
62
|
+
"subtle",
|
|
63
|
+
]
|
|
64
|
+
|
|
65
|
+
[[package]]
|
|
66
|
+
name = "generic-array"
|
|
67
|
+
version = "0.14.7"
|
|
68
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
69
|
+
checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a"
|
|
70
|
+
dependencies = [
|
|
71
|
+
"typenum",
|
|
72
|
+
"version_check",
|
|
73
|
+
]
|
|
74
|
+
|
|
75
|
+
[[package]]
|
|
76
|
+
name = "heck"
|
|
77
|
+
version = "0.5.0"
|
|
78
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
79
|
+
checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea"
|
|
80
|
+
|
|
81
|
+
[[package]]
|
|
82
|
+
name = "itoa"
|
|
83
|
+
version = "1.0.18"
|
|
84
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
85
|
+
checksum = "8f42a60cbdf9a97f5d2305f08a87dc4e09308d1276d28c869c684d7777685682"
|
|
86
|
+
|
|
87
|
+
[[package]]
|
|
88
|
+
name = "libc"
|
|
89
|
+
version = "0.2.191"
|
|
90
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
91
|
+
checksum = "65cd87c9a6d60536580b316ad985726104730a5151c99845f2490428ef91240a"
|
|
92
|
+
|
|
93
|
+
[[package]]
|
|
94
|
+
name = "memchr"
|
|
95
|
+
version = "2.8.3"
|
|
96
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
97
|
+
checksum = "cf8baf1c55e62ffcace7a9f06f4bd9cd3f0c4beb022d3b367256b91b87513d98"
|
|
98
|
+
|
|
99
|
+
[[package]]
|
|
100
|
+
name = "once_cell"
|
|
101
|
+
version = "1.21.4"
|
|
102
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
103
|
+
checksum = "9f7c3e4beb33f85d45ae3e3a1792185706c8e16d043238c593331cc7cd313b50"
|
|
104
|
+
|
|
105
|
+
[[package]]
|
|
106
|
+
name = "portable-atomic"
|
|
107
|
+
version = "1.15.0"
|
|
108
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
109
|
+
checksum = "05c8b63e8d9609db387f0324918f81d68fe27748f084ef092fb35954d0539a85"
|
|
110
|
+
|
|
111
|
+
[[package]]
|
|
112
|
+
name = "proc-macro2"
|
|
113
|
+
version = "1.0.107"
|
|
114
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
115
|
+
checksum = "985e7ec9bb745e6ce6535b544d84d6cd6f7ad8bd711c398938ae983b91a766d9"
|
|
116
|
+
dependencies = [
|
|
117
|
+
"unicode-ident",
|
|
118
|
+
]
|
|
119
|
+
|
|
120
|
+
[[package]]
|
|
121
|
+
name = "pyo3"
|
|
122
|
+
version = "0.30.1"
|
|
123
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
124
|
+
checksum = "229ca13b8a15bb0d1487b81ab975bfcd97513416499a8312011b6036e42e0de4"
|
|
125
|
+
dependencies = [
|
|
126
|
+
"libc",
|
|
127
|
+
"once_cell",
|
|
128
|
+
"portable-atomic",
|
|
129
|
+
"pyo3-build-config",
|
|
130
|
+
"pyo3-ffi",
|
|
131
|
+
"pyo3-macros",
|
|
132
|
+
]
|
|
133
|
+
|
|
134
|
+
[[package]]
|
|
135
|
+
name = "pyo3-build-config"
|
|
136
|
+
version = "0.30.1"
|
|
137
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
138
|
+
checksum = "70130e2b6dd1ee589a8788026a429561ca5c40fa7a2fa7914c2282eddae24700"
|
|
139
|
+
dependencies = [
|
|
140
|
+
"target-lexicon",
|
|
141
|
+
]
|
|
142
|
+
|
|
143
|
+
[[package]]
|
|
144
|
+
name = "pyo3-ffi"
|
|
145
|
+
version = "0.30.1"
|
|
146
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
147
|
+
checksum = "5e7ff73c555c286d212d4ce7e5fbda845a973c4f61bd5f160f5f2c3c2a04d1c4"
|
|
148
|
+
dependencies = [
|
|
149
|
+
"libc",
|
|
150
|
+
"pyo3-build-config",
|
|
151
|
+
]
|
|
152
|
+
|
|
153
|
+
[[package]]
|
|
154
|
+
name = "pyo3-macros"
|
|
155
|
+
version = "0.30.1"
|
|
156
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
157
|
+
checksum = "c46d2e5862c7bb8207e3b639f713dda3c499933444784154c11d013c5a691b60"
|
|
158
|
+
dependencies = [
|
|
159
|
+
"proc-macro2",
|
|
160
|
+
"pyo3-macros-backend",
|
|
161
|
+
"quote",
|
|
162
|
+
"syn",
|
|
163
|
+
]
|
|
164
|
+
|
|
165
|
+
[[package]]
|
|
166
|
+
name = "pyo3-macros-backend"
|
|
167
|
+
version = "0.30.1"
|
|
168
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
169
|
+
checksum = "38b89f066f2ae72a2aef52d1537ca2fcd104440ebfadee06e97aa90738a25b9b"
|
|
170
|
+
dependencies = [
|
|
171
|
+
"heck",
|
|
172
|
+
"proc-macro2",
|
|
173
|
+
"quote",
|
|
174
|
+
"syn",
|
|
175
|
+
]
|
|
176
|
+
|
|
177
|
+
[[package]]
|
|
178
|
+
name = "quote"
|
|
179
|
+
version = "1.0.47"
|
|
180
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
181
|
+
checksum = "1fbf4db142a473a8d80c26bbf18454ed458bf8d26c8219c331daecfdbd079001"
|
|
182
|
+
dependencies = [
|
|
183
|
+
"proc-macro2",
|
|
184
|
+
]
|
|
185
|
+
|
|
186
|
+
[[package]]
|
|
187
|
+
name = "regex"
|
|
188
|
+
version = "1.13.1"
|
|
189
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
190
|
+
checksum = "f020237b6c8eed93db2e2cb53c00c60a8e1bc73da7d073199a1180401450218d"
|
|
191
|
+
dependencies = [
|
|
192
|
+
"aho-corasick",
|
|
193
|
+
"memchr",
|
|
194
|
+
"regex-automata",
|
|
195
|
+
"regex-syntax",
|
|
196
|
+
]
|
|
197
|
+
|
|
198
|
+
[[package]]
|
|
199
|
+
name = "regex-automata"
|
|
200
|
+
version = "0.4.18"
|
|
201
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
202
|
+
checksum = "ad8553b9b26413251cbf30e620595c7a41b3887f03da04579c0e6b0d6a06b4b2"
|
|
203
|
+
dependencies = [
|
|
204
|
+
"aho-corasick",
|
|
205
|
+
"memchr",
|
|
206
|
+
"regex-syntax",
|
|
207
|
+
]
|
|
208
|
+
|
|
209
|
+
[[package]]
|
|
210
|
+
name = "regex-syntax"
|
|
211
|
+
version = "0.8.11"
|
|
212
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
213
|
+
checksum = "d6f6ff9a378485b298a5286656da665ba74413d36db0979633275d2e708145d4"
|
|
214
|
+
|
|
215
|
+
[[package]]
|
|
216
|
+
name = "serde"
|
|
217
|
+
version = "1.0.229"
|
|
218
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
219
|
+
checksum = "4148590afebada386688f18773da617792bf2ef03ffc1e4cbd2b1d45b023e0ba"
|
|
220
|
+
dependencies = [
|
|
221
|
+
"serde_core",
|
|
222
|
+
"serde_derive",
|
|
223
|
+
]
|
|
224
|
+
|
|
225
|
+
[[package]]
|
|
226
|
+
name = "serde_core"
|
|
227
|
+
version = "1.0.229"
|
|
228
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
229
|
+
checksum = "67dca2c9c51e58a4791a4b1ed58308b39c64224d349a935ab5039aa360942a48"
|
|
230
|
+
dependencies = [
|
|
231
|
+
"serde_derive",
|
|
232
|
+
]
|
|
233
|
+
|
|
234
|
+
[[package]]
|
|
235
|
+
name = "serde_derive"
|
|
236
|
+
version = "1.0.229"
|
|
237
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
238
|
+
checksum = "e7a5d71263a5a7d47b41f6b3f06ba276f10cc18b0931f1799f710578e2309348"
|
|
239
|
+
dependencies = [
|
|
240
|
+
"proc-macro2",
|
|
241
|
+
"quote",
|
|
242
|
+
"syn",
|
|
243
|
+
]
|
|
244
|
+
|
|
245
|
+
[[package]]
|
|
246
|
+
name = "serde_json"
|
|
247
|
+
version = "1.0.154"
|
|
248
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
249
|
+
checksum = "e7e9cc8b1b85264074fbcc02a88680c4096b1e47df8f739dceb03bf482f04bd6"
|
|
250
|
+
dependencies = [
|
|
251
|
+
"itoa",
|
|
252
|
+
"memchr",
|
|
253
|
+
"serde",
|
|
254
|
+
"serde_core",
|
|
255
|
+
"zmij",
|
|
256
|
+
]
|
|
257
|
+
|
|
258
|
+
[[package]]
|
|
259
|
+
name = "subtle"
|
|
260
|
+
version = "2.6.1"
|
|
261
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
262
|
+
checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292"
|
|
263
|
+
|
|
264
|
+
[[package]]
|
|
265
|
+
name = "syn"
|
|
266
|
+
version = "3.0.9"
|
|
267
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
268
|
+
checksum = "d78c8dee4c7bf0e14673097256fed6142ce9d3b85a408189d07482442145823b"
|
|
269
|
+
dependencies = [
|
|
270
|
+
"proc-macro2",
|
|
271
|
+
"quote",
|
|
272
|
+
"unicode-ident",
|
|
273
|
+
]
|
|
274
|
+
|
|
275
|
+
[[package]]
|
|
276
|
+
name = "target-lexicon"
|
|
277
|
+
version = "0.13.5"
|
|
278
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
279
|
+
checksum = "adb6935a6f5c20170eeceb1a3835a49e12e19d792f6dd344ccc76a985ca5a6ca"
|
|
280
|
+
|
|
281
|
+
[[package]]
|
|
282
|
+
name = "typenum"
|
|
283
|
+
version = "1.20.1"
|
|
284
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
285
|
+
checksum = "b6f5e870be6c3b371b77fe0ee0bafb859fa4964b4404c27de1d380043c4dda20"
|
|
286
|
+
|
|
287
|
+
[[package]]
|
|
288
|
+
name = "unicode-ident"
|
|
289
|
+
version = "1.0.27"
|
|
290
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
291
|
+
checksum = "a2c754d6c33795a1c324727428e5a7dedb5b06195f9890bdbcba760d3e246563"
|
|
292
|
+
|
|
293
|
+
[[package]]
|
|
294
|
+
name = "version_check"
|
|
295
|
+
version = "0.9.5"
|
|
296
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
297
|
+
checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a"
|
|
298
|
+
|
|
299
|
+
[[package]]
|
|
300
|
+
name = "zmij"
|
|
301
|
+
version = "1.0.23"
|
|
302
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
303
|
+
checksum = "29666d0abbfad1e3dc4dcf6144730dd3a3ab225bbbdac83319345b1b44ccfc1b"
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
[package]
|
|
2
|
+
name = "ddi-l-native"
|
|
3
|
+
version = "0.2.0"
|
|
4
|
+
edition = "2021"
|
|
5
|
+
rust-version = "1.85"
|
|
6
|
+
license = "MIT"
|
|
7
|
+
description = "Native XML core for ddi-l: a fast parser and an element tree that keeps its source"
|
|
8
|
+
publish = false
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
|
|
11
|
+
[lib]
|
|
12
|
+
name = "_core"
|
|
13
|
+
crate-type = ["cdylib", "rlib"]
|
|
14
|
+
|
|
15
|
+
[dependencies]
|
|
16
|
+
pyo3 = { version = "0.30", features = ["abi3-py311"] }
|
|
17
|
+
blake2 = "0.10"
|
|
18
|
+
memchr = "2"
|
|
19
|
+
regex = { version = "1", default-features = false, features = ["std", "unicode-perl", "unicode-case"] }
|
|
20
|
+
serde = { version = "1", features = ["derive"] }
|
|
21
|
+
serde_json = "1"
|
|
22
|
+
|
|
23
|
+
[features]
|
|
24
|
+
default = ["extension-module"]
|
|
25
|
+
extension-module = ["pyo3/extension-module"]
|
|
26
|
+
|
|
27
|
+
[profile.release]
|
|
28
|
+
lto = "fat"
|
|
29
|
+
codegen-units = 1
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: ddi-l-native
|
|
3
|
+
Version: 0.2.0
|
|
4
|
+
Classifier: Programming Language :: Rust
|
|
5
|
+
Classifier: Programming Language :: Python :: Implementation :: CPython
|
|
6
|
+
Classifier: Topic :: Text Processing :: Markup :: XML
|
|
7
|
+
Summary: Native XML core for ddi-l: a fast parser and an element tree that keeps its source
|
|
8
|
+
License-Expression: MIT
|
|
9
|
+
Requires-Python: >=3.11
|
|
10
|
+
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
|
|
11
|
+
Project-URL: Homepage, https://github.com/pbisson44/ddi
|
|
12
|
+
|
|
13
|
+
# ddi-l-native
|
|
14
|
+
|
|
15
|
+
The native XML core for [ddi-l](https://github.com/pbisson44/ddi).
|
|
16
|
+
`pip install ddi-l` installs it, and ddi-l uses it to read and write XML.
|
|
17
|
+
Compiled wheels exist for Linux (x86_64, aarch64), macOS and Windows (x64), for
|
|
18
|
+
CPython 3.11 and later. Anywhere else pip installs a pure-Python stand-in
|
|
19
|
+
with the same name and version, and ddi-l uses lxml or the standard library.
|
|
20
|
+
|
|
21
|
+
It parses XML into a tree whose elements behave like those of Python's
|
|
22
|
+
`xml.etree.ElementTree`, and keeps the bytes each element was read from, so
|
|
23
|
+
ddi-l writes an unchanged element back exactly as it was read.
|
|
24
|
+
|
|
25
|
+
The parser refuses document type declarations, so it expands no entities
|
|
26
|
+
other than the five XML defines and never fetches anything.
|
|
27
|
+
|
|
28
|
+
Build it from this directory with `maturin build --release`, and the stand-in
|
|
29
|
+
with `python -m build --wheel fallback`.
|
|
30
|
+
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# ddi-l-native
|
|
2
|
+
|
|
3
|
+
The native XML core for [ddi-l](https://github.com/pbisson44/ddi).
|
|
4
|
+
`pip install ddi-l` installs it, and ddi-l uses it to read and write XML.
|
|
5
|
+
Compiled wheels exist for Linux (x86_64, aarch64), macOS and Windows (x64), for
|
|
6
|
+
CPython 3.11 and later. Anywhere else pip installs a pure-Python stand-in
|
|
7
|
+
with the same name and version, and ddi-l uses lxml or the standard library.
|
|
8
|
+
|
|
9
|
+
It parses XML into a tree whose elements behave like those of Python's
|
|
10
|
+
`xml.etree.ElementTree`, and keeps the bytes each element was read from, so
|
|
11
|
+
ddi-l writes an unchanged element back exactly as it was read.
|
|
12
|
+
|
|
13
|
+
The parser refuses document type declarations, so it expands no entities
|
|
14
|
+
other than the five XML defines and never fetches anything.
|
|
15
|
+
|
|
16
|
+
Build it from this directory with `maturin build --release`, and the stand-in
|
|
17
|
+
with `python -m build --wheel fallback`.
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# ddi-l-native (stand-in)
|
|
2
|
+
|
|
3
|
+
This wheel stands in for [ddi-l](https://github.com/pbisson44/ddi)'s native XML
|
|
4
|
+
core on a platform with no compiled `ddi-l-native` wheel. It contains no code
|
|
5
|
+
ddi-l runs: ddi-l sees that the native core is missing and reads and writes XML
|
|
6
|
+
with lxml or the standard library, so installing ddi-l never compiles Rust.
|
|
7
|
+
|
|
8
|
+
Compiled wheels exist for Linux (x86_64, aarch64), macOS and Windows (x64), for
|
|
9
|
+
CPython 3.11 and later; pip prefers them wherever they fit.
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"""Stand-in for ddi-l's native XML core, on a platform with no compiled wheel.
|
|
2
|
+
|
|
3
|
+
ddi-l reads and writes XML with lxml or the standard library instead.
|
|
4
|
+
"""
|
|
5
|
+
|
|
6
|
+
raise ModuleNotFoundError(
|
|
7
|
+
"ddi-l-native has no compiled core for this platform",
|
|
8
|
+
name="ddi_l_native",
|
|
9
|
+
)
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# The stand-in for ddi-l-native on platforms with no compiled wheel (Alpine,
|
|
2
|
+
# Windows on ARM, PyPy, free-threaded Python...). It is a pure-Python wheel
|
|
3
|
+
# with the same name and version: pip prefers a compiled wheel that fits and
|
|
4
|
+
# takes this one otherwise, so installing ddi-l never compiles Rust. Importing
|
|
5
|
+
# it raises ModuleNotFoundError, and ddi-l uses lxml or the standard library.
|
|
6
|
+
# It is published as a wheel only; the sdist is the real one, in native/.
|
|
7
|
+
[build-system]
|
|
8
|
+
requires = ["poetry-core>=2.0.0,<3"]
|
|
9
|
+
build-backend = "poetry.core.masonry.api"
|
|
10
|
+
|
|
11
|
+
[project]
|
|
12
|
+
name = "ddi-l-native"
|
|
13
|
+
version = "0.2.0"
|
|
14
|
+
description = "Stand-in for ddi-l's native XML core where no compiled wheel exists"
|
|
15
|
+
readme = "README.md"
|
|
16
|
+
requires-python = ">=3.11"
|
|
17
|
+
license = "MIT"
|
|
18
|
+
|
|
19
|
+
[tool.poetry]
|
|
20
|
+
packages = [{ include = "ddi_l_native" }]
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["maturin>=1.9,<2"]
|
|
3
|
+
build-backend = "maturin"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "ddi-l-native"
|
|
7
|
+
version = "0.2.0"
|
|
8
|
+
description = "Native XML core for ddi-l: a fast parser and an element tree that keeps its source"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
license = "MIT"
|
|
11
|
+
requires-python = ">=3.11"
|
|
12
|
+
classifiers = [
|
|
13
|
+
"Programming Language :: Rust",
|
|
14
|
+
"Programming Language :: Python :: Implementation :: CPython",
|
|
15
|
+
"Topic :: Text Processing :: Markup :: XML",
|
|
16
|
+
]
|
|
17
|
+
|
|
18
|
+
[project.urls]
|
|
19
|
+
Homepage = "https://github.com/pbisson44/ddi"
|
|
20
|
+
|
|
21
|
+
[tool.maturin]
|
|
22
|
+
python-source = "python"
|
|
23
|
+
module-name = "ddi_l_native._core"
|
|
24
|
+
features = ["pyo3/extension-module"]
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"""Native XML core for ddi-l.
|
|
2
|
+
|
|
3
|
+
``pip install ddi-l`` installs it wherever a compiled wheel exists, and ddi-l
|
|
4
|
+
uses it: a hardened parser that builds a tree whose elements behave like
|
|
5
|
+
``xml.etree.ElementTree``'s and keep the bytes they were read from.
|
|
6
|
+
"""
|
|
7
|
+
|
|
8
|
+
from collections.abc import MutableMapping
|
|
9
|
+
|
|
10
|
+
from ._core import (
|
|
11
|
+
Attrib,
|
|
12
|
+
Element,
|
|
13
|
+
Index,
|
|
14
|
+
Schema,
|
|
15
|
+
Span,
|
|
16
|
+
SubElement,
|
|
17
|
+
Table,
|
|
18
|
+
digest,
|
|
19
|
+
parent,
|
|
20
|
+
parse,
|
|
21
|
+
source_position,
|
|
22
|
+
uses_namespace,
|
|
23
|
+
)
|
|
24
|
+
|
|
25
|
+
# An element's attributes are a live mapping, as ``Element.attrib`` is.
|
|
26
|
+
MutableMapping.register(Attrib)
|
|
27
|
+
|
|
28
|
+
__all__ = [
|
|
29
|
+
"Attrib",
|
|
30
|
+
"Element",
|
|
31
|
+
"Index",
|
|
32
|
+
"Schema",
|
|
33
|
+
"Span",
|
|
34
|
+
"SubElement",
|
|
35
|
+
"Table",
|
|
36
|
+
"digest",
|
|
37
|
+
"parent",
|
|
38
|
+
"parse",
|
|
39
|
+
"source_position",
|
|
40
|
+
"uses_namespace",
|
|
41
|
+
]
|