-
Notifications
You must be signed in to change notification settings - Fork 147
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
[Proposal] Include abstract dependencies in install_requires format in Pipfile.lock #98
Comments
I should list the alternatives here that I see:
Also, while in principle |
Hopefully this is the right place to add another request: a bit of documentation explaining in clear terms what should be done when converting some code into a library. I'm far from a Python expert, and I used |
I also think that I can elaborate on use-case more if needed. This same |
Any updates on this issue? It should be pretty trivial to do and maintenance cost should be minimal. Should I make a PR? |
This feels to me like it is adding another quirk to python packaging. If we do this, As the use case if for libraries, doesn't this also mean that now libraries have to publish their To me, a much better way to handle this would be to extend the Pipfile with enough information to automatically generate a |
Sorry, but one of us is misunderstanding this issue. My understanding is that Am I misunderstanding something? |
Summary: It would be nice if
Pipfile.lock
contained the abstract dependencies in a way that could be used ininstall_requires
insetup.py
, as this would allow better tooling in the near term for library developersThis is intended as an actionable follow-up to #27, https://github.com/kennethreitz/pipenv/issues/209.
To summarize many earlier discussions, across applications and libraries, we can taxonomize three different kinds of abstract dependencies.
Currently, (1) and (3) are handled via
Pipfile
(orrequirements.in
). (2) is handled bysetup.py
. (4) and (5) are handled byPipfile.lock
(orrequirements.txt
).In practice, however, (1) and (2) above are often managed in very similar ways. Also, the requirements around (5) are nearly identical for both libraries and applications.
This mostly works, except there is proximate room for improvement in tooling support. Specifically, my user workflow for adding a dependency per (2) to a library closely resembles that for adding a dependency per (1) for an application. I want to add the dependency to the abstract specification, then lock down a version for my development environment per (5) to have a reproducible build environment (so I can e.g. separate out test failures from dep version bumps from those relating to my own code). While this is easy for an application with
Pipfile
, it's not really possible for a library usingsetup.py
, sincesetup.py
is arbitrary Python rather than structured data.In an ideal world, this would be a non-issue if we had a
setuptools
entry inpyproject.toml
, but we don't have that right now. This would also be less of an issue if we could just includepackages
fromPipfile
insetup.py
, but barring near-universal adoption ofpyproject.toml
, there's no real way to access a TOML parser insetup.py
.That leaves a last option, which is realizable – as
Pipfile.lock
is just JSON, if the abstract dependencies fromPipfile
are made available inPipfile.lock
, then it would be straightforward to just forward through those dependencies fromsetup.py
with an appropriately configured package manifest.This would mitigate the flaws in tooling available for Python library development right now. Once better solutions become available in the future, as this is something that would be handled within packages, it would be straightforward to remove this section from
Pipfile.lock
and move people to newer tooling instead.The text was updated successfully, but these errors were encountered: