googleapis / sphinx-docfx-yaml

Forked sphinx-docfx-yaml repository for creating DocFX YAML for Python Client Libraries
Apache License 2.0
5 stars 7 forks source link

fix: update dependencies to pin Sphinx for <5 compatibility #342

Closed dandhlee closed 8 months ago

dandhlee commented 11 months ago

Some dependencies were not pinned, and when imported caused issues with versioning issues. This messed with packages not installing properly.

Temporary fix, filed #341 to address this fully.

dandhlee commented 8 months ago

Tested and verified on a local install of storage:

nox -s docfx --no-venv
nox > Running session docfx
nox > pip install -e .
Obtaining file:///usr/local/google/home/dandhlee/workspace/python-storage
  Preparing metadata (setup.py) ... done
Requirement already satisfied: google-auth<3.0dev,>=2.26.1 in /usr/local/google/home/dandhlee/workspace/extension-env-310/lib/python3.10/site-packages (from google-cloud-storage==2.15.0) (2.26.2)
Requirement already satisfied: google-api-core<3.0.0dev,>=2.15.0 in /usr/local/google/home/dandhlee/workspace/extension-env-310/lib/python3.10/site-packages (from google-cloud-storage==2.15.0) (2.15.0)
Requirement already satisfied: google-cloud-core<3.0dev,>=2.3.0 in /usr/local/google/home/dandhlee/workspace/extension-env-310/lib/python3.10/site-packages (from google-cloud-storage==2.15.0) (2.4.1)
Requirement already satisfied: google-resumable-media>=2.6.0 in /usr/local/google/home/dandhlee/workspace/extension-env-310/lib/python3.10/site-packages (from google-cloud-storage==2.15.0) (2.7.0)
Requirement already satisfied: requests<3.0.0dev,>=2.18.0 in /usr/local/google/home/dandhlee/workspace/extension-env-310/lib/python3.10/site-packages (from google-cloud-storage==2.15.0) (2.31.0)
Requirement already satisfied: google-crc32c<2.0dev,>=1.0 in /usr/local/google/home/dandhlee/workspace/extension-env-310/lib/python3.10/site-packages (from google-cloud-storage==2.15.0) (1.5.0)
Requirement already satisfied: googleapis-common-protos<2.0.dev0,>=1.56.2 in /usr/local/google/home/dandhlee/workspace/extension-env-310/lib/python3.10/site-packages (from google-api-core<3.0.0dev,>=2.15.0->google-cloud-storage==2.15.0) (1.62.0)
Requirement already satisfied: protobuf!=3.20.0,!=3.20.1,!=4.21.0,!=4.21.1,!=4.21.2,!=4.21.3,!=4.21.4,!=4.21.5,<5.0.0.dev0,>=3.19.5 in /usr/local/google/home/dandhlee/workspace/extension-env-310/lib/python3.10/site-packages (from google-api-core<3.0.0dev,>=2.15.0->google-cloud-storage==2.15.0) (4.25.2)
Requirement already satisfied: cachetools<6.0,>=2.0.0 in /usr/local/google/home/dandhlee/workspace/extension-env-310/lib/python3.10/site-packages (from google-auth<3.0dev,>=2.26.1->google-cloud-storage==2.15.0) (5.3.2)
Requirement already satisfied: pyasn1-modules>=0.2.1 in /usr/local/google/home/dandhlee/workspace/extension-env-310/lib/python3.10/site-packages (from google-auth<3.0dev,>=2.26.1->google-cloud-storage==2.15.0) (0.3.0)
Requirement already satisfied: rsa<5,>=3.1.4 in /usr/local/google/home/dandhlee/workspace/extension-env-310/lib/python3.10/site-packages (from google-auth<3.0dev,>=2.26.1->google-cloud-storage==2.15.0) (4.9)
Requirement already satisfied: charset-normalizer<4,>=2 in /usr/local/google/home/dandhlee/workspace/extension-env-310/lib/python3.10/site-packages (from requests<3.0.0dev,>=2.18.0->google-cloud-storage==2.15.0) (3.3.2)
Requirement already satisfied: idna<4,>=2.5 in /usr/local/google/home/dandhlee/workspace/extension-env-310/lib/python3.10/site-packages (from requests<3.0.0dev,>=2.18.0->google-cloud-storage==2.15.0) (3.6)
Requirement already satisfied: urllib3<3,>=1.21.1 in /usr/local/google/home/dandhlee/workspace/extension-env-310/lib/python3.10/site-packages (from requests<3.0.0dev,>=2.18.0->google-cloud-storage==2.15.0) (2.1.0)
Requirement already satisfied: certifi>=2017.4.17 in /usr/local/google/home/dandhlee/workspace/extension-env-310/lib/python3.10/site-packages (from requests<3.0.0dev,>=2.18.0->google-cloud-storage==2.15.0) (2023.11.17)
Requirement already satisfied: pyasn1<0.6.0,>=0.4.6 in /usr/local/google/home/dandhlee/workspace/extension-env-310/lib/python3.10/site-packages (from pyasn1-modules>=0.2.1->google-auth<3.0dev,>=2.26.1->google-cloud-storage==2.15.0) (0.5.1)
Installing collected packages: google-cloud-storage
  Attempting uninstall: google-cloud-storage
    Found existing installation: google-cloud-storage 2.15.0
    Uninstalling google-cloud-storage-2.15.0:
      Successfully uninstalled google-cloud-storage-2.15.0
  Running setup.py develop for google-cloud-storage
