pyfracturedjson 2.2.0__tar.gz → 2.2.1__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 (38) hide show
  1. pyfracturedjson-2.2.1/.github/workflows/publish.yaml +36 -0
  2. {pyfracturedjson-2.2.0 → pyfracturedjson-2.2.1}/CHANGELOG.md +5 -0
  3. {pyfracturedjson-2.2.0 → pyfracturedjson-2.2.1}/Cargo.lock +11 -11
  4. {pyfracturedjson-2.2.0 → pyfracturedjson-2.2.1}/Cargo.toml +7 -5
  5. {pyfracturedjson-2.2.0 → pyfracturedjson-2.2.1}/PKG-INFO +11 -3
  6. {pyfracturedjson-2.2.0 → pyfracturedjson-2.2.1}/README.md +10 -2
  7. {pyfracturedjson-2.2.0 → pyfracturedjson-2.2.1}/fracturedjson/__init__.py +6 -2
  8. {pyfracturedjson-2.2.0 → pyfracturedjson-2.2.1}/src/lib.rs +1 -1
  9. pyfracturedjson-2.2.0/.github/workflows/publish.yml +0 -265
  10. {pyfracturedjson-2.2.0 → pyfracturedjson-2.2.1}/.gitignore +0 -0
  11. {pyfracturedjson-2.2.0 → pyfracturedjson-2.2.1}/LICENSE +0 -0
  12. {pyfracturedjson-2.2.0 → pyfracturedjson-2.2.1}/fracturedjson/_rust_wrapper.pyi +0 -0
  13. {pyfracturedjson-2.2.0 → pyfracturedjson-2.2.1}/pyproject.toml +0 -0
  14. {pyfracturedjson-2.2.0 → pyfracturedjson-2.2.1}/tests/JSONs/compact_array_complexity_-1.json +0 -0
  15. {pyfracturedjson-2.2.0 → pyfracturedjson-2.2.1}/tests/JSONs/compact_array_complexity_0.json +0 -0
  16. {pyfracturedjson-2.2.0 → pyfracturedjson-2.2.1}/tests/JSONs/compact_array_complexity_1.json +0 -0
  17. {pyfracturedjson-2.2.0 → pyfracturedjson-2.2.1}/tests/JSONs/default_settings.json +0 -0
  18. {pyfracturedjson-2.2.0 → pyfracturedjson-2.2.1}/tests/JSONs/indent_2.json +0 -0
  19. {pyfracturedjson-2.2.0 → pyfracturedjson-2.2.1}/tests/JSONs/indent_3.json +0 -0
  20. {pyfracturedjson-2.2.0 → pyfracturedjson-2.2.1}/tests/JSONs/inline_complexity_-1.json +0 -0
  21. {pyfracturedjson-2.2.0 → pyfracturedjson-2.2.1}/tests/JSONs/inline_complexity_0.json +0 -0
  22. {pyfracturedjson-2.2.0 → pyfracturedjson-2.2.1}/tests/JSONs/inline_complexity_1.json +0 -0
  23. {pyfracturedjson-2.2.0 → pyfracturedjson-2.2.1}/tests/JSONs/line_len_100.json +0 -0
  24. {pyfracturedjson-2.2.0 → pyfracturedjson-2.2.1}/tests/JSONs/line_len_40.json +0 -0
  25. {pyfracturedjson-2.2.0 → pyfracturedjson-2.2.1}/tests/JSONs/max_prop_name_padding_0.json +0 -0
  26. {pyfracturedjson-2.2.0 → pyfracturedjson-2.2.1}/tests/JSONs/max_prop_name_padding_10.json +0 -0
  27. {pyfracturedjson-2.2.0 → pyfracturedjson-2.2.1}/tests/JSONs/max_prop_name_padding_24.json +0 -0
  28. {pyfracturedjson-2.2.0 → pyfracturedjson-2.2.1}/tests/JSONs/number_list_alignment_decimal.json +0 -0
  29. {pyfracturedjson-2.2.0 → pyfracturedjson-2.2.1}/tests/JSONs/number_list_alignment_left.json +0 -0
  30. {pyfracturedjson-2.2.0 → pyfracturedjson-2.2.1}/tests/JSONs/number_list_alignment_normalize.json +0 -0
  31. {pyfracturedjson-2.2.0 → pyfracturedjson-2.2.1}/tests/JSONs/number_list_alignment_right.json +0 -0
  32. {pyfracturedjson-2.2.0 → pyfracturedjson-2.2.1}/tests/JSONs/table_row_complexity_-1.json +0 -0
  33. {pyfracturedjson-2.2.0 → pyfracturedjson-2.2.1}/tests/JSONs/table_row_complexity_0.json +0 -0
  34. {pyfracturedjson-2.2.0 → pyfracturedjson-2.2.1}/tests/JSONs/table_row_complexity_1.json +0 -0
  35. {pyfracturedjson-2.2.0 → pyfracturedjson-2.2.1}/tests/common.py +0 -0
  36. {pyfracturedjson-2.2.0 → pyfracturedjson-2.2.1}/tests/test_basic_output.py +0 -0
  37. {pyfracturedjson-2.2.0 → pyfracturedjson-2.2.1}/tests/test_builtin_wrapper.py +0 -0
  38. {pyfracturedjson-2.2.0 → pyfracturedjson-2.2.1}/uv.lock +0 -0
