sphinx-exercise icon indicating copy to clipboard operation
sphinx-exercise copied to clipboard

Compiling an exercise with solution results in `WARNING: undefined label:` on sphinx 7 and latest sphinx-exercise release

Open goekce opened this issue 1 year ago • 7 comments

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

  1. create a virtualenv and install sphinx-exercise, sphinx-book-theme and myst-parser.
  2. use sphinx-quickstart with default settings.
  3. conf.py:
    • Add myst_parser and sphinx_exercise as extensions
    • change html_theme to sphinx_book_theme
    • source_suffix = { ".md": "markdown", }
  4. rename index.rst to index.md and add test.md to the index
  5. 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

goekce avatar Jan 04 '24 16:01 goekce

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

goekce avatar Jan 04 '24 18:01 goekce

26c7b27 fixes this issue.

@agoose77 did you maybe forget to release a new version after your commit?

goekce avatar Apr 06 '24 14:04 goekce

@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).

agoose77 avatar Apr 08 '24 09:04 agoose77

@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.

mmcky avatar Apr 09 '24 03:04 mmcky

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.

scottyhq avatar Apr 29 '24 17:04 scottyhq

Finally we've made this release; some issues with codecov were holding us back.

agoose77 avatar May 03 '24 13:05 agoose77

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

scottyhq avatar May 14 '24 20:05 scottyhq