4 ms·
pip is not very comparable to npm imo because it never evolved the ability to really handle projects, create venvs on its own, create lock files, etc. Poetry i
by scrollaway 6y ago
pip is not very comparable to npm imo because it never evolved the ability to really handle projects, create venvs on its own, create lock files, etc.
Poetry is what's most comparable and personally, i am not working in python projects that don't use poetry anymore. Whenever I work on a new one, i port it to use poetry
- shadycuz 6y agoI also insist on poetry for any python modules or applications. If it's going to support multiple versions of python then throw pyenv in for development and cicd. If your new to poetry and pyenv I can't recommend https://cjolowicz.github.io/posts/hypermodern-python-01-setup/ https://cjolowicz.github.io/posts/hypermodern-python-01-setu... enough. Even with 10 years python experience it changed how I work with it for the better.
- angrais 6y agoI agree and wholeheartedly recommend this blog post series. It's something every python developer should read because if you're not using poetry for example, then you're making your development life more difficult than necessary.
- globular-toast 6y agoPoetry still has to deal with Python's flat dependency structure which means it needs a complicated dependency resolver. This isn't a bad thing though, imo. There are pros and cons.
- jgwil2 6y agoWhy can't Python support a tree structure?
- ttymck 6y agoMy intuition: a python interpreter gets one `PYTHONPATH` variable and so when I `import my_dep` in my app and another dependency also imports `my_dep`, they are resolved by the interpreter and cannot specify different source locations for `my_dep`, which I believe would be called "vendoring". Again I am not sure if that is why Python can't support a tree or simply why it doesn't currently support a tree, I searched for a PEP explicitly defining dependency resolution but couldn't find one.