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

Support pyproject.toml #91

Merged
merged 31 commits into from
Jul 8, 2024
Merged

Support pyproject.toml #91

merged 31 commits into from
Jul 8, 2024

Conversation

twm
Copy link
Contributor

@twm twm commented Jul 1, 2024

Add support for the setuptools.finalize_distribution_options entry point so that Incremental can be configured with pyproject.toml alone. This is patterned off of the interface setuptools_scm documents: the user creates a [tool.incremental] section in pyproject.toml

The actual implementation is quite different from the distutils one. The finalize_distribution_options hook always seems to be passed an empty Distribution object which is unable to list the files in the package. I settled on extracting the project name from pyproject.toml and reusing the logic from the incremental.update module to locate _version.py. As a side effect I reworked that logic to avoid a Twisted dependency for FilePath.

Also:

  • Tests now check that __version__ and the package metadata match
  • The project uses pyproject.toml instead of setup.cfg
  • Drop a bunch of Python 2.7 compatibility code

Fixes #90. Fixes #88. Fixes #80.

@twm twm force-pushed the 90-pyproject.toml branch 2 times, most recently from 3be2c80 to bbf48d0 Compare July 2, 2024 01:04
@twm twm force-pushed the 90-pyproject.toml branch from 98a23f2 to b2d4d8e Compare July 3, 2024 04:08
twm added 13 commits July 2, 2024 21:28
Disabling this isn't helping get coverage.
This package provides the .pth hack to start coverage in sub-processes.
By adding it to the build requirements of the example packages we may be
able to get coverage within Pip's isolated build environment. 🤞
This is already included in file form, so there's no reason to copy the
text of the file into the package metadata too.
- Move build/install into the test methods to reduce coupling with
  tox.ini
- Add the missing COVERAGE_PROCESS_START environment variable
- Move -p (parallel) to the config file
- When combining, pull coverage from the example directories because the
  package build process uses them as a working directory
The examples don't need the coverage-p hack because the tests don't
isolate the build.
@twm twm force-pushed the 90-pyproject.toml branch from cdccff2 to bd4d87b Compare July 7, 2024 20:36
@twm twm marked this pull request as ready for review July 7, 2024 21:00
@twm twm requested a review from a team July 7, 2024 21:00
Copy link
Member

@glyph glyph left a comment

Choose a reason for hiding this comment

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

I love it, this is a huge feature upgrade. Thanks for doing this!

.coveragerc Show resolved Hide resolved
_build_meta.py Show resolved Hide resolved
src/incremental/__init__.py Show resolved Hide resolved
src/incremental/__init__.py Show resolved Hide resolved
- Include _build_meta.py so that python -m build works.
- Include all the test files in the sdist. Fixes #80.
@twm twm force-pushed the 90-pyproject.toml branch from fbebdd1 to e12b04a Compare July 8, 2024 01:01
@twm
Copy link
Contributor Author

twm commented Jul 8, 2024

Thank you for the swift review @glyph! I dropped in a missing newsfragment for #80 and will merge now.

@twm twm merged commit 5433dfd into trunk Jul 8, 2024
7 checks passed
@twm twm deleted the 90-pyproject.toml branch July 8, 2024 01:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants