Comment by zbentley
2 days ago
Common? Yes. Canonical/ideal? No. Optional dependency specifiers in your package metadata is a much better way to go. You can use those even if you don't publish your package as an artifact; `pip install -e .[optional-thing]` should work, or can be made to, easily.
That's only part of the puzzle. Your program needs to branch on whether the dependency is installed or not!
"Oh you don't have optional dependency? Then do X" needs to happen at runtime right?