Successfully installed google-cloud-storage-2.15.0
nox > pip install grpcio
Requirement already satisfied: grpcio in /usr/local/google/home/dandhlee/workspace/extension-env-310/lib/python3.10/site-packages (1.60.0)
nox > pip install alabaster recommonmark
Requirement already satisfied: alabaster in /usr/local/google/home/dandhlee/workspace/extension-env-310/lib/python3.10/site-packages (0.7.13)
Requirement already satisfied: recommonmark in /usr/local/google/home/dandhlee/workspace/extension-env-310/lib/python3.10/site-packages (0.7.1)
Requirement already satisfied: commonmark>=0.8.1 in /usr/local/google/home/dandhlee/workspace/extension-env-310/lib/python3.10/site-packages (from recommonmark) (0.9.1)
Requirement already satisfied: docutils>=0.11 in /usr/local/google/home/dandhlee/workspace/extension-env-310/lib/python3.10/site-packages (from recommonmark) (0.17.1)
Requirement already satisfied: sphinx>=1.3.1 in /usr/local/google/home/dandhlee/workspace/extension-env-310/lib/python3.10/site-packages (from recommonmark) (4.5.0)
Requirement already satisfied: sphinxcontrib-applehelp in /usr/local/google/home/dandhlee/workspace/extension-env-310/lib/python3.10/site-packages (from sphinx>=1.3.1->recommonmark) (1.0.4)
Requirement already satisfied: sphinxcontrib-devhelp in /usr/local/google/home/dandhlee/workspace/extension-env-310/lib/python3.10/site-packages (from sphinx>=1.3.1->recommonmark) (1.0.2)
Requirement already satisfied: sphinxcontrib-jsmath in /usr/local/google/home/dandhlee/workspace/extension-env-310/lib/python3.10/site-packages (from sphinx>=1.3.1->recommonmark) (1.0.1)
Requirement already satisfied: sphinxcontrib-htmlhelp>=2.0.0 in /usr/local/google/home/dandhlee/workspace/extension-env-310/lib/python3.10/site-packages (from sphinx>=1.3.1->recommonmark) (2.0.1)
Requirement already satisfied: sphinxcontrib-serializinghtml>=1.1.5 in /usr/local/google/home/dandhlee/workspace/extension-env-310/lib/python3.10/site-packages (from sphinx>=1.3.1->recommonmark) (1.1.5)
Requirement already satisfied: sphinxcontrib-qthelp in /usr/local/google/home/dandhlee/workspace/extension-env-310/lib/python3.10/site-packages (from sphinx>=1.3.1->recommonmark) (1.0.3)
Requirement already satisfied: Jinja2>=2.3 in /usr/local/google/home/dandhlee/workspace/extension-env-310/lib/python3.10/site-packages (from sphinx>=1.3.1->recommonmark) (3.1.2)
Requirement already satisfied: Pygments>=2.0 in /usr/local/google/home/dandhlee/workspace/extension-env-310/lib/python3.10/site-packages (from sphinx>=1.3.1->recommonmark) (2.16.1)
Requirement already satisfied: snowballstemmer>=1.1 in /usr/local/google/home/dandhlee/workspace/extension-env-310/lib/python3.10/site-packages (from sphinx>=1.3.1->recommonmark) (2.2.0)
Requirement already satisfied: babel>=1.3 in /usr/local/google/home/dandhlee/workspace/extension-env-310/lib/python3.10/site-packages (from sphinx>=1.3.1->recommonmark) (2.13.1)
Requirement already satisfied: imagesize in /usr/local/google/home/dandhlee/workspace/extension-env-310/lib/python3.10/site-packages (from sphinx>=1.3.1->recommonmark) (1.4.1)
Requirement already satisfied: requests>=2.5.0 in /usr/local/google/home/dandhlee/workspace/extension-env-310/lib/python3.10/site-packages (from sphinx>=1.3.1->recommonmark) (2.31.0)
Requirement already satisfied: packaging in /usr/local/google/home/dandhlee/workspace/extension-env-310/lib/python3.10/site-packages (from sphinx>=1.3.1->recommonmark) (23.2)
Requirement already satisfied: MarkupSafe>=2.0 in /usr/local/google/home/dandhlee/workspace/extension-env-310/lib/python3.10/site-packages (from Jinja2>=2.3->sphinx>=1.3.1->recommonmark) (2.1.3)
Requirement already satisfied: charset-normalizer<4,>=2 in /usr/local/google/home/dandhlee/workspace/extension-env-310/lib/python3.10/site-packages (from requests>=2.5.0->sphinx>=1.3.1->recommonmark) (3.3.2)
Requirement already satisfied: idna<4,>=2.5 in /usr/local/google/home/dandhlee/workspace/extension-env-310/lib/python3.10/site-packages (from requests>=2.5.0->sphinx>=1.3.1->recommonmark) (3.6)
Requirement already satisfied: urllib3<3,>=1.21.1 in /usr/local/google/home/dandhlee/workspace/extension-env-310/lib/python3.10/site-packages (from requests>=2.5.0->sphinx>=1.3.1->recommonmark) (2.1.0)
Requirement already satisfied: certifi>=2017.4.17 in /usr/local/google/home/dandhlee/workspace/extension-env-310/lib/python3.10/site-packages (from requests>=2.5.0->sphinx>=1.3.1->recommonmark) (2023.11.17)
nox > sphinx-build -T -N -D extensions=sphinx.ext.autodoc,sphinx.ext.autosummary,docfx_yaml.extension,sphinx.ext.intersphinx,sphinx.ext.coverage,sphinx.ext.napoleon,sphinx.ext.todo,sphinx.ext.viewcode,recommonmark -b html -d docs/_build/doctrees/ docs/ docs/_build/html/
Running Sphinx v4.5.0
WARNING: while setting up extension sphinx.ext.todo: directive 'todo' is already registered, it will be overridden
making output directory... done
[autosummary] generating autosummary for: README.rst, acl_guide.rst, changelog.md, generation_metageneration.rst, index.rst, retry_timeout.rst, storage/acl.rst, storage/batch.rst, storage/blob.rst, storage/bucket.rst, storage/client.rst, storage/constants.rst, storage/fileio.rst, storage/hmac_key.rst, storage/notification.rst, storage/retry.rst, storage/transfer_manager.rst
Running sphinx-build with Markdown first...
Running Sphinx v4.5.0

