-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
A way to specify build-dependencies #3651
Comments
The canonical way is to fix packaging metadata in I believe the canonical way now is to enable build isolation (PEP 517), and leverage against PEP 518 (which is available in pip 19.x): [build-system]
requires = ['setuptools', 'wheel', 'stwrapper'] |
Okay, thanks answering. I have not heard too much of PEP 517/518 yet. I thought they were still under consideration, a.k.a. not accepted yet. How exactly could I use that solution today with my above example? Edit: |
They are already accepted, and supported by pip and setuptools. |
Okay, I just learned that the See PEP 517:
So the issue persists. It seems something like this, might be useful:
|
Passing options down to pip like this
seems to have been discussed here #287 |
I wonder if this can be fixed more simply by passing |
Since pypa/pip#6370 will implement a |
@techalchemy What do you think about this, should the change require a PEEP? I’ll submit a fix if that’s not necessary. |
Any work done yet? |
What is the current status of this issue? |
The more I use pipenv, the more I'd like to pass pip-options on a per-package basis (i.e. no. 4 of my proposed solutions).
Not that this wouldn't be a welcome improvement. @uranusjr @kenneth-reitz @techalchemy @nateprewitt |
This seems like a potential good idea. |
Is there any progress here? When is the next release scheduled? At least this seems straight forward to implement:
|
Btw. passing options down to pip generally seems to be a good idea because otherwise, locking fails on Windows for packages like pycurl, because they try to build but require some additional options (see: https://github.com/pycurl/pycurl/blob/master/setup.py#L388):
Generally, it might be a good idea not to fail catastrophically at locking, when pipenv can't build a source distribution on windows (or whatever it does with the source distribution at locking time). |
I agree this would be a good idea, someone just needs to write up a proposal (if you've done this already just point me at it) essentially there's no disagreement about whether this should exist, more just no clear picture of how it should look if we are going to implement it. I don't have any particular uses for it so I would probably have a hard time designing the interface. For instance, would it just be an additional key in the That would be outlined in a Hope that provides a good path forward on this |
Hi Dan, as I said, I'd be happy with something like this:
But I do not know whether it's consistent with how other things work in pipenv. Also I have no idea wow to write a PEEP properly. And there is the question of how to handle it if pipenv would pass an argument to pip and it's also specified in And just to be clear, we have two good ideas here. The one with |
Pipenv might need a way to specify built-dependencies and tooling packages that need to be installed in order for pipenv to do it's job correctly. Even a
pyporject.toml
is not sufficient, because you'd have to pass pip the option--no-use-pep517
in order to install build dependencies and then have pip build fromsetup.py
the old-fashioned way.Example
In my company we use a wrapper around setuptools to simplify writing
setup.py
scripts for our packaging. Let's call this wrapperstwrapper
.A typical
setup.py
would look like this:Where the function
stwrapper.setup
parses arguments, does some extra work and then calls the realsetuptools.setup
. Effectively, thestwrapper
package is sort of a built dependency for us.Lets say we have the following
Pipfile
:and do a
then, with the current version of Pipenv, we get:
Because
stwarpper
is not installed at the time pipenv tries to parse thesetup.py
ofpackage-that-uses-stwrapper-in-its-setup-py
. That is even the case, whenstwrapper
is installed in the system's python installation. Pipenv wants to have it inside the new virtual environment it creates. It's a Catch-22.Our current workaround is to let pipenv create the virutal environment. Then do a
pipenv run pip install stwrapper
inside it and then thepipenv lock
. That way it works.Another, better workaround will be possible one pypa/pip#6370 is merged into pip. Then the behavior of pip-option
--no-use-pep517
will be to install requirements specified in apyproject.toml
and proceed with pre-pep517 installation usingsetup.py
.Possible Solutions
1.) Pipenv gets an equivalent to
setup_requires
in setup files orrequires=[...]
inpyproject.toml
's[backend]
section that is global or we use the existing one that is currently only used forpython_version
:2.) Pipenv uses the system python's installation of
stwrapper
(I'm aware of the--site-packages
option but that may have unwanted side effects).3.) Specify a per-package
requires
, i.e.4.) Pass
--no-use-pep517
to pip for certain packages (similar syntax to 3.) and use that feature in conjunction withpyproject.toml
for these packages5.) Specify an order/priority of package installation, so that the dependency is fullfilled when the dependent package is being installed/
Scope
I guess the problem applies to all projects that use non-standard-libaray packages in their
setup.py
files and/or use setuptools entry points to modify its behavior. You can not put such dependencies in the Pipfile, because they are needed for successfully locking.Related Issues
The text was updated successfully, but these errors were encountered: