Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pre-commit.ci] pre-commit autoupdate #10578

Merged
merged 4 commits into from
Dec 14, 2022
Merged

Conversation

pre-commit-ci[bot]
Copy link
Contributor

@pre-commit-ci pre-commit-ci bot commented Dec 13, 2022

updates:
- [github.com/psf/black: 22.10.0 → 22.12.0](psf/black@22.10.0...22.12.0)
- [github.com/asottile/pyupgrade: v3.3.0 → v3.3.1](asottile/pyupgrade@v3.3.0...v3.3.1)
@nicoddemus nicoddemus added the needs backport applied to PRs, indicates that it should be ported to the current bug-fix branch label Dec 13, 2022
@nicoddemus
Copy link
Member

Strange, readthedocs failed with:

Traceback (most recent call last):
  File "/home/docs/checkouts/readthedocs.org/user_builds/pytest/envs/10578/lib/python3.9/site-packages/sphinx/events.py", line 94, in emit
    results.append(listener.handler(self.app, *args))
  File "/home/docs/checkouts/readthedocs.org/user_builds/pytest/envs/10578/lib/python3.9/site-packages/pallets_sphinx_themes/theme_check.py", line 46, in wrapped
    return f(app, *args, **kwargs)
  File "/home/docs/checkouts/readthedocs.org/user_builds/pytest/envs/10578/lib/python3.9/site-packages/pallets_sphinx_themes/versions.py", line 14, in load_versions
    versions = readthedocs_versions(app)
  File "/home/docs/checkouts/readthedocs.org/user_builds/pytest/envs/10578/lib/python3.9/site-packages/pallets_sphinx_themes/versions.py", line 79, in readthedocs_versions
    DocVersion(name=name, slug=slug, dev=dev, current=slug == current_slug)
  File "/home/docs/checkouts/readthedocs.org/user_builds/pytest/envs/10578/lib/python3.9/site-packages/pallets_sphinx_themes/versions.py", line 116, in __new__
    version = pv.parse(slug)
  File "/home/docs/checkouts/readthedocs.org/user_builds/pytest/envs/10578/lib/python3.9/site-packages/packaging/version.py", line 52, in parse
    return Version(version)
  File "/home/docs/checkouts/readthedocs.org/user_builds/pytest/envs/10578/lib/python3.9/site-packages/packaging/version.py", line 197, in __init__
    raise InvalidVersion(f"Invalid version: '{version}'")
packaging.version.InvalidVersion: Invalid version: 'latest'

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

Traceback (most recent call last):
  File "/home/docs/checkouts/readthedocs.org/user_builds/pytest/envs/10578/lib/python3.9/site-packages/sphinx/cmd/build.py", line 276, in build_main
    app = Sphinx(args.sourcedir, args.confdir, args.outputdir,
  File "/home/docs/checkouts/readthedocs.org/user_builds/pytest/envs/10578/lib/python3.9/site-packages/sphinx/application.py", line 262, in __init__
    self._init_builder()
  File "/home/docs/checkouts/readthedocs.org/user_builds/pytest/envs/10578/lib/python3.9/site-packages/sphinx/application.py", line 335, in _init_builder
    self.events.emit('builder-inited')
  File "/home/docs/checkouts/readthedocs.org/user_builds/pytest/envs/10578/lib/python3.9/site-packages/sphinx/events.py", line 105, in emit
    raise ExtensionError(__("Handler %r for event %r threw an exception") %
sphinx.errors.ExtensionError: Handler <function load_versions at 0x7f39202c0820> for event 'builder-inited' threw an exception (exception: Invalid version: 'latest')

It is not related with tox at all, does anybody has an idea of what might be the problem?

@RonnyPfannschmidt
Copy link
Member

the issue is entirely new - "latest" is not something we use in our code

@RonnyPfannschmidt
Copy link
Member

@nicoddemus identified /pallets_sphinx_themes/versions.py", line 116, in __new__

i suspect a recent packaging release with removal of loose version triggers the issue, will try to verify

@RonnyPfannschmidt
Copy link
Member

@nicoddemus its a compounding bug finally triggerd by the recent packaging release which removes legacy versions

pallets_sphinx_themes seems to be broken with current packaging, we need to pin theo ld one until there is a bugfix

@nicoddemus
Copy link
Member

Do you know to which version should we pin packaging?

@RonnyPfannschmidt
Copy link
Member

@nicoddemus anything <22 should do, its only the latest version that dropped LegacyVersion

nicoddemus added a commit that referenced this pull request Dec 13, 2022
Packaging >=22 no longer supports 'latest' versions, which is the version that is assigned when building the docs.

#10578 (comment)
@nicoddemus
Copy link
Member

nicoddemus commented Dec 13, 2022

Thanks @RonnyPfannschmidt, pinned to < 22, however we still get the same error. Any other ideas?

Btw I'm focusing on the readthedocs build, the docs tox env is failing due to something else (seems like a pytest example in the tox docs has been removed/moved).

@nicoddemus
Copy link
Member

Found the problem: the solution is to configure readthedocs to first install pytest into the virtualen environment, and then install doc/en/requirements.txt. The other way around would cause pytest's own dependency on packaging to overwrite the pinned packaging in doc/en/requirements.txt.

nicoddemus and others added 3 commits December 14, 2022 08:35
In tox 4.0 `passenv` is required to be one per-line, or comma-separated.
Packaging >=22 no longer supports 'latest' versions, which is the version that is assigned when building the docs.

#10578 (comment)

Also first install pytest, then `docs/en/requirements.txt`:

Installing the requirements last will honor pins of libraries
shared between pytest and the docs build.
This reference no longer exists in tox 4.0 docs.
@nicoddemus nicoddemus merged commit f6adebb into main Dec 14, 2022
@nicoddemus nicoddemus deleted the pre-commit-ci-update-config branch December 14, 2022 11:57
nicoddemus added a commit to nicoddemus/pytest that referenced this pull request Jul 31, 2024
package was previously an explicit dependency because it was pinned in pytest-dev#10578, however since then the pin has been removed, so the explicit dependency is no longer necessary.
nicoddemus added a commit to nicoddemus/pytest that referenced this pull request Aug 1, 2024
package was previously an explicit dependency because it was pinned in pytest-dev#10578, however since then the pin has been removed, so the explicit dependency is no longer necessary.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs backport applied to PRs, indicates that it should be ported to the current bug-fix branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants