Recently, I asked about a few developers about their favorite Python dependency management tool, and the responses were fascinating. We all agreed that dependency management with Python looks like hell sometimes. And one tool clearly stole the spotlight basically as silver bullet to the problem. However, I think one tool is not enough and you should consider pros and cons before applying Poetry everywhere.
Below you find my thoughts and solution to most Python projects.
🛠️ Now, when it comes to selecting a dependency management tool – it depends on the situation. For a speedy start, you might rely on `pip`. It's great for small learning projects, but let's face it, as your project grows, so do the challenges of using pip. Plus, it doesn't guarantee a reproducible environment.
🛠️ My go-to hero for keeping dependencies in check - Poetry. It's sleek, it's convenient, and it has the community around it. Yet it's not perfect. Poetry can get a bit stubborn with virtual environments, especially when you're tinkering with automation, monorepos, or testing multiple Python versions.
🛠️ Poetry doesn't do well with constraint files, a key for a correct Airflow installation. Here's where my second go-to tool, `pip-tools`, takes the stage. It might not be as fancy as Poetry and it's harder than pip, but it gets the job done. It ensures a reproducible environment, much like Poetry, but with added flexibility – even if it requires a bit more patience.