Skip to content

Simplest pyproject.toml containing build-system only #24102

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 7 commits into from
Oct 12, 2022

Conversation

ianthomas23
Copy link
Member

This is the start of a transition to a pyproject.toml build system (issue #23815) and is a alternative to (or precursor to) PR #23829.

This is the only part of the pyproject.toml transition that is required for the pybind11 progress to continue. So after this is merged work can continue on both pyproject.toml and pybind11 independently.

@ianthomas23
Copy link
Member Author

ianthomas23 commented Oct 7, 2022

For C/C++ coverage to work, need a CI build using --no-build-isolation as otherwise the .gcno files are created in the isolated build environment which is then deleted.

Edit: The above is no longer true, now if coverage is enabled this PR stores .o and .gcno files outside of the isolated build environment so coverage works regardless of --no-build-isolation or not.

I think we will probably need to use --no-build-isolation for the minimal versions CI run, so that is the obvious CI run to play with.

@ianthomas23
Copy link
Member Author

This is now working as expected, and is the smallest set of changes needed to use pyproject.toml's [build-system]. All of the GitHub Action test runs except for the minimum versions one now use build isolation, i.e. build in a temporary isolated virtual environment to create a wheel and that wheel is then installed in the current working environment. The minimum versions test run does not use build isolation so that it builds against the already installed minimum versions of dependencies.

@@ -208,8 +217,9 @@ def update_matplotlibrc(path):
class BuildPy(setuptools.command.build_py.build_py):
def run(self):
super().run()
update_matplotlibrc(
Path(self.build_lib, "matplotlib/mpl-data/matplotlibrc"))
if not self.editable_mode:
Copy link
Member Author

Choose a reason for hiding this comment

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

It surprised me to discover that when you build the main branch in editable mode this run function is not called. This branch does call the run function so here I am explicitly avoiding the update_matplotlibrc call when in editable mode to give the same behaviour as main branch.

Copy link
Member

Choose a reason for hiding this comment

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

Editable (via pip/setuptools) is quite different from a regular build. I'm not an expert there, but have the feeling that if in doubt expectations on editable installs do not hold. Possibly pep660 will change that.

@tacaswell tacaswell added this to the v3.7.0 milestone Oct 12, 2022
@tacaswell tacaswell merged commit af39f1e into matplotlib:main Oct 12, 2022
@tacaswell
Copy link
Member

Lets get this in ASAP so we can shake out any issues with it.

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.

4 participants