-
Notifications
You must be signed in to change notification settings - Fork 14
How does it compare to pipenv? #2
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
Comments
@abloch i haven’t built pythonloc but here’s my POV: Pipenv does indeed allow to have per-repository dependencies, but it still uses virtual environments under the hood and requires you to use them anyway (see pipenv shell). So it still has that kind of cognitive load and learning curve for beginners, although it is very convenient once you know how it works and how to use it IMO. From my understanding, pypackages (of which pythonloc is an early implementation) doesn’t use virtualenvs at all — it just modifies the PATH to prefer importing from local packages instead of other ones. It’s a very intuitive workflow I think, and again simplicity and beginner-friendliness is a big pro. Even for seasoned devs, I think this would simplify greatly how we manage dependencies on a per-project basis. One con I may see is ok isolation — it seems pypackages encourage you to use your system Python everywhere. It means you may have access to packages you haven’t installed locally (and your project doesn’t dépend to) if you don’t take enough care. Maybe there’s an option in the pypackages spec to address this that I’m not aware of. |
(Disclosure: I'm a co-author of PEP 582 that this is implementing.) Florimond's answer is basically correct. The fundamental difference is that when implemented, CPython will no longer need to rely on your terminal being configured correctly to locate your packages. Like venv and virtualenv (and also pipenv), it basically relies on The other difference from pipenv (and also venv/virtualenv, depending on how you use them) is that your dependencies live in the same directory as your code. So your entire directory is totally relocatable to anywhere else on your machine or (if you're careful about native dependencies) another machine. It is the lightest-weight isolation we can do. |
Pipenv is an official tool supported by pypa
And to my best understanding serves a similar idea in a different way.
Could you please describe the pros and cons of each?
The text was updated successfully, but these errors were encountered: