Skip to content

Commit fc1ed83

Browse files
committed
v0.11.0
1 parent c92fc1d commit fc1ed83

File tree

19 files changed

+334
-235
lines changed

19 files changed

+334
-235
lines changed

.github/workflows/release.yml

Lines changed: 154 additions & 62 deletions
Large diffs are not rendered by default.

.github/workflows/release.ys

Lines changed: 31 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
11
!yamlscript/v0
22

33

4-
defn pywhl(pyv cibwpyv cibwarch cibwplatform os vsenvarch='' cmkflags='' cibwv='3.3.1'):: # NOTE: cannot use _ in names?
4+
defn pywhl(pyv cibwpyv cibwarch cibwplatform os vsenvarch='' cmkflags=''):: # NOTE: cannot use _ in names?
55
name:: "python/$pyv/$cibwplatform"
66
sfx:: "python$pyv-$cibwplatform" # suffix
77
os:: os
88
pythonv:: pyv
99
cibw_pyv:: cibwpyv #pyv.replace(/\.//) # WTF??
1010
cibw_arch:: cibwarch
1111
cibw_platform:: cibwplatform
12-
cibw_ver:: cibwv
1312
#cmakeflags:: cmkflags
1413
vsenvarch:: vsenvarch
1514

@@ -64,14 +63,16 @@ python-wheel-matrix =::
6463
- ! pywhl('3.8' 38 'x86_64' 'macosx_x86_64' 'macos-15-intel')
6564
#- ! pywhl('3.8' 38 'arm64' 'macosx_arm64' 'macos-14' ) # disabled: https://cibuildwheel.pypa.io/en/stable/faq/#macos-building-cpython-38-wheels-on-arm64
6665
#- ! pywhl('3.8' 38 'universal2' 'macosx_universal2' 'macos-14' ) # disabled: https://cibuildwheel.pypa.io/en/stable/faq/#macos-building-cpython-38-wheels-on-arm64
66+
67+
python-wheel-matrix-legacy-2-23 =::
68+
# pyv arch platform os vsenvarch cmakeflags
69+
- ! pywhl('3.7' 37 'x86_64' 'manylinux_x86_64' 'ubuntu-22.04' '' '' )
70+
- ! pywhl('3.7' 37 'i686' 'manylinux_i686' 'ubuntu-22.04' '' '' )
71+
- ! pywhl('3.7' 37 'x86_64' 'macosx_x86_64' 'macos-15-intel' '' '' )
6772
# pyv arch platform os vsenvarch cmakeflags cibw_ver
68-
- ! pywhl('3.7' 37 'x86_64' 'manylinux_x86_64' 'ubuntu-22.04' '' '' '2.23')
69-
- ! pywhl('3.7' 37 'i686' 'manylinux_i686' 'ubuntu-22.04' '' '' '2.23')
70-
- ! pywhl('3.7' 37 'x86_64' 'macosx_x86_64' 'macos-15-intel' '' '' '2.23')
71-
# pyv arch platform os vsenvarch cmakeflags cibw_ver
72-
#- ! pywhl('3.6' 36 'x86_64' 'manylinux_x86_64' 'ubuntu-20.04' '' '' '2.23') # setup-python 3.6 requires ubuntu 20.04
73-
#- ! pywhl('3.6' 36 'i686' 'manylinux_i686' 'ubuntu-20.04' '' '' '2.23') # setup-python 3.6 requires ubuntu 20.04
74-
#- ! pywhl('3.6' 36 'x86_64' 'macosx_x86_64' 'macos-15-intel' '' '' '2.23')
73+
#- ! pywhl('3.6' 36 'x86_64' 'manylinux_x86_64' 'ubuntu-20.04' '' '' ) # setup-python 3.6 requires ubuntu 20.04
74+
#- ! pywhl('3.6' 36 'i686' 'manylinux_i686' 'ubuntu-20.04' '' '' ) # setup-python 3.6 requires ubuntu 20.04
75+
#- ! pywhl('3.6' 36 'x86_64' 'macosx_x86_64' 'macos-15-intel' '' '' )
7576