@@ -0,0 +1,36 @@
1
+ name: publish
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - 'v[0-9]+.[0-9]+.[0-9]+'
7
+ branches:
8
+ - dev
9
+ - develop
10
+
11
+ jobs:
12
+ publish:
13
+ permissions:
14
+ id-token: write
15
+ contents: write
16
+ attestations: write
17
+ uses: g-b-f/workflows/.github/workflows/maturin_publish.yaml@v2
18
+ with:
19
+ package-name: pyFracturedJSON
20
+ smoke-test-script: |
21
+ from fracturedjson import dumps
22
+
23
+ expected="""{
24
+ "abcd" : "abcd",
25
+ "long_list": [
26
+ "thing_0", "thing_1", "thing_2", "thing_3", "thing_4", "thing_5", "thing_6", "thing_7", "thing_8",
27
+ "thing_9", "thing_10", "thing_11", "thing_12", "thing_13", "thing_14", "thing_15", "thing_16", "thing_17",
28
+ "thing_18", "thing_19"
29
+ ]
30
+ }
31
+ """
32
+ long_list = [f"thing_{i}" for i in range(20)]
33
+ actual = dumps({"abcd": "abcd", "long_list": long_list})
34
+ assert actual == expected, f"unexpected format:\n\nexpected:\n{expected}\nactual:\n{actual}"
35
+ secrets:
36
+ PYPI_API_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
@@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file.
4
4
 
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
6
6
 
7
+ ## [2.2.0] - 2026-06-18
8
+
9
+ ### Added
10
+
11
+ - `max_prop_name_padding` option
7
12
 
8
13
  ## [2.1.1] - 2026-06-03
9
14
 
