In v2.16.1, we would not print any user-site packages if we were:
- In a virtual environment
- Using a custom interpreter
This makes since as we should be isolated away from the system
environment. The only case where we should be seeing user-site packages
is when these environments have system site packages enabled. This patch
brings back this behavior.
Resolves#344.
This change also:
- Makes `Distribution.requires()` into a generator for performance (i.e.
avoid building `list[Requirement]` and then iterating `list[Requirement`
and instead do both at the same time) and so that we can handle invalid
requirement exceptions in `PackageDAG.from_pkgs()` for each individual
requirement string
- Modified conftest to avoid adding a extra comma at the end and removed
some older code
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>