versus without the changes:

nox -s docfx
nox > Running session docfx
nox > Creating virtual environment (virtualenv) using python3.10 in .nox/docfx
nox > python -m pip install -e .
nox > python -m pip install grpcio
nox > python -m pip install gcp-sphinx-docfx-yaml alabaster recommonmark
nox > sphinx-build -T -N -D extensions=sphinx.ext.autodoc,sphinx.ext.autosummary,docfx_yaml.extension,sphinx.ext.intersphinx,sphinx.ext.coverage,sphinx.ext.napoleon,sphinx.ext.todo,sphinx.ext.viewcode,recommonmark -b html -d docs/_build/doctrees/ docs/ docs/_build/html/
Running Sphinx v4.5.0

Traceback (most recent call last):
  File "/usr/local/google/home/dandhlee/workspace/python-storage/.nox/docfx/lib/python3.10/site-packages/sphinx/registry.py", line 438, in load_extension
    metadata = setup(app)
  File "/usr/local/google/home/dandhlee/workspace/python-storage/.nox/docfx/lib/python3.10/site-packages/sphinxcontrib/applehelp/__init__.py", line 230, in setup
    app.require_sphinx('5.0')
  File "/usr/local/google/home/dandhlee/workspace/python-storage/.nox/docfx/lib/python3.10/site-packages/sphinx/application.py", line 393, in require_sphinx
    raise VersionRequirementError(version)
sphinx.errors.VersionRequirementError: 5.0

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/local/google/home/dandhlee/workspace/python-storage/.nox/docfx/lib/python3.10/site-packages/sphinx/cmd/build.py", line 272, in build_main
    app = Sphinx(args.sourcedir, args.confdir, args.outputdir,
  File "/usr/local/google/home/dandhlee/workspace/python-storage/.nox/docfx/lib/python3.10/site-packages/sphinx/application.py", line 219, in __init__
    self.setup_extension(extension)
  File "/usr/local/google/home/dandhlee/workspace/python-storage/.nox/docfx/lib/python3.10/site-packages/sphinx/application.py", line 380, in setup_extension
    self.registry.load_extension(self, extname)
  File "/usr/local/google/home/dandhlee/workspace/python-storage/.nox/docfx/lib/python3.10/site-packages/sphinx/registry.py", line 441, in load_extension
    raise VersionRequirementError(
sphinx.errors.VersionRequirementError: The sphinxcontrib.applehelp extension used by this project needs at least Sphinx v5.0; it therefore cannot be built with this version.

Sphinx version error:
The sphinxcontrib.applehelp extension used by this project needs at least Sphinx v5.0; it therefore cannot be built with this version.