Hey everyone welcome back to the third post of the series can-python-do-that
. Wow it's already the third week and I am enjoying to do this 👨🏻💻
Github Repository ⭐️
The repository that holds the assets for the series.
Rohithgilla12 / can-python-do-that
This is official repository of the series "can python do that".
To all the JS folks out there, how many time did you feel it would be great if python also has package manager like npm
or yarn
with those *.lock
files. I'm yarn
fan 😛 btw.
How many times have you encountered problems managing versions in python projects 🤔?
How many times have you hit stackoverflow searching for version mismatch problems?
Well today in our series we are going to talk about the package mangers in python
.
Libraries that we sail over today 🚢
- Poetry
- Pipenv
- Virtualenv
Poetry
Poetry is a tool for dependency management and packaging in Python. It allows you to declare the libraries your project depends on and it will manage (install/update) them for you
This is my personal favourite library. I tried different libraries for dependecy management but finally stuck to this.
P.S: If you are thinking what toml
means it stands for Tom's Obvious, Minimal Language.
Pipenv
Pipenv is a tool that aims to bring the best of all packaging worlds (bundler, composer, npm, cargo, yarn, etc.) to the Python world.
It automatically creates and manages a virtualenv for your projects, as well as adds/removes packages from your Pipfile
as you install/uninstall packages. It also generates the ever-important Pipfile.lock
, which is used to produce deterministic builds.
Virtualenv
virtualenv
is used to manage Python packages for different projects. Using virtualenv allows you to avoid installing Python packages globally which could break system tools or other projects. You can install virtualenv using pip.
Peace ✌🏻,
Rohith Gilla
Spoiler Alert: Next week it is going to be about AI/ML libraries 🍩
Top comments (9)
Both Node.js (NPM/Yarn) and Python (PIP) can install directly from GitHub as well as a tag / commithash.
Not as convenient as Deno, though.
Wow, How does Deno do it?
Just wanted to know #curious
The convenience of Deno is that you put directly the GitHub URL of the repo. Which means that instead of knowing the package name you have to know its full URL (
https://github.com/encode/django-rest-framework
vsdjangorestframework
by example) but also if the project moves then you have to change the URL. And of course since the version of the package is in the URL, you have to know the version you're using all over the place (and change it when you upgrade).Did I mention that Deno is so usable that its website is made with Node?
It is probably better to add tag or commithash as well.
So,
https://github.com/encode/django-rest-framework@3.9.3
, or something. I haven't tested.Dammn isn’t that hard. Like every time the repo has some breaking changes and since we link with url in the code won’t that break our application 🤯
Can't agree more on Poetry, that's definitely the most convenient tool out there by far!
True installation of the tool is also sweet.
The repo for this whole series in maintained by poetry files only 😅😌
Nice Article :) Thanks for the Information.
Thanks 🙌