Maxime Lemaitre’s Post

python dependency hell isn’t a tooling problem. It’s a workflow problem 🕸️ I often feel that dependency management is poorly handled in many python projects I’ve seen 🟥 What most python engineers do: add several packages, put hard version constraints (==1.0.1), and don’t touch them unless there’s a specific need (a new feature or end of support). That’s how you end up in dependency hell. The 𝘭𝘰𝘤𝘬 𝘢𝘯𝘥 𝘧𝘰𝘳𝘨𝘦𝘵 approach works for the first month, but it slowly turns the project into something that’s hard to update. The dependency resolution (taking a list of requirements and converting them to a list of package versions) problem is already largely solved thanks to modern resolvers 💪 You should adapt your workflow 👉 𝘂𝘀𝗲 𝗿𝗲𝗹𝗮𝘅𝗲𝗱 𝗰𝗼𝗻𝘀𝘁𝗿𝗮𝗶𝗻𝘁𝘀 (>=1.0.0 < 2.0.0) - embrace semantic versioning 👉 𝘄𝗶𝘀𝗲 𝗶𝗺𝗽𝗼𝗿𝘁 - every import has a cost 👉 𝘂𝘀𝗲 𝗺𝗼𝗱𝗲𝗿𝗻 𝗿𝗲𝘀𝗼𝗹𝘃𝗲𝗿𝘀 ( ❤️ uv) - lock files are key 👉 𝗿𝗲𝗴𝘂𝗹𝗮𝗿 𝘂𝗽𝗱𝗮𝘁𝗲𝘀 (𝗱𝗲𝗽𝗲𝗻𝗱𝗮𝗯𝗼𝘁, 𝗿𝗲𝗻𝗼𝘃𝗮𝘁𝗲, ..) - implement a regular routine #data #dataengineering #python #uv #dependencyhell

  • No alternative text description for this image

To view or add a comment, sign in

Explore content categories