sphinx-exercise
sphinx-exercise copied to clipboard
Compiling an exercise with solution results in `WARNING: undefined label:` on sphinx 7 and latest sphinx-exercise release
Describe the bug
context
When I compile a simple example, I get WARNING: undefined label:
using sphinx 7.2.6
expectation I expected no errors.
bug Here's an error message I ran into...
$ make html
...
writing output... [100%] test
/home/u/projects/rt-systems/test/source/index.rst: WARNING: undefined label: ex1
generating indices... genindex done
...
.
Reproduce the bug
- create a virtualenv and install
sphinx-exercise
,sphinx-book-theme
andmyst-parser
. - use
sphinx-quickstart
with default settings. -
conf.py
:- Add
myst_parser
andsphinx_exercise
as extensions - change
html_theme
tosphinx_book_theme
-
source_suffix = { ".md": "markdown", }
- Add
- rename
index.rst
toindex.md
and addtest.md
to the index - Use the following example:
# test
```{exercise-start}
:label: ex1
```
and maybe you wish to add a figure
```{exercise-end}
```
```{solution-start} ex1
```
test
```{solution-end}
```
List your environment
Package Version
----------------------------- ----------
accessible-pygments 0.0.4
alabaster 0.7.13
Babel 2.14.0
beautifulsoup4 4.12.2
certifi 2023.11.17
charset-normalizer 3.3.2
docutils 0.20.1
idna 3.6
imagesize 1.4.1
Jinja2 3.1.2
markdown-it-py 3.0.0
MarkupSafe 2.1.3
mdit-py-plugins 0.4.0
mdurl 0.1.2
myst-parser 2.0.0
packaging 23.2
pip 23.3.2
pydata-sphinx-theme 0.15.1
Pygments 2.17.2
PyYAML 6.0.1
requests 2.31.0
setuptools 69.0.3
snowballstemmer 2.2.0
soupsieve 2.5
Sphinx 7.2.6
sphinx-book-theme 1.1.0
sphinx-exercise 0.4.1
sphinxcontrib-applehelp 1.0.7
sphinxcontrib-devhelp 1.0.5
sphinxcontrib-htmlhelp 2.0.4
sphinxcontrib-jsmath 1.0.1
sphinxcontrib-qthelp 1.0.6
sphinxcontrib-serializinghtml 1.1.9
typing_extensions 4.9.0
urllib3 2.1.0
wheel 0.42.0
Probably sphinx-exercise
depends on sphinx < 6
:
https://github.com/executablebooks/sphinx-exercise/blob/9357fbb3d80836a246ba38093ffd74352e189082/setup.py#L29
Somehow dependency is not listed in install deps:
https://github.com/executablebooks/sphinx-exercise/blob/9357fbb3d80836a246ba38093ffd74352e189082/setup.py#L60
26c7b27 fixes this issue.
@agoose77 did you maybe forget to release a new version after your commit?
@goekce thanks for the ping. I didn't forget to make a release, but rather we need to coordinate one!
@mmcky, are you happy for me to e.g. make a 1.0.0 release of sphinx-exercise? (assuming CI etc still succeeds).
@mmcky, are you happy for me to e.g. make a 1.0.0 release of sphinx-exercise? (assuming CI etc still succeeds).
Thanks @agoose77 -- excited to see these improvements. Let me know if you need any testing prior to release etc.
Just wanted to add I was running into similar errors related to incompatibility in an environment with jupyterbook=1 sphinx=7. Installing from the main branch does seem to remedy things (pip git+https://github.com/executablebooks/sphinx-exercise.git
). Would be super helpful to install an updated version from conda-forge.
Finally we've made this release; some issues with codecov were holding us back.
thanks @agoose77 and @mmcky the release is on github, but seems it didn't make it to pypi or conda-forge. I opened a separate issue for that here https://github.com/executablebooks/sphinx-exercise/issues/69