Commit 7386087
Add rust tests (#271)
* feat(rust): make PyO3 optional to fix Python 3.14 fuzz linking
- Make pyo3 dependency optional behind 'python' feature flag
- Add rlib crate-type to support both cdylib (Python) and rlib (fuzzing)
- Gate all Python-specific code with #[cfg(feature = "python")]
- Make pure Rust functions (escape_xml, wrap_cdata, etc.) public for fuzzing
- Add comprehensive unit tests for XML utility functions
Fixes linker error with Python 3.14 where PyUnicode_DATA and
PyUnicode_KIND symbols are now inline macros, not exported functions.
Fuzz targets can now build without linking against Python.
Amp-Thread-ID: https://ampcode.com/threads/T-019c0425-ac62-76d8-9d59-4d6aba3edf45
Co-authored-by: Amp <[email protected]>
* ci: add Rust unit tests to CI workflow
Amp-Thread-ID: https://ampcode.com/threads/T-019c0425-ac62-76d8-9d59-4d6aba3edf45
Co-authored-by: Amp <[email protected]>
* refactor: reformat code with rust fmt
* fix: improve fuzz test assertion for make_attr_string
Use more specific pattern matching (` key="`) instead of just checking
if key exists as substring. This avoids false positives with overlapping
keys (e.g. 'a' vs 'aa') or malformed attribute formatting.
Suggested-by: sourcery-ai
Amp-Thread-ID: https://ampcode.com/threads/T-019c0425-ac62-76d8-9d59-4d6aba3edf45
Co-authored-by: Amp <[email protected]>
* Update benchmarks with latest results (Jan 28, 2026)
Amp-Thread-ID: https://ampcode.com/threads/T-019c0438-3a17-7033-9c8b-a5dd94144dd5
Co-authored-by: Amp <[email protected]>
* fix: move dev dependencies to optional-dependencies
pytest, pytest-cov, coverage, and setuptools were incorrectly listed
as runtime dependencies, causing them to be installed with
'pip install json2xml'. Moved them to [project.optional-dependencies]
under 'dev' group, so users get only defusedxml, urllib3, and xmltodict
at runtime. Developers can install with 'pip install json2xml[dev]'.
fixes #272
* fix: update deps
* fix: deps
* fix: update
---------
Co-authored-by: Amp <[email protected]>1 parent 94a60ab commit 7386087
File tree
4 files changed
+51
-50
lines changed- .github/workflows
4 files changed
+51
-50
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
47 | | - | |
| 47 | + | |
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
| 9 | + | |
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
| 17 | + | |
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | | - | |
| 25 | + | |
26 | 26 | | |
27 | | - | |
28 | | - | |
| 27 | + | |
| 28 | + | |
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
51 | 51 | | |
52 | | - | |
| 52 | + | |
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
59 | | - | |
| 59 | + | |
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
64 | | - | |
| 64 | + | |
65 | 65 | | |
66 | 66 | | |
67 | | - | |
68 | | - | |
| 67 | + | |
| 68 | + | |
69 | 69 | | |
70 | 70 | | |
71 | | - | |
| 71 | + | |
72 | 72 | | |
73 | | - | |
74 | | - | |
75 | | - | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
76 | 78 | | |
77 | 79 | | |
78 | 80 | | |
79 | | - | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
80 | 84 | | |
81 | 85 | | |
82 | 86 | | |
| |||
85 | 89 | | |
86 | 90 | | |
87 | 91 | | |
88 | | - | |
89 | | - | |
90 | | - | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
91 | 95 | | |
92 | 96 | | |
93 | 97 | | |
| |||
104 | 108 | | |
105 | 109 | | |
106 | 110 | | |
107 | | - | |
| 111 | + | |
108 | 112 | | |
109 | 113 | | |
110 | 114 | | |
| |||
130 | 134 | | |
131 | 135 | | |
132 | 136 | | |
133 | | - | |
| 137 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | 34 | | |
39 | 35 | | |
40 | 36 | | |
| |||
47 | 43 | | |
48 | 44 | | |
49 | 45 | | |
50 | | - | |
| 46 | + | |
51 | 47 | | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
52 | 51 | | |
53 | 52 | | |
54 | 53 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
0 commit comments