Skip to content

Fix failing Windows documentation build #3968

Closed
@cooperlees

Description

Describe the bug

CI of building black documentation on Windows fails.

  • It seems we're not installing black correctly in the doc build environment:
Running Sphinx v7.2.6

Configuration error:
There is a programmable error in your configuration file:

Traceback (most recent call last):
  File "C:\hostedtoolcache\windows\Python\3.12.0\x64\Lib\site-packages\sphinx\config.py", line 358, in eval_config_file
    exec(code, namespace)  # NoQA: S102
    ^^^^^^^^^^^^^^^^^^^^^
  File "D:\a\black\black\docs\conf.py", line 46, in <module>
    release = get_distribution("black").version.split("+")[0]
              ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\hostedtoolcache\windows\Python\3.12.0\x64\Lib\site-packages\pkg_resources\__init__.py", line 528, in get_distribution
    dist = get_provider(dist)
           ^^^^^^^^^^^^^^^^^^
  File "C:\hostedtoolcache\windows\Python\3.12.0\x64\Lib\site-packages\pkg_resources\__init__.py", line 400, in get_provider
    return working_set.find(moduleOrReq) or require(str(moduleOrReq))[0]
                                            ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\hostedtoolcache\windows\Python\3.12.0\x64\Lib\site-packages\pkg_resources\__init__.py", line 968, in require
    needed = self.resolve(parse_requirements(requirements))
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\hostedtoolcache\windows\Python\3.12.0\x64\Lib\site-packages\pkg_resources\__init__.py", line 829, in resolve
    dist = self._resolve_dist(
           ^^^^^^^^^^^^^^^^^^^
  File "C:\hostedtoolcache\windows\Python\3.12.0\x64\Lib\site-packages\pkg_resources\__init__.py", line 870, in _resolve_dist
    raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'black' distribution was not found and is required by the application

To Reproduce

Trigger CI

Expected behavior

We build the docs on Windows.

Activity

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

Metadata

Assignees

No one assigned

    Labels

    C: maintenanceRelated to project maintenance, e.g. CI, testing, policy changes, releasesT: bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions