replit/upm

How to handle special dependencies like development or extra

pohlt opened this issue · 2 comments

pohlt commented

Most projects have development dependencies which are only required if you want to work on the library itself (e.g. testing frameworks).
Additionally, in Python packages, there's the concept of "extra dependencies" which are not required for the core functionality but allow for some extra functionality.

How can these different dependency flavors by handled with UPM?

bump, trying to install a python package with an extra

I'm actually not sure it's possible to detect, unfortunately, at least without deep static analysis of the code itself.

The good news is that even if upm only guesses the package and not the extra, if you know which extras you want you can re-install the package with the extras you want, and they will start to be tracked, without the need to remove and re-add:

$ upm add flask[async,dotenv]
--> poetry add flask[async,dotenv]
Using version ^3.0.0 for flask

...

Package operations: 2 install, 0 updates, 0 removals

  • Installing asgiref (3.7.2)
  • Installing python-dotenv (1.0.0)

Writing lock file

Hopefully that helps, if you have any more examples of where this could be improved I'm happy to either open this issue back up or have new issues to track problems as they arise.

Thank you for the report!