Pip: Docs issue: `setup_requires` is explained as problematic in cookbook, but no comparable replacement appears to be given

Created on 17 Mar 2019  路  9Comments  路  Source: pypa/pip

https://pip.readthedocs.io/en/1.4.1/cookbook.html#controlling-setup-requires

This section and various other sources (like https://github.com/cython/cython/issues/2730#issuecomment-473716573 and other helpful comments) say that setup_requires has issues due to its reliance on easy_install and should be avoided.

However, the above cookbook section doesn't actually appear to offer any alternative! I think if you want people to stop using it, this section should really show one. All it appears to do is to show how to work around the package index options not working while still using setup_requires, or am I misunderstanding this section completely?

It would be incredibly helpful if that cookbook section could be expanded to add a demonstration of a full example of a modern setup_requires-equivalent, how it should be done if one wants to avoid deprecated functionality. (or if that is already somewhere else in the cookbook, maybe it would be wise to add a link/reference here?) Because it's not obvious at all to me how to do it :confused:

PS: you're doing great work this is just a minor bump I found worth reporting!

awaiting PR good first issue docs

Most helpful comment

@JonasT setupmeta is a tool that auto-generates some setup.py content (I know it鈥檚 not entirely accurate, but let鈥檚 keep things simple). It is not essential to packaging, thus not mentioned in docs.

All 9 comments

I'm wondering, is it pyproject.toml's build_requires which I should be using maybe? But I'm really wildly guessing here, I really don't know

(Edited by @uranusjr to correct the file name.)

What is pytoml.yml?

The equivalent of setup_requires is roughly PEP 518's [build-system.requires] in pyproject.toml. The equivalence may not be exact - the principle is the same, but replicating the precise feature set of setup_requires was not the goal of the PEP (specifically, build-system.requires uses pip's mechanisms for finding packages, whereas setup_requires uses easy_install's).

BTW, the link you posted is to an extremely old version of the docs. The current version is here (but it says the same, so your point remains).

Documentation PRs to clarify would be welcome.

@pfmoore yeah I meant pyproject.toml :joy: I know so little about it I don't even get the name right

Personnally i'm very happy with setup_requires="setupmeta" which takes care of the setup.py boilerplate for us. Now if this were to become something that would also require configuration in a new file for distutils configurations, then we'd be defeated in our purpose to eliminate boilerplate code using setup_requires.

What is setup_requires="setupmeta"? That doesn't appear to be mentioned in the cookbook either

@JonasT setupmeta is a tool that auto-generates some setup.py content (I know it鈥檚 not entirely accurate, but let鈥檚 keep things simple). It is not essential to packaging, thus not mentioned in docs.

Documentation PRs to clarify would be welcome.

Hello , can i get assigned for this issue ?

@Joe-Sin7h Sure, please feel free to go ahead!

Was this page helpful?
0 / 5 - 0 ratings