executablebooks / sphinx-exercise

A Sphinx extension for producing exercise and solution directives.
https://ebp-sphinx-exercise.readthedocs.io
MIT License
18 stars 6 forks source link

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

Open goekce opened 6 months ago

goekce commented 6 months ago

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

test


### 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 commented 6 months ago

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 commented 3 months ago

26c7b27 fixes this issue.

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

agoose77 commented 2 months ago

@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 commented 2 months ago

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

scottyhq commented 2 months ago

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.

agoose77 commented 2 months ago

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

scottyhq commented 1 month ago

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