@@ -168,7 +168,7 @@ dependencies = [
168
168
 
169
169
  [[package]]
170
170
  name = "pyfracturedjson"
171
- version = "2.2.0"
171
+ version = "2.2.1"
172
172
  dependencies = [
173
173
  "fracturedjson",
174
174
  "pyo3",
@@ -176,9 +176,9 @@ dependencies = [
176
176
 
177
177
  [[package]]
178
178
  name = "pyo3"
179
- version = "0.29.0"
179
+ version = "0.29.3"
180
180
  source = "registry+https://github.com/rust-lang/crates.io-index"
181
- checksum = "cd274650b21d4bfc26a0a47587962c1edb425f69287324355cd040c3ea66071c"
181
+ checksum = "700d18fa267b73b9b521fd7e13580e2f446916f176cacee1ab63fcc8191f1655"
182
182
  dependencies = [
183
183
  "libc",
184
184
  "once_cell",
@@ -190,18 +190,18 @@ dependencies = [
190
190
 
191
191
  [[package]]
192
192
  name = "pyo3-build-config"
193
- version = "0.29.0"
193
+ version = "0.29.3"
194
194
  source = "registry+https://github.com/rust-lang/crates.io-index"
195
- checksum = "c5e2a7d2f0d013342f295c048ad19237add5154a55b1c5a254c0ec93d4109078"
195
+ checksum = "7b3fc0c4d08f6bb10e71fe39dfb9e2f59c6eb6854e22ec8092f50c69a4499adb"
196
196
  dependencies = [
197
197
  "target-lexicon",
198
198
  ]
199
199
 
200
200
  [[package]]
201
201
  name = "pyo3-ffi"
202
- version = "0.29.0"
202
+ version = "0.29.3"
203
203
  source = "registry+https://github.com/rust-lang/crates.io-index"
204
- checksum = "ca85c467da1bbc8d866eea5deff9cf29ea5f7785054a17da36e65bda9c05845b"
204
+ checksum = "dfc0b8e19df29aad7086cf977bb0c2a2f143e30567eb113e9cf72b62ca698330"
205
205
  dependencies = [
206
206
  "libc",
207
207
  "pyo3-build-config",
@@ -209,9 +209,9 @@ dependencies = [
209
209
 
210
210
  [[package]]
211
211
  name = "pyo3-macros"
212
- version = "0.29.0"
212
+ version = "0.29.3"
213
213
  source = "registry+https://github.com/rust-lang/crates.io-index"
214
- checksum = "9ac53762fd065daa3194dd09337a38bd793a188100fd1a9304c4ab312d901771"
214
+ checksum = "6100e8a4b5eba53afaa5ed078364851a0b2499c553a44c31026b929049b49dc6"
215
215
  dependencies = [
216
216
  "proc-macro2",
217
217
  "pyo3-macros-backend",
@@ -221,9 +221,9 @@ dependencies = [
221
221
 
222
222
  [[package]]
223
223
  name = "pyo3-macros-backend"
224
- version = "0.29.0"
224
+ version = "0.29.3"
225
225
  source = "registry+https://github.com/rust-lang/crates.io-index"
226
- checksum = "4ca3a1557399783172dc5bf39cfca835157732532cba56b71d2292161e53b362"
226
+ checksum = "6143877a16e82b5a727b7127ff4cd86858a24a28d745d72f43e6f227c7b1bdb3"
227
227
  dependencies = [
228
228
  "heck",
229
229
  "proc-macro2",
@@ -1,12 +1,14 @@
1
1
  [package]
2
2
  name = "pyfracturedjson"
3
- version = "2.2.0"
3
+ version = "2.2.1"
4
4
  edition = "2024"
5
5
  license = "MIT"
6
6
  readme = "README.md"
7
7
 
8
- [package.metadata.maturin]
9
- compatibility = "abi3"
8
+ [features]
9
+ default = ["abi3-py39"]
10
+ abi3-py39 = ["pyo3/abi3-py39"]
11
+ abi3-py314 = ["pyo3/abi3-py314"]
10
12
 
11
13
  [lib]
12
14
  name = "_rust_wrapper"
@@ -16,5 +18,5 @@ crate-type = ["cdylib"]
16
18
  fracturedjson = "0.1.1"
17
19
 
18
20
  [dependencies.pyo3]
19
- version = "0.29.0"
20
- features = ["extension-module", "abi3-py39"]
21
+ version = "0.29"
22
+ features = ["extension-module"]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pyfracturedjson
3
- Version: 2.2.0
3
+ Version: 2.2.1
4
4
  Classifier: Programming Language :: Rust
5
5
  Classifier: Programming Language :: Python :: Implementation :: CPython
6
6
  Classifier: Programming Language :: Python :: Implementation :: PyPy
@@ -13,11 +13,19 @@ Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
13
13
  Project-URL: Changelog, https://github.com/g-b-f/pyFracturedJSON/blob/master/CHANGELOG.md
14
14
  Project-URL: Repository, https://github.com/g-b-f/pyFracturedJSON
15
15
 
16
+ <div align="center">
17
+
16
18
  # pyFracturedJSON
17
19
 
18
- Adds [FracturedJSON](https://github.com/j-brooke/FracturedJson) support to python,
19
- allowing you to create JSON that is both compact and readable.
20
+ **Adds [FracturedJSON](https://github.com/j-brooke/FracturedJson) support to python,
21
+ letting you create JSON that is both compact and readable.**
20
22
 
23
+ <a href="https://pypi.org/project/pyfracturedjson">
24
+ <img alt="PyPI Version" src="https://img.shields.io/pypi/v/pyfracturedjson?cacheSeconds=3600">
25
+ <img alt="minimum python version" src="https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fpypi.org%2Fpypi%2Fpyfracturedjson%2Fjson&query=%24.info.requires_python&label=requires%20python&cacheSeconds=3600">
26
+ </a>
27
+ </div>
28
+ </br>
21
29
 
22
30
  You can trivially use it as a drop-in replacement for the built-in `json` module:
23
31
 
@@ -1,8 +1,16 @@
1
+ <div align="center">
2
+
1
3
  # pyFracturedJSON
2
4
 
3
- Adds [FracturedJSON](https://github.com/j-brooke/FracturedJson) support to python,
4
- allowing you to create JSON that is both compact and readable.
5
+ **Adds [FracturedJSON](https://github.com/j-brooke/FracturedJson) support to python,
6
+ letting you create JSON that is both compact and readable.**
5
7
 
8
+ <a href="https://pypi.org/project/pyfracturedjson">
9
+ <img alt="PyPI Version" src="https://img.shields.io/pypi/v/pyfracturedjson?cacheSeconds=3600">
10
+ <img alt="minimum python version" src="https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fpypi.org%2Fpypi%2Fpyfracturedjson%2Fjson&query=%24.info.requires_python&label=requires%20python&cacheSeconds=3600">
11
+ </a>
12
+ </div>
13
+ </br>
6
14
 
7
15
  You can trivially use it as a drop-in replacement for the built-in `json` module:
8
16
 
@@ -1,8 +1,12 @@
1
1
  import json
2
2
  from collections.abc import Iterator
3
3
  from typing import Callable
4
+ from typing import TYPE_CHECKING
4
5
 
5
- import _rust_wrapper
6
+ if TYPE_CHECKING:
7
+ from fracturedjson import _rust_wrapper # type: ignore[reportMissingModuleSource]
8
+ else:
9
+ import _rust_wrapper
6
10
 
7
11
 
8
12
  class Encoder(json.encoder.JSONEncoder):
@@ -231,5 +235,5 @@ def loads(fp, *, cls=None, object_hook=None, parse_float=None,
231
235
  return json.loads(fp, cls=cls, object_hook=object_hook, parse_float=parse_float,
232
236
  parse_int=parse_int, parse_constant=parse_constant, object_pairs_hook=object_pairs_hook, **kw)
233
237
 
234
- def detect_encoding(b):
238
+ def detect_encoding(b: bytes | bytearray):
235
239
  return json.detect_encoding(b)
@@ -4,7 +4,7 @@ use fracturedjson::{Formatter, NumberListAlignment};
4
4
  #[pyfunction]
5
5
  fn reformat_string(
6
6
  input: String,
7
- indent:usize,
7
+ indent: usize,
8
8
  line_length: usize,
9
9
  max_inline_complexity: isize,
10
10
  max_compact_array_complexity: isize,
@@ -1,265 +0,0 @@
1
- name: publish
2
-
3
- on:
4
- push:
5
- tags:
6
- - 'v[0-9]+.[0-9]+.[0-9]+'
7
- branches:
8
- - dev
9
- - develop
10
-
11
- permissions:
12
- contents: read
13
-
14
- jobs:
15
- test:
16
- name: Test
17
- runs-on: ubuntu-latest
18
- steps:
19
- - uses: actions/checkout@v6
20
- - uses: actions/setup-python@v6
21
- with:
22
- python-version: '3.11'
23
- - name: Install uv
24
- uses: astral-sh/setup-uv@v7
25
- - name: Run tests
26
- run: uv run python -m pytest tests/
27
-
28
- linux:
29
- runs-on: ${{ matrix.platform.runner }}
30
- needs: test
31
- strategy:
32
- matrix:
33
- platform:
34
- - runner: ubuntu-22.04
35
- target: x86_64
36
- - runner: ubuntu-22.04
37
- target: x86
38
- - runner: ubuntu-22.04
39
- target: aarch64
40
- - runner: ubuntu-22.04
41
- target: armv7
42
- - runner: ubuntu-22.04
43
- target: s390x
44
- - runner: ubuntu-22.04
45
- target: ppc64le
46
- steps:
47
- - uses: actions/checkout@v6
48
- - uses: actions/setup-python@v6
49
- with:
50
- python-version: 3.x
51
- - name: Build wheels
52
- uses: PyO3/maturin-action@v1
53
- with:
54
- target: ${{ matrix.platform.target }}
55
- args: --release --out dist --find-interpreter
56
- sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
57
- manylinux: auto
58
- - name: Upload wheels
59
- uses: actions/upload-artifact@v5
60
- with:
61
- name: wheels-linux-${{ matrix.platform.target }}
62
- path: dist
63
-
64
- test_install:
65
- name: Test Install
66
- runs-on: ubuntu-latest
67
- needs: linux
68
- steps:
69
- - uses: actions/setup-python@v6
70
- with:
71
- python-version: '3.11'
72
-
73
- - name: Download wheel
74
- uses: actions/download-artifact@v4
75
- with:
76
- pattern: wheels-linux-*
77
- path: dist/
78
- merge-multiple: true
79
-
80
- - name: Install local wheel
81
- run: pip install --no-index --find-links=dist/ pyfracturedjson
82
-
83
- - name: Import and smoke test
84
- run: |
85
- python -c '
86
- from fracturedjson import dumps
87
-
88
- expected="""{
89
- "abcd" : "abcd",
90
- "long_list": [
91
- "thing_0", "thing_1", "thing_2", "thing_3", "thing_4", "thing_5", "thing_6", "thing_7", "thing_8",
92
- "thing_9", "thing_10", "thing_11", "thing_12", "thing_13", "thing_14", "thing_15", "thing_16", "thing_17",
93
- "thing_18", "thing_19"
94
- ]
95
- }
96
- """
97
- long_list = [f"thing_{i}" for i in range(20)]
98
- actual = dumps({"abcd": "abcd", "long_list": long_list})
99
- assert actual == expected, f"unexpected format:\n\nexpected:\n{expected}\nactual:\n{actual}"
100
- '
101
-
102
- musllinux:
103
- runs-on: ${{ matrix.platform.runner }}
104
- needs: test_install
105
- strategy:
106
- matrix:
107
- platform:
108
- - runner: ubuntu-22.04
109
- target: x86_64
110
- - runner: ubuntu-22.04
111
- target: x86
112
- - runner: ubuntu-22.04
113
- target: aarch64
114
- - runner: ubuntu-22.04
115
- target: armv7
116
- steps:
117
- - uses: actions/checkout@v6
118
- - uses: actions/setup-python@v6
119
- with:
120
- python-version: 3.x
121
- - name: Build wheels
122
- uses: PyO3/maturin-action@v1
123
- with:
124
- target: ${{ matrix.platform.target }}
125
- args: --release --out dist --find-interpreter
126
- sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
127
- manylinux: musllinux_1_2
128
- - name: Upload wheels
129
- uses: actions/upload-artifact@v5
130
- with:
131
- name: wheels-musllinux-${{ matrix.platform.target }}
132
- path: dist
133
-
134
- windows:
135
- runs-on: ${{ matrix.platform.runner }}
136
- needs: test_install
137
- strategy:
138
- matrix:
139
- platform:
140
- - runner: windows-latest
141
- target: x64
142
- python_arch: x64
143
- - runner: windows-latest
144
- target: x86
145
- python_arch: x86
146
- - runner: windows-11-arm
147
- target: aarch64
148
- python_arch: arm64
149
- steps:
150
- - uses: actions/checkout@v6
151
- - uses: actions/setup-python@v6
152
- with:
153
- python-version: '3.13'
154
- architecture: ${{ matrix.platform.python_arch }}
155
- - name: Build wheels
156
- uses: PyO3/maturin-action@v1
157
- with:
158
- target: ${{ matrix.platform.target }}
159
- args: --release --out dist --find-interpreter
160
- sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
161
- - name: Upload wheels
162
- uses: actions/upload-artifact@v5
163
- with:
164
- name: wheels-windows-${{ matrix.platform.target }}
165
- path: dist
166
-
167
- macos:
168
- runs-on: ${{ matrix.platform.runner }}
169
- needs: test_install
170
- strategy:
171
- matrix:
172
- platform:
173
- - runner: macos-15-intel
174
- target: x86_64
175
- - runner: macos-latest
176
- target: aarch64
177
- steps:
178
- - uses: actions/checkout@v6
179
- - uses: actions/setup-python@v6
180
- with:
181
- python-version: 3.x
182
- - name: Build wheels
183
- uses: PyO3/maturin-action@v1
184
- with:
185
- target: ${{ matrix.platform.target }}
186
- args: --release --out dist --find-interpreter
187
- sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
188
- - name: Upload wheels
189
- uses: actions/upload-artifact@v5
190
- with:
191
- name: wheels-macos-${{ matrix.platform.target }}
192
- path: dist
193
-
194
- android:
195
- runs-on: ubuntu-latest
196
- needs: test_install
197
- strategy:
198
- matrix:
199
- platform:
200
- - aarch64-linux-android
201
- - x86_64-linux-android
202
- # - armv7-linux-androideabi
203
- steps:
204
- - uses: actions/checkout@v6
205
- - uses: actions/setup-python@v6
206
- with:
207
- python-version: 3.x
208
- - name: Build wheels
209
- uses: PyO3/maturin-action@v1
210
- with:
211
- target: ${{ matrix.platform }}
212
- args: --release --out dist -i python3.12
213
- sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
214
- - name: Upload wheels
215
- uses: actions/upload-artifact@v5
216
- with:
217
- name: wheels-android-${{ matrix.platform }}
218
- path: dist
219
-
220
- sdist:
221
- runs-on: ubuntu-latest
222
- needs: test_install
223
- steps:
224
- - uses: actions/checkout@v6
225
- - name: Build sdist
226
- uses: PyO3/maturin-action@v1
227
- with:
228
- command: sdist
229
- args: --out dist
230
- - name: Upload sdist
231
- uses: actions/upload-artifact@v5
232
- with:
233
- name: wheels-sdist
234
- path: dist
235
-
236
- release:
237
- name: Release
238
- runs-on: ubuntu-latest
239
- needs: [linux, musllinux, windows, macos, android, sdist, test_install]
240
- if: startsWith(github.ref, 'refs/tags/v')
241
- permissions:
242
- id-token: write
243
- contents: write
244
- attestations: write
245
-
246
- steps:
247
- - name: Download wheels
248
- uses: actions/download-artifact@v5
249
- with:
250
- pattern: wheels-*
251
- path: dist
252
- merge-multiple: true
253
-
254
- - name: Generate artifact attestation
255
- uses: actions/attest-build-provenance@v3
256
- with:
257
- subject-path: 'dist/*'
258
-
259
- - name: Install uv
260
- uses: astral-sh/setup-uv@v7
261
-
262
- - name: Publish to PyPI
263
- run: uv publish dist/*
264
- env:
265
- UV_PUBLISH_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
File without changes
File without changes