7677

7778
python-wheel-matrix-win =::
@@ -83,31 +84,33 @@ python-wheel-matrix-win =::
8384
- ! pywhl('3.13' 313 'AMD64' 'win_amd64' 'windows-2022' 'x64' '-G "Visual Studio 17 2022" -A x64')
8485
- ! pywhl('3.13' 313 'x86' 'win32' 'windows-2022' 'x86' '-G "Visual Studio 17 2022" -A Win32')
8586
#- ! pywhl('3.13' 313 'ARM64' 'win_arm64' 'windows-2022' 'amd64_arm64' '-G "Visual Studio 17 2022" -A ARM64')
86-
#
87+
# pyv arch platform os vsenvarch cmakeflags
8788
- ! pywhl('3.12' 312 'AMD64' 'win_amd64' 'windows-2022' 'x64' '-G "Visual Studio 17 2022" -A x64')
8889
- ! pywhl('3.12' 312 'x86' 'win32' 'windows-2022' 'x86' '-G "Visual Studio 17 2022" -A Win32')
8990
#- ! pywhl('3.12' 312 'ARM64' 'win_arm64' 'windows-2022' 'amd64_arm64' '-G "Visual Studio 17 2022" -A ARM64')
90-
#
91+
# pyv arch platform os vsenvarch cmakeflags
9192
- ! pywhl('3.11' 311 'AMD64' 'win_amd64' 'windows-2022' 'x64' '-G "Visual Studio 17 2022" -A x64')
9293
- ! pywhl('3.11' 311 'x86' 'win32' 'windows-2022' 'x86' '-G "Visual Studio 17 2022" -A Win32')
9394
#- ! pywhl('3.11' 311 'ARM64' 'win_arm64' 'windows-2022' 'amd64_arm64' '-G "Visual Studio 17 2022" -A ARM64')
94-
#
95+
# pyv arch platform os vsenvarch cmakeflags
9596
- ! pywhl('3.10' 310 'AMD64' 'win_amd64' 'windows-2022' 'x64' '-G "Visual Studio 17 2022" -A x64')
9697
- ! pywhl('3.10' 310 'x86' 'win32' 'windows-2022' 'x86' '-G "Visual Studio 17 2022" -A Win32')
9798
#- ! pywhl('3.10' 310 'ARM64' 'win_arm64' 'windows-2022' 'amd64_arm64' '-G "Visual Studio 17 2022" -A ARM64')
98-
#
99+
# pyv arch platform os vsenvarch cmakeflags
99100
- ! pywhl('3.9' 39 'AMD64' 'win_amd64' 'windows-2022' 'x64' '-G "Visual Studio 17 2022" -A x64')
100101
- ! pywhl('3.9' 39 'x86' 'win32' 'windows-2022' 'x86' '-G "Visual Studio 17 2022" -A Win32')
101102
#- ! pywhl('3.9' 39 'ARM64' 'win_arm64' 'windows-2022' 'amd64_arm64' '-G "Visual Studio 17 2022" -A ARM64')
102-
#
103+
# pyv arch platform os vsenvarch cmakeflags
103104
- ! pywhl('3.8' 38 'AMD64' 'win_amd64' 'windows-2022' 'x64' '-G "Visual Studio 17 2022" -A x64')
104105
- ! pywhl('3.8' 38 'x86' 'win32' 'windows-2022' 'x86' '-G "Visual Studio 17 2022" -A Win32')
105-
#
106-
- ! pywhl('3.7' 37 'AMD64' 'win_amd64' 'windows-2022' 'x64' '-G "Visual Studio 17 2022" -A x64' '2.23')
107-
#- ! pywhl('3.7' 37 'x86' 'win32' 'windows-2022' 'x86' '-G "Visual Studio 17 2022" -A Win32' '2.23')
108-
#
109-
- ! pywhl('3.6' 36 'AMD64' 'win_amd64' 'windows-2022' 'x64' '-G "Visual Studio 17 2022" -A x64' '2.23')
110-
- ! pywhl('3.6' 36 'x86' 'win32' 'windows-2022' 'x86' '-G "Visual Studio 17 2022" -A Win32' '2.23')
106+
107+
python-wheel-matrix-win-legacy-2-23 =::
108+
# pyv arch platform os vsenvarch cmakeflags
109+
- ! pywhl('3.7' 37 'AMD64' 'win_amd64' 'windows-2022' 'x64' '-G "Visual Studio 17 2022" -A x64')
110+
#- ! pywhl('3.7' 37 'x86' 'win32' 'windows-2022' 'x86' '-G "Visual Studio 17 2022" -A Win32')
111+
# pyv arch platform os vsenvarch cmakeflags
112+
- ! pywhl('3.6' 36 'AMD64' 'win_amd64' 'windows-2022' 'x64' '-G "Visual Studio 17 2022" -A x64' )
113+
- ! pywhl('3.6' 36 'x86' 'win32' 'windows-2022' 'x86' '-G "Visual Studio 17 2022" -A Win32')
111114

