Fix editable-mode logic when pyproject.toml present by cjerdonek · Pull Request #6370 · pypa/pip (original) (raw)
If I understand correctly, then accepting the proposed solution here means:
- Calling
pip install --no-use-pep517 --editable .
with apyproject.toml
present that does not specify a back-end, causes- ...build dependencies specified by
requires=[...]
in thepyproject.toml
will be installed by pip (which btw. is not case yet, see pyproject.toml prevents pip install --user --editable (v19.0.3) #6375) - ...pip will then proceed installation not treating the project as specified by PEP517 but rather in the old way.
- ...build dependencies specified by
- Calling
pip install --editable .
with apyproject.toml
present that does not specify a back-end, on the other hand, will result in- ...display of
editable mode is not supported for pyproject.toml-style projects
error - ...pip exiting with an error status code
- ...display of
I might be wrong, but to me that means, the only canonical way to specify build dependencies in such a project is the --no-use-pep517
option (again, which currently does not install the build dependencies due to what might be a bug or a misunderstanding on my part).
Regardless, even if it did install the specified build dependencies, some other tools like Pipenv, have no way to specify this option on a by-requirement bases. What I mean is that in a Pipenv Pipfile, there is no way to do something like:
# Pipfile
[packages]
i_require_gitpython_to_build = { path = ".", editable = true, requires=["gitpython"] }
# or alternatively:
i_require_gitpython_to_build = { path = ".", editable = true, extra_pip_options=["--no-use-pep517"] }
Which effectively means, one cannot use those tools to develop projects with old-style setup.py
scripts that have build dependencies.
I'm not at all sure if everything I wrote is correct and if the following is a good idea, but maybe, case 1.) should just display a warning instead of failing and the proceed with installing the build dependencies and not processing according to PEP517?
Btw. education on PEP517/518 and the new canonical way of building, developing and installing python package is, from my user perspective, a bit scarce at the moment. So every little bit as soon as possible is appreciated. Just as an example, it took me a long time to find out, that setup-tools does not have its own section in a pyproject.toml
akin to [tools.flit.metadata]
, i.e. it does not parse:
[tool.setuptools.metadata]
module = "mymodule"
author = "confus"
author-email = "someone@somedomain.com"
And other little things like PEP517/518, pyproject.toml
, flit, hatch and poetry just being a small footnote in the official python packaging guide or a user-friendly comprehensive official documentation on setuptools sorely missing. But that's offtopic, sorry.