8000 Migrate to pyproject.toml and fix docs build by amCap1712 · Pull Request #167 · metabrainz/sir · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Migrate to pyproject.toml and fix docs build #167

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

Merged
merged 5 commits into from
May 22, 2025
Merged

Migrate to pyproject.toml and fix docs build #167

merged 5 commits into from
May 22, 2025

Conversation

amCap1712
Copy link
Member
@amCap1712 amCap1712 commented May 21, 2025

On the lines of other MeB python projects, migrate SIR build from setup.py to pyproject.toml. Most of the metadata is static, and hence copied from setup.py to pyproject.toml file and remains the same.

versioning is the major change. It is now handled automatically by setuptools_scm. The version is dynamically written by setuptools_scm at project build time, hence the project must also be built and installed during docs build to access the version without errors in sphinx configuration.

A .flake8 file is added because flake8 doesn't support configuration by pyproject.toml yet.

References:

On the lines of other MeB python projects, migrate SIR build from setup.py to
pyproject.toml. Most of the metadata is static, and hence copied from setup.py
to pyproject.toml file and remains the same.

versioning is the major change. It is now handled automatically by `setuptools_scm`.

The other change is the addition of a `.flake8` file because `flake8` doesn't
support configuration by pyproject.toml.

References:

- https://packaging.python.org/en/latest/guides/writing-pyproject-toml/
- https://setuptools-scm.readthedocs.io/en/latest/usage/
- PyCQA/flake8#234
amCap1712 added 3 commits May 22, 2025 02:13
The __version__ is dynamically written by setuptools_scm at project build time, hence
build and install the project during docs build to access it without errors in sphinx
configuration.
readthedocs has started to obey the theme specified in the project's sphinx
configuration since a while. The current sphinx theme configuration of sir docs
predates RTD and was not actually not being used for as long as the docs have
been on RTD. Update the documentation to explicitly use the RTD theme for docs.
@amCap1712 amCap1712 changed the title Migrate to pyproject.toml Migrate to pyproject.toml and fix docs build May 21, 2025
@amCap1712
Copy link
Member Author

ReadTheDocs seems to obey the theme specified in the project's sphinx configuration since a while. The current sphinx theme configuration of sir docs predates RTD. This theme was not actually not being used in RTD docs for a long time. Hence, updated the configuration to explicitly use the RTD theme. For posterity, here is the relic from the past:
image

@amCap1712
Copy link
Member Author

Build succeeds https://app.readthedocs.org/projects/sir/builds/28256467/ and documentation at https://sir.readthedocs.io/en/pyproject/. Once the PR/docs are reviewed, I'll delete the build from RTD.

Copy link
Contributor
@yvanzo yvanzo left a comment

Choose a reason for hiding this comment

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

Thank you, the code changes look good, the commit messages are very helpful, and you mentioned having tested it in the chat.

Please just keep crediting the original author when adding our credits to it, see the suggested changes.

Co-authored-by: yvanzo <yvanzo@users.noreply.github.com>
Copy link
Contributor
@yvanzo yvanzo left a comment

Choose a reason for hiding this comment

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

💯

@yvanzo yvanzo merged commit aa8de5f into master May 22, 2025
1 check passed
@yvanzo yvanzo deleted the pyproject branch May 22, 2025 13:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0