112115

113116
setup-env =::
@@ -131,7 +134,7 @@ setup-env-win =::
131134
tags: [v0.*, v1.*, v2.*]
132135
branches: [master]
133136
::
134-
defn define-workflow-python-wheels(name matrix setup-env)::
137+
defn define-workflow-python-wheels(name matrix setup-env cibw-ver)::
135138
:: setup-job('release' name)
136139
name: ${{matrix.config.name}}
137140
runs-on: ${{matrix.config.os}}
@@ -148,7 +151,7 @@ setup-env-win =::
148151
- :: checkout-action
149152
- :: setup-env
150153
- name: create wheel
151-
uses: pypa/cibuildwheel@v${{matrix.config.cibw_ver}}
154+
uses:: "pypa/cibuildwheel@v${cibw-ver}"
152155
- name: rename wheelhouse -> dist
153156
run: mv -fv wheelhouse dist
154157
- name: Verify artifacts
@@ -347,10 +350,14 @@ jobs:
347350
with: {name: dist-python_src, path: dist/}
348351

349352
python_wheels:
350-
:: define-workflow-python-wheels('python_wheels' python-wheel-matrix setup-env)
353+
:: define-workflow-python-wheels('python_wheels' python-wheel-matrix setup-env '3.3.1')
354+
python_wheels_legacy:
355+
:: define-workflow-python-wheels('python_wheels' python-wheel-matrix-legacy-2-23 setup-env '2.23')
351356

352357
python_wheels_win:
353-
:: define-workflow-python-wheels('python_wheels_win' python-wheel-matrix-win setup-env-win)
358+
:: define-workflow-python-wheels('python_wheels_win' python-wheel-matrix-win setup-env-win '3.3.1')
359+
python_wheels_win_legacy:
360+
:: define-workflow-python-wheels('python_wheels_win' python-wheel-matrix-win-legacy-2-23 setup-env-win '2.23')
354361

355362
#----------------------------------------------------------------------------
356363
merge_artifacts:

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ project(ryml
66
LANGUAGES CXX)
77
include(./compat.cmake)
88

