PIPENV & POETRY COMPARED

Dependencies are the relationships of the preceding tasks to the succeeding task. Both Pipenv and its successor, Poetry, are dependency management tools which are most popular with developers worldwide. But how do they compare with each other? Pipenv Vs Poetry tells us how.

Dependencies

Dependencies are created whenever a class depends on another class. If a class A depends on a class B to function, class A is called a “dependent”, while class B is known as a “dependency”. It means that, to use or reuse class A, class B must also be used (or reused). Whenever object oriented design of API’s and Applications are done, Dependencies and their removal become important. Any discussion on OOP (Object Oriented Programming) is incomplete without mentioning Dependencies and loose couplings. Two classes that use each other are called “coupled”. The coupling between classes can be loose or tight, or a bit of both. Actually, the degree of tightness is continuous, and is often characterized as “strong” or “weak”.

But Dependencies represent weaknesses in OOP. They decrease reuse. Reuse has positive impact on development speed, code quality and code readability, and so on. The three different types of Dependencies are Class, Interface and Method/Field Dependencies. Dependencies also have important characteristics. They can be runtime, compile-time, hidden or visible, local and contextual, direct or indirect. But whatever they are, they need to be eliminated, or at least, Managed.

Pipenv Vs Poetry

Poetry and Pipenv are both budding next-gen Python dependent-management paraphernalia. They both have strong similarities, but are different too. The following is a comparison of the salient points of Pipenv Vs Poetry:

  • Each tool simplifies the procedure to create a virtual environment, and organizing dependencies.
  • By locking dependencies to specific versions, both of them guarantee that builds of the package are reproducible.
  • Poetry and Pipenv work by specifying separate development and core dependents in split sections of the same file to replace separate dependency files.
  • But Poetry has a larger feature set than Pipenv.
  • Both can be used to manage packages and publish packages too. But Poetry is faster, and it is more actively developed, where this is measured by releases. Pipenv was last released on November 26, 2018, but Poetry has been releasing versions every few days.
  • When first released, upgrading any single package of Pipenv upgraded all dependencies. This behavior is now being corrected, though.
  • By default, Poetry installs dev dependencies, while Pipenv installs only dependencies.
  • Poetry performs file locking sooner than Pipenv. Both tools execute file lock post commands, so Poetry feels quicker and snappier when in daily use.
  • Dependencies are differently added in each tool. Pipenv “install” command is dual purpose. Only that package specified will be installed on “pipenv install” command. If no package is specified, all (non-dev) dependencies are also installed.
  • Poetry’s output offers more know-how about Pipenv, inclusive all sub-dependents and further versions.
  • Poetry, unlike Pipenv, has separate commands for adding a new dependency and installing existing dependencies. In this it is similar to Yarn.
  • For security purposes, Poetry checks installed package hashes. To do this, Poetry creates a provisional prerequisite file to create pip checking hashes. This creates an overhead, which brings about the distinction between both the Tools.
  • Poetry also uninstalls sub-dependencies when trying to remove a specified dependency, provided of course no other package will use them. But Pipenv doesn’t make it a benchmark to follow, for example, and orphans 5 dependents.
  • This was one of the reasons why Poetry was originally developed. In Pipenv, the User may not even realize that the dependencies are inactive until a wrecked build is pushed.
  • Simplified management of Python dependencies is the objective of both Tools. Pipenv is supported officially by the Authority – Python Packaging, and also by Buildpack – Heroku Python, and this is important for developers with Dokku or Heroku based deploying strategy.
  • But Poetry covers all aspects of package management and dependency management. In comparison to Pipenv, Poetry’s separate “install” and “add” commands are clearer and explicit, and is always faster.
  • But there are two pointers where Pipenv is often preferred over Poetry. These are as follows: first, Pipenv supports to export a “requirement.txt” file. Secondly, Poetry presently cannot avoid any package installation as a dependent.
  • But it seems that the imminent release of Poetry v1.0 will take care to remove these two problems. So that even in this area, Poetry will have caught up with and left Pippenv behind.
  • Pipenv’s commands and options are always confusing and unclear, and many options are not available.
  • Many User’s patience were tested beyond the limit by regression issues of Pipenv. Testing against cross platform and multi-environment is not only complicated and difficult, it is very time consuming. But not with Poetry.
Read The Rest