Skip to content

Support pyproject.toml#91

Merged
twm merged 31 commits into
trunkfrom
90-pyproject.toml
Jul 8, 2024
Merged

Support pyproject.toml#91
twm merged 31 commits into
trunkfrom
90-pyproject.toml

Conversation

@twm
Copy link
Copy Markdown
Member

@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
Copy Markdown
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!

Comment thread .coveragerc
Comment thread _build_meta.py
Comment thread src/incremental/__init__.py
Comment thread src/incremental/__init__.py
- 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
Copy Markdown
Member 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
@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

Development

Successfully merging this pull request may close these issues.

Provide a way to leverage incremental from pyproject.toml without importing the target package Dependency cycle with twisted sdist is missing tests

2 participants