( )⚙ D11393 pep-517: remove the `build-backend` key to allow for users to build extensions

This is an archive of the discontinued Mercurial Phabricator instance.

pep-517: remove the `build-backend` key to allow for users to build extensions
ClosedPublic

Authored by Alphare on Sep 9 2021, 4:42 AM.

Details

Summary

PEP 517 changed how projects should define their build dependencies.
The presence of a pyproject.toml file changes the behavior of pip to
conform to PEP 517.
Since we haven't updated the setup.py file yet (I'm not even sure we're not
an edge case which would make it harder/impossible, I have not tried yet), this
is a workaround to issue6589: it allows users to pass --no-use-pep517 to pip
to revert to the legacy installer. The build backend is simply assumed to be
the build_meta:__legacy__ one.

Diff Detail

Repository
rHG Mercurial
Branch
stable
Lint
No Linters Available
Unit
No Unit Test Coverage

Event Timeline

Alphare created this revision.Sep 9 2021, 4:42 AM

This is needed on stable, is it not ?

I can confirm this makes installation with pip include the Rust modules and set the module policy to rust+c with the following command lines:

$pytthon -m pip install --no-use-pep517 --global-option --rust /path/to/mercurial/sources
$pytthon -m pip install --no-use-pep517 -r requirements.txt

In the latter case (which is crucial for Heptapod, the application I have in mind), the requirements file looks like this:

/path/to/mercurial/sources --global-option --rust

it is not possible to specify this --no-use-pep517 in the requirements file, because that is a global *pip* option (whereas --global-option is for global options of setup.py).

I fully expect that /path/to/mercurial/sources can be replaced with the simpler Mercurial==5.9.2 if this is released. In fact I also tried a hg+https requirement for the sake of it.

This revision was not accepted when it landed; it landed in state Needs Review.
This revision was automatically updated to reflect the committed changes.