9-
c4_project(VERSION 0.10.0 STANDALONE
9+
c4_project(VERSION 0.11.0 STANDALONE
1010
AUTHOR "Joao Paulo Magalhaes <dev@jpmag.me>")
1111

1212

changelog/0.11.0.md

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
### New features
2+
3+
- [PR#550](https://github.com/biojppm/rapidyaml/pull/550) - Implement flow multiline style (`FLOW_ML`):
4+
- The parser now detects this style automatically for flow seqs or maps when the terminating bracket sits on a line different from the opening bracket.
5+
- Added `ParserOptions::detect_flow_ml()` to enable/disable this behavior
6+
- Added `EmitOptions::indent_flow_ml()` to control indentation of `FLOW_ML` containers
7+
- The emit implementation was refactored, and is now significantly cleaner
8+
- Emitted YAML will now have anchors emitted before tags, as is customary ([see example](https://play.yaml.io/main/parser?input=LSAhdGFnICZhbmNob3IgfAogIG5vdGUgaG93IHRoZSBhbmNob3IgY29tZXMKICBmaXJzdCBpbiB0aGUgZXZlbnRz)).
9+
- Added `ParserOptions` defaulted argument to temp-parser overloads of `parse_{yaml,json}_in_{place,arena}()`
10+
- [PR#567](https://github.com/biojppm/rapidyaml/pull/567) (fixes [#566](https://github.com/biojppm/rapidyaml/issues/566)) fixes a regression from this refactor where top-level container anchors were wrongly emitted in the same line if no style was set on the container.
11+
12+
13+
### API changes
14+
15+
- **BREAKING** [PR#503](https://github.com/biojppm/rapidyaml/pull/503) (fixes [#399](https://github.com/biojppm/rapidyaml/issues/399)): change error callbacks.
16+
- Errors in ryml now have one of these types:
17+
- parse error: when parsing YAML/JSON. See: `pfn_error_parse`, `ErrorDataParse`, `ExceptionParse`, `err_parse_format()`, `sample_error_parse`.
18+
- visit error: when visiting a tree (reading or writing). See: `pfn_error_visit`, `ErrorDataVisit`, `ExceptionVisit`, `err_visit_format()`, `sample_error_visit`.
19+
- basic error: other, non specific errors. See: `pfn_error_basic`, `ErrorDataBasic`, `ExceptionBasic`, `err_basic_format()`, `sample_error_basic`.
20+
- parse and visit errors/exceptions can be treated/caught as basic errors/exceptions.
21+
- Add message formatting functions to simplify user-provided implementation of error callbacks:
22+
- `err_parse_format()`: format/print a full error message for a parse error
23+
- `err_visit_format()`: format/print a full error message for a visit error
24+
- `err_basic_format()`: format/print a full error message for a basic error
25+
- `location_format()`: format/print a location
26+
- `location_format_with_context()`: useful to create a rich error message showing the YAML region causing the error, maybe even for a visit error if the source is kept and locations are enabled.
27+
- `format_exc()`: format an exception (when exceptions are enabled)
28+
- See the new header `c4/yml/error.hpp` (and `c4/yml/error.def.hpp` for definitions of the functions in `c4/yml/error.hpp`)
29+
- See the relevant sample functions in the quickstart sample: `sample_error_basic`, `sample_error_parse` and `sample_error_visit`.
30+
- There are breaking user-facing changes in the `Callbacks` structure:
31+
- Removed member `m_error `
32+
- Added members `m_error_basic`, `m_error_parse`, `m_error_visit`
33+
- Added methods `.set_error_basic()`, `.set_error_parse()` and `.set_error_visit()`.
34+
- **BREAKING** [PR#557](https://github.com/biojppm/rapidyaml/pull/557) - `Tree` is now non-empty by default, and `Tree::root_id()` will no longer modify the tree when it is empty. To create an empty tree, it is now necessary to use the capacity constructor with a capacity of zero:
35+
```c++
36+
// breaking change: default-constructed tree is now non-empty
37+
Tree tree;
38+
assert(!tree.empty()); // MODIFIED! was empty on previous version
39+
id_type root = tree.root_id(); // OK. default-constructed tree is now non-empty
40+
41+
// to create an empty tree (as happened before):
42+
Tree tree(0); // pass capacity of zero
43+
assert(tree.empty()); // as expected
44+
// but watchout, this is no longer possible:
45+
//id_type root = tree.root_id(); // ERROR: cannot get root of empty tree.
46+
```
47+
This changeset also enables the python library to call `root_id()` on a default-constructed tree (fixes [#556](https://github.com/biojppm/rapidyaml/issues/556)).
48+
49+
50+
### Fixes in YAML parsing
51+
52+
- [PR#561](https://github.com/biojppm/rapidyaml/pull/561) (fixes [#559](https://github.com/biojppm/rapidyaml/issues/559)) - Byte Order Mark: account for BOM length when determining block indentation
53+
- [PR#547](https://github.com/biojppm/rapidyaml/pull/547) - Fix parsing of implicit first documents with empty sequences, caused by a problem in `Tree::set_root_as_stream()`:
54+
```yaml
55+
[] # this container was lost during parsing
56+
---
57+
more data here
58+
```
59+
- [PR#576](https://github.com/biojppm/rapidyaml/pull/576) - `extra::events_ints_print()`: Prevent integer overflow in bounds check (thanks @bytecodesky).
60+
61+
62+
### JSON emitting changes
63+
64+
- [PR#574](https://github.com/biojppm/rapidyaml/pull/574) (fixes [#535](https://github.com/biojppm/rapidyaml/issues/535) and [#312](https://github.com/biojppm/rapidyaml/issues/312)) - improve handling of `.inf`, `.nan` and some float formats when emitting to JSON. For example, the tree
65+
```yaml
66+
{
67+
inf: [inf, infinity, .inf, .Inf, .INF, -inf, -infinity, -.inf, -.Inf, -.INF],
68+
nan: [nan, .nan, .NaN, .NAN],
69+
dot: [.1, 1., .2e2, 10., -.2, -2.],
70+
zero: [10, 01],
71+
normal: [0.1, 0.2e3, 4.e5],
72+
}
73+
```
74+
is now emitted to JSON as:
75+
```json
76+
{
77+
".inf": [".inf",".inf",".inf",".inf","-.inf","-.inf","-.inf","-.inf","-.inf","-.inf"],
78+
".nan": [".nan",".nan",".nan",".nan"],
79+
"dot": [0.1,1.0,0.2e2,10.0,-0.2,-2.0],
80+
"zero": [10,"01"],
81+
"normal": [0.1,0.2e3,4.e5]
82+
}
83+
```
84+
Previously, some inf and nan cases were emitted without quotes; now they are all emitted with the fixed strings `.nan` and `.inf`, which helps in cases where the JSON may be loaded in JavaScript. Note also the added zeroes for some floats, eg `.1` or `-2.` turning into `0.1` and `-2.0`.
85+
86+
87+
### Other changes
88+
89+
- Update c4core to v0.2.10
90+
91+
92+
### Python improvements
93+
94+
- [PR#560](https://github.com/biojppm/rapidyaml/pull/560) (see also [#554](https://github.com/biojppm/rapidyaml/issues/554)): python improvements:
95+
- expose `Tree::to_arena()` in python. This allows safer and easier programatic creation of trees in python by ensuring scalars are placed into the tree and so have the same lifetime as the tree:
96+
```python
97+
t = ryml.Tree()
98+
s = t.to_arena(temp_string()) # Copy/serialize a temporary string to the tree's arena.
99+
# Works also with integers and floats.
100+
t.to_val(t.root_id(), s) # Now we can safely use the scalar in the tree:
101+
# there is no longer any risk of it being deallocated
102+
```
103+
- improve behavior of `Tree` methods accepting scalars: all standard buffer types are now accepted (ie, `str`, `bytes`, `bytearray` and `memoryview`).
104+
- [PR#565](https://github.com/biojppm/rapidyaml/pull/565) (fixes [#564](https://github.com/biojppm/rapidyaml/issues/564)) - `Tree` arena: allow relocation of zero-length strings when placed at the end (relax assertions triggered in `Tree::_relocated()`)
105+
- [PR#563](https://github.com/biojppm/rapidyaml/pull/563) (fixes [#562](https://github.com/biojppm/rapidyaml/issues/562)) - Fix bug in `NodeRef::cend()`
106+
- [PR#568](https://github.com/biojppm/rapidyaml/pull/568) - Move `escape_scalar()` from `c4/yml/extra/scalar.hpp` to `c4/yml/escape_scalar.hpp` (and removed the original header)
107+
108+
109+
### Thanks
110+
111+
- @bytecodesky

0 commit comments

Comments
 (0)