Test requirements and doc requirements are not solvable when combined

When trying to install both docs/requirements.txt and tests/requirements.txt there is a conflict in the dependency version requirements. Docs requires sphinx>=4.5.0 and that version of sphinx requires docutils >=0.14,<0.18, while the tests/requirements/py3.txt requires docutils>=0.22. This was introduced in commit 195836b.

This error comes up when trying to build the django-docker-box because it combines all requirements files. It can be reproduced with the following command:

uv pip install -r <(cat docs/requirements.txt tests/requirements/py3.txt)

Sphinx has introduced support for docutils 0.22 in a recent commit but no new release has been made since.

A workaround is provided by uv to override dependency requirements.

uv pip install -r <(cat docs/requirements.txt tests/requirements/py3.txt) --overrides tests/requirements/py3.txt

Is this something that should be fixed in Django? Or just worked around in django-docker-box?

Full traceback:

➜  django git:(main) ✗ uv pip install -r <(cat docs/requirements.txt tests/requirements/py3.txt)
  × No solution found when resolving dependencies:
  ╰─▶ Because only the following versions of sphinx are available:
          sphinx<=4.5.0
          sphinx==5.0.0
          sphinx==5.0.1
          sphinx==5.0.2
          sphinx==5.1.0
          sphinx==5.1.1
          sphinx==5.2.0
          sphinx==5.2.0.post0
          sphinx==5.2.1
          sphinx==5.2.2
          sphinx==5.2.3
          sphinx==5.3.0
          sphinx==6.0.0
          sphinx==6.0.1
          sphinx==6.1.0
          sphinx==6.1.1
          sphinx==6.1.2
          sphinx==6.1.3
          sphinx==6.2.0
          sphinx==6.2.1
          sphinx==7.0.0
          sphinx==7.0.1
          sphinx==7.1.0
          sphinx==7.1.1
          sphinx==7.1.2
          sphinx==7.2.0
          sphinx==7.2.1
          sphinx==7.2.2
          sphinx==7.2.3
          sphinx==7.2.4
          sphinx==7.2.5
          sphinx==7.2.6
          sphinx==7.3.0
          sphinx==7.3.1
          sphinx==7.3.2
          sphinx==7.3.3
          sphinx==7.3.4
          sphinx==7.3.5
          sphinx==7.3.6
          sphinx==7.3.7
          sphinx==7.4.0
          sphinx==7.4.1
          sphinx==7.4.2
          sphinx==7.4.3
          sphinx==7.4.4
          sphinx==7.4.5
          sphinx==7.4.6
          sphinx==7.4.7
          sphinx==8.0.0
          sphinx==8.0.1
          sphinx==8.0.2
          sphinx==8.1.0
          sphinx==8.1.1
          sphinx==8.1.2
          sphinx==8.1.3
          sphinx==8.2.0
          sphinx==8.2.1
          sphinx==8.2.2
          sphinx==8.2.3
          sphinx==8.3.0
      and sphinx==4.5.0 depends on docutils>=0.14,<0.18, we can conclude that sphinx>=4.5.0,<5.0.0
      depends on docutils>=0.14,<0.18.
      And because sphinx>=5.0.0,<=5.0.2 depends on docutils>=0.14,<0.19 and docutils>=0.14,<0.20, we
      can conclude that sphinx>=4.5.0,<6.0.0 depends on docutils>=0.14,<0.20.
      And because sphinx>=6.0.0,<=6.1.3 depends on docutils>=0.18,<0.20 and docutils>=0.18.1,<0.20, we
      can conclude that sphinx>=4.5.0,<7.0.1 depends on docutils>=0.14,<0.20.
      And because sphinx>=7.0.1,<=7.2.6 depends on docutils>=0.18.1,<0.21 and docutils>=0.18.1,<0.22,
      we can conclude that sphinx>=4.5.0,<7.4.0 depends on docutils>=0.14,<0.22.
      And because sphinx>=7.4.0,<=8.2.3 depends on docutils>=0.20,<0.22 and sphinx==8.3.0 was yanked
      (reason: Bad release), we can conclude that sphinx>=4.5.0 depends on docutils>=0.14,<0.22.
      And because you require sphinx>=4.5.0 and docutils>=0.22, we can conclude that your requirements
      are unsatisfiable.

Interesting that django-docker-box installs docs requirements (do you know why?)

I think honestly we’re just waiting for a Sphinx release here, but if one doesn’t come, and we get more reports of contributors stumbling over this, we could take another look.

Hi @jacobtylerwalls, it looks like django-docker-box can also be used to build the docs and that’s probably why the docs requirements are included.

Waiting for a Sphinx release sounds great to me! Thank you

1 Like