Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

YAML error: "dump()" has been removed #83

Closed
rly opened this issue Oct 26, 2023 · 1 comment · Fixed by #84
Closed

YAML error: "dump()" has been removed #83

rly opened this issue Oct 26, 2023 · 1 comment · Fixed by #84

Comments

@rly
Copy link
Contributor

rly commented Oct 26, 2023

In ndx-hed, running the command:

sphinx-build -b linkcheck ./source ./test_build

results in:

Extension error:
Handler <function run_doc_autogen at 0x103403ba0> for event 'builder-inited' threw an exception (exception: 
"dump()" has been removed, use

  yaml = YAML(typ='unsafe', pure=True)
  yaml.dump(...)

instead of file "/Users/rly/mambaforge/envs/ndx-hed/lib/python3.11/site-packages/hdmf_docutils/doctools/rst.py", line 299

            return yaml.dump(clean_spec, default_flow_style=False)

)

The latest ruamel.yaml is 0.18.0 which removes the dump() function:

As announced, in 0.18.0, the old PyYAML functions have been deprecated. (scan, parse, compose, load, emit, serialize, dump and their variants (all, safe, round_trip_, etc)). If you only read this after your program has stopped working: I am sorry to hear that, but that also means you, or the person developing your program, has not tested with warnings on (which is the recommendation in PEP 565, and e.g. defaultin when using pytest).

Pip environment:

Package                       Version      Editable project location
----------------------------- ------------ --------------------------------
alabaster                     0.7.13
attrs                         23.1.0
Babel                         2.13.1
black                         23.9.1
cachetools                    5.3.2
certifi                       2023.7.22
cfgv                          3.4.0
chardet                       5.2.0
charset-normalizer            3.3.1
click                         8.1.7
codespell                     2.2.6
colorama                      0.4.6
contourpy                     1.1.1
coverage                      7.3.2
cycler                        0.12.1
distlib                       0.3.7
docutils                      0.18.1
filelock                      3.12.4
fonttools                     4.43.1
h5py                          3.10.0
hdmf                          3.10.0
hdmf-docutils                 0.4.5
identify                      2.5.30
idna                          3.4
imagesize                     1.4.1
iniconfig                     2.0.0
Jinja2                        3.1.2
jsonschema                    4.19.1
jsonschema-specifications     2023.7.1
kiwisolver                    1.4.5
MarkupSafe                    2.1.3
matplotlib                    3.8.0
mypy-extensions               1.0.0
ndx-hed                       0.1.0        /Users/rly/Documents/NWB/ndx-hed
networkx                      3.2
nodeenv                       1.8.0
numpy                         1.26.1
packaging                     23.2
pandas                        2.1.1
pathspec                      0.11.2
Pillow                        10.1.0
pip                           23.3.1
platformdirs                  3.11.0
pluggy                        1.3.0
pre-commit                    3.4.0
Pygments                      2.16.1
pynwb                         2.5.0
pyparsing                     3.1.1
pyproject-api                 1.6.1
pytest                        7.4.2
pytest-cov                    4.1.0
pytest-subtests               0.6.0
python-dateutil               2.8.2
pytz                          2023.3.post1
PyYAML                        6.0.1
referencing                   0.30.2
requests                      2.31.0
rpds-py                       0.10.6
ruamel.yaml                   0.18.2
ruamel.yaml.clib              0.2.8
ruff                          0.0.292
scipy                         1.11.3
setuptools                    68.2.2
six                           1.16.0
snowballstemmer               2.2.0
Sphinx                        7.2.6
sphinx-gallery                0.14.0
sphinx-rtd-theme              1.3.0
sphinxcontrib-applehelp       1.0.7
sphinxcontrib-devhelp         1.0.5
sphinxcontrib-htmlhelp        2.0.4
sphinxcontrib-jquery          4.1
sphinxcontrib-jsmath          1.0.1
sphinxcontrib-qthelp          1.0.6
sphinxcontrib-serializinghtml 1.1.9
tox                           4.11.3
tzdata                        2023.3
urllib3                       2.0.7
virtualenv                    20.24.6
wheel                         0.41.2
@rly
Copy link
Contributor Author

rly commented Oct 26, 2023

dump now requires a stream and does not return a string by default. See this doc for a workaround: https://yaml.readthedocs.io/en/latest/example/#output-of-dump-as-a-string

@rly rly closed this as completed in #84 Oct 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant