Commit Graph

7 Commits

Author SHA1 Message Date
pre-commit-ci[bot] 1d20129940
[pre-commit.ci] pre-commit autoupdate (#422)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-10-30 08:03:00 -07:00
Kemal Zebari 58fb67d1bd
Warn about and ignore invalid package metadata in the environment (#373)
Resolves #370.

I also decided to break away the "filtering" logic we have in
`get_installed_distributions()` into its own function.
2024-06-02 19:05:35 -07:00
Kemal Zebari e88356ff84
Mimic pip when handling --user-only in a virtual environment (#364)
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.
2024-05-07 10:01:08 -07:00
Kemal Zebari 4a5f90aef7
Have duplicate metadata and invalid reqs warnings honor --warn (#357)
This resolves #355 by making changes and refactors to the warning logic.
It does so by introducing a module-level singleton "WarningPrinter"
object and refactors the code in such a way to integrate this object for
it to be used.
2024-04-28 12:39:13 -07:00
Cunshun Xia 25cbb6fff8
refactor the non_host part for not injecting to custom env (#346)
fix: https://github.com/tox-dev/pipdeptree/issues/343

We can get the sitepackages directory from the given interpreter
directly instead of running our code again with it.
2024-04-09 19:43:50 -07:00
Kemal Zebari ff31dc4be2
Handle duplicated package metadata when using importlib.metadata (#342)
Fixes #341.

Using an environment similar to the one shown in the issue:
```console
$ PYTHONPATH=/workspaces/pipdeptree/temp-site-pkgs/ pipdeptree -a -d 0
Warning!!! Duplicate package metadata found:
"/home/vscode/.local/lib/python3.9/site-packages"
  pluggy                           1.4.0            (using 1.4.0, "/workspaces/pipdeptree/temp-site-pkgs")
  packaging                        24.0             (using 24.0, "/workspaces/pipdeptree/temp-site-pkgs")
  tomli                            2.0.1            (using 2.0.1, "/workspaces/pipdeptree/temp-site-pkgs")
  pytest                           8.1.1            (using 8.1.1, "/workspaces/pipdeptree/temp-site-pkgs")
  exceptiongroup                   1.2.0            (using 1.2.0, "/workspaces/pipdeptree/temp-site-pkgs")
  iniconfig                        2.0.0            (using 2.0.0, "/workspaces/pipdeptree/temp-site-pkgs")
"/usr/local/lib/python3.9/site-packages"
  pip                              23.0.1           (using 24.0, "/home/vscode/.local/lib/python3.9/site-packages")
------------------------------------------------------------------------
chardet==5.2.0
covdefaults==2.3.0
coverage==7.4.4
diff_cover==8.0.3
distlib==0.3.8
exceptiongroup==1.2.0
filelock==3.13.3
gitdb==4.0.11
GitPython==3.1.41
iniconfig==2.0.0
Jinja2==3.1.3
MarkupSafe==2.1.5
packaging==24.0
pip==24.0
pipdeptree==2.16.3.dev3+g91d21e3.d20240403
platformdirs==4.2.0
pluggy==1.4.0
Pygments==2.17.2
pytest==8.1.1
pytest-cov==5.0.0
pytest-mock==3.14.0
setuptools==69.0.3
smmap==5.0.1
tomli==2.0.1
virtualenv==20.25.1
wheel==0.42.0
```
2024-04-04 10:38:48 -07:00
Cunshun Xia 91d21e307f
replace pkg_resources with importlib.metadata and packaging (#333)
Signed-off-by: cunshunxia <cunshunxia@tencent.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Kemal Zebari <60799661+kemzeb@users.noreply.github.com>
Co-authored-by: Kemal Zebari <kemalzebra@gmail.com>
2024-04-02 13:56:00 -07:00