`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 now it is necessary to use the capacity constructor with a capacity of zero:
```c++
// default-constructed tree is now non-empty
Tree tree;
assert(!tree.empty()); // MODIFIED! was empty on previous version
id_type root = tree.root_id(); // OK. default-constructed tree is now non-empty
// to create an empty tree:
Tree tree(0); // pass capacity of zero
assert(tree.empty()); // as expected
// but watchout, this is no longer possible:
//id_type root = tree.root_id(); // ERROR: cannot get root of empty tree.
```
This changeset also enables the python library to call `root_id()` on a default-constructed tree
re #556
Here's an example log of the problem for Windows:
see https://github.com/biojppm/rapidyaml/actions/runs/3686238289/jobs/6238204139
```
+ pip install -v dist/rapidyaml-0.4.1.post139-cp311-cp311-win_amd64.whl
Using pip 22.3.1 from C:\hostedtoolcache\windows\Python\3.11.0\x64\Lib\site-packages\pip (python 3.11)
Processing d:\a\rapidyaml\rapidyaml\dist\rapidyaml-0.4.1.post139-cp311-cp311-win_amd64.whl
Installing collected packages: rapidyaml
Successfully installed rapidyaml-0.4.1.post139
+ pip show -f rapidyaml
Name: rapidyaml
Version: 0.4.1.post139
Summary: Rapid YAML - a library to parse and emit YAML, and do it fast
Home-page: https://github.com/biojppm/rapidyaml
Author: Joao Paulo Magalhaes
Author-email: dev@jpmag.me
License: MIT
Location: C:\hostedtoolcache\windows\Python\3.11.0\x64\Lib\site-packages
Requires:
Required-by:
Files:
rapidyaml-0.4.1.post139.dist-info\INSTALLER
rapidyaml-0.4.1.post139.dist-info\LICENSE.txt
rapidyaml-0.4.1.post139.dist-info\METADATA
rapidyaml-0.4.1.post139.dist-info\RECORD
rapidyaml-0.4.1.post139.dist-info\REQUESTED
rapidyaml-0.4.1.post139.dist-info\WHEEL
rapidyaml-0.4.1.post139.dist-info\direct_url.json
rapidyaml-0.4.1.post139.dist-info\top_level.txt
ryml\__init__.py
ryml\__pycache__\__init__.cpython-311.pyc
ryml\__pycache__\ryml.cpython-311.pyc
ryml\__pycache__\version.cpython-311.pyc
ryml\_ryml.pyd
ryml\ryml.py
ryml\tests\__pycache__\parse_bm.cpython-311.pyc
ryml\tests\__pycache__\test_parse.cpython-311.pyc
ryml\tests\parse_bm.py
ryml\tests\test_parse.py
ryml\version.py
+ python -c 'import ryml'
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\hostedtoolcache\windows\Python\3.11.0\x64\Lib\site-packages\ryml\__init__.py", line 1, in <module>
from ryml.ryml import *
File "C:\hostedtoolcache\windows\Python\3.11.0\x64\Lib\site-packages\ryml\ryml.py", line 13, in <module>
from . import _ryml
ImportError: DLL load failed while importing _ryml: The specified module could not be found.
Error: Process completed with exit code 1.
```
* Move `setup.py` and `pyproject.toml` to root directory otherwise
everything breaks.
* Use `setuptool_scm` for version.
* Build wheels from sdist files using pip.