Skip to content

Conversation

@aucampia
Copy link
Member

@aucampia aucampia commented Mar 19, 2023

Summary of changes

The main aim of this change is to get to a newer version of Sphinx.

However, if just Sphinx is upgraded, poetry can't do version solving because of
the version of importlib-metadata that flake8 needs:

$ poetry install
Updating dependencies
Resolving dependencies... (0.6s)

Because no versions of flakeheaven match >3.2.1,<4.0.0
 and flakeheaven (3.2.1) depends on flake8 (>=4.0.1,<5.0.0), flakeheaven (>=3.2.1,<4.0.0) requires flake8 (>=4.0.1,<5.0.0).
And because no versions of flake8 match >4.0.1,<5.0.0
 and flake8 (4.0.1) depends on importlib-metadata (<4.3), flakeheaven (>=3.2.1,<4.0.0) requires importlib-metadata (<4.3).
And because sphinx (5.3.0) depends on importlib-metadata (>=4.8)
 and no versions of sphinx match >5.3.0,<6.0.0, flakeheaven (>=3.2.1,<4.0.0) is incompatible with sphinx (>=5.3.0,<6.0.0).
So, because rdflib depends on both sphinx (^5.3.0) and flakeheaven (^3.2.1), version solving failed.

To make things work, flake8 and related is only installed for Python >=3.8,
where the built-in importlib.metadata is used instead of the
importlib-metadata package.

This means no more flake8 on python 3.7, but it is a reasonable trade-off to get
to a newer version of Sphinx, and Python 3.7 support will be dropped by
2023-06-27 anyway.

Other changes:

  • Changed Read the Docs to use the Sphinx version from poetry instead of the
    custom version that was in devtools/requirements-rtd.txt.
  • Added typing-extensions to the poetry docs dependency group as it is
    needed for docs to build correctly.
  • Changed the tox docs environment to be closer to the Read the Docs
    environment.

Closes #2272.

Checklist

  • Checked that there aren't other open pull requests for
    the same change.
  • Checked that all tests and type checking passes.
  • Considered granting push permissions to the PR branch,
    so maintainers can fix minor issues and keep your PR up to date.

@aucampia aucampia force-pushed the iwana-20230318T1450-flake8_diff branch 2 times, most recently from 6a17318 to ab41a2f Compare March 19, 2023 09:23
@aucampia aucampia changed the title Iwana 20230318 t1450 flake8 diff build: upgrade sphinx and change flake8 and related to only install on python >=3.8 Mar 19, 2023
@aucampia aucampia marked this pull request as ready for review March 19, 2023 09:26
@aucampia aucampia marked this pull request as draft March 19, 2023 09:43
@coveralls
Copy link

coveralls commented Mar 19, 2023

Coverage Status

Coverage: 90.782%. Remained the same when pulling 1624b72 on aucampia:iwana-20230318T1450-flake8_diff into 7a05c15 on RDFLib:main.

@aucampia aucampia force-pushed the iwana-20230318T1450-flake8_diff branch from fdd5b61 to 18070cc Compare March 19, 2023 10:49
@aucampia aucampia marked this pull request as ready for review March 19, 2023 10:50
@aucampia aucampia added review wanted This indicates that the PR is ready for review ready to merge The PR will be merged soon if no further feedback is provided. labels Mar 19, 2023
@aucampia aucampia requested a review from a team March 19, 2023 14:50
@aucampia aucampia force-pushed the iwana-20230318T1450-flake8_diff branch 2 times, most recently from 00bea01 to b7c0aa2 Compare March 19, 2023 15:25
…n python >=3.8

The main aim of this change is to get to a newer version of Sphinx.

However, if just Sphinx is upgraded, poetry can't do version solving because of
the version of `importlib-metadata` that flake8 needs:

```console
$ poetry install
Updating dependencies
Resolving dependencies... (0.6s)

Because no versions of flakeheaven match >3.2.1,<4.0.0
 and flakeheaven (3.2.1) depends on flake8 (>=4.0.1,<5.0.0), flakeheaven (>=3.2.1,<4.0.0) requires flake8 (>=4.0.1,<5.0.0).
And because no versions of flake8 match >4.0.1,<5.0.0
 and flake8 (4.0.1) depends on importlib-metadata (<4.3), flakeheaven (>=3.2.1,<4.0.0) requires importlib-metadata (<4.3).
And because sphinx (5.3.0) depends on importlib-metadata (>=4.8)
 and no versions of sphinx match >5.3.0,<6.0.0, flakeheaven (>=3.2.1,<4.0.0) is incompatible with sphinx (>=5.3.0,<6.0.0).
So, because rdflib depends on both sphinx (^5.3.0) and flakeheaven (^3.2.1), version solving failed.
```

To make things work, flake8 and related is only installed for Python >=3.8,
where the built-in `importlib.metadata` is used instead of the
`importlib-metadata` package.

This means no more flake8 on python 3.7, but it is a reasonable trade-off to get
to a newer version of Sphinx, and Python 3.7 support will be dropped by
2023-06-27 anyway.

Other changes:
- Changed Read the Docs to use the Sphinx version from poetry instead of the
  custom version that was in `devtools/requirements-rtd.txt`.
- Added `typing-extensions` to the poetry `docs` dependency group as it is
  needed for docs to build correctly.
- Changed the tox `docs` environment to be closer to the Read the Docs
  environment.

Closes <RDFLib#2272>.
@aucampia aucampia force-pushed the iwana-20230318T1450-flake8_diff branch from b7c0aa2 to 1624b72 Compare March 19, 2023 15:28
@aucampia
Copy link
Member Author

Planning to merge this by 2023-03-21.

Copy link

@ghost ghost left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm 👍

@aucampia
Copy link
Member Author

Thanks for the review @gjhiggins

@aucampia aucampia merged commit dd44ae1 into RDFLib:main Mar 21, 2023
@aucampia aucampia deleted the iwana-20230318T1450-flake8_diff branch April 9, 2023 15:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready to merge The PR will be merged soon if no further feedback is provided. review wanted This indicates that the PR is ready for review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix inconsistent sphinx versions

2 participants