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

Migrate fully to pyproject.toml #1324

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

neiljp
Copy link
Collaborator

@neiljp neiljp commented Mar 15, 2023

What does this PR do?

This completes the migration to use pyproject.toml in place of a combination of setup.cfg and setup.py.

While the migration itself is fairly straightforward, this required various back and forth comparisons to determine which files were included, since this was unclear from the previous version.

For this reason, the first commit modifies the way that files to be included are specified, which then translates cleanly when migrating to pyproject.toml.

The choice of MANIFEST.in was also motivated by exploration of setuptools_scm as an alternative/extra backend, which would allow packaging with specific versions, but which uses that file to determine files to be excluded compared to those in git.

Tested?

  • Manually
  • Existing tests (adapted, if necessary)
  • New tests added (for any new behavior)
  • Passed linting & tests (each commit)

This has been tested to produce good sets of files, and published to testpypi.

Previously setup.py specifically excluded tests from being packaged, but recent
testing demonstrated this now included other files, including development
tools.

Moving to use the `include` option for the source is simpler here, combined
with the addition of a MANIFEST.in file.

The MANIFEST.in file is used by various tools, and appears more reliable than
other methods to achieve this, particularly as we move towards using
pyproject.toml.

For now, this aims to remove all but the absolute minimum files to run.
@neiljp neiljp added the area: infrastructure Project infrastructure label Mar 15, 2023
@neiljp neiljp added this to the Next Release milestone Mar 15, 2023
@zulipbot zulipbot added the size: XL [Automatic label added by zulipbot] label Mar 15, 2023
@neiljp neiljp force-pushed the 2023-03-13-pyproject branch from 0a65df3 to f423b8e Compare March 15, 2023 02:46
@zulipbot zulipbot added size: S [Automatic label added by zulipbot] and removed size: XL [Automatic label added by zulipbot] labels Mar 15, 2023
This transfers details from setup.py to equivalent ones in pyproject.toml,
and similarly removes or substitutes references to these files.

Note: This introduces two changes from the previous state:
* Building packages no longer removes the top title line shown on GitHub
* The `zip_safe` property is detected automatically by `setuptools`

This also adds a note to the making-a-new-release doc, since while it was
previously out of date, setup.py will now be absent completely.
@zulipbot zulipbot added size: XL [Automatic label added by zulipbot] and removed size: S [Automatic label added by zulipbot] labels Mar 15, 2023
@neiljp neiljp force-pushed the 2023-03-13-pyproject branch from 8fe4ead to 38c29bd Compare March 15, 2023 04:25
@zulipbot
Copy link
Member

Heads up @neiljp, we just merged some commits that conflict with the changes you made in this pull request! You can review this repository's recent commits to see where the conflicts occur. Please rebase your feature branch against the upstream/main branch and resolve your pull request's merge conflicts accordingly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: infrastructure Project infrastructure has conflicts size: XL [Automatic label added by zulipbot]
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants