Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Request: Implement deptry / pip-check-reqs #10015

Open
adamtheturtle opened this issue Feb 17, 2024 · 3 comments
Open

Request: Implement deptry / pip-check-reqs #10015

adamtheturtle opened this issue Feb 17, 2024 · 3 comments
Labels
packaging Package management related, i.e. uv plugin Implementing a known but unsupported plugin

Comments

@adamtheturtle
Copy link

deptry and pip-check-reqs are similar tools.

They check whether there are unused or missing dependencies.

Use cases include:

  • My code works but I rely on a transitive dependency, and that could bite me in the future
  • My tests pass, but one of my dependencies is specified as a test dependency
  • I am wasting time/space installing a dependency which I do not need

My uninformed guess/hope is that with uv, astral-sh now has the tooling to understand the project's requirements, and with existing ruff rules, there is an understanding of the project's imports.

Context: I took over responsibility for pip-check-reqs a few years ago as a user of the project as it was breaking.

@zanieb
Copy link
Member

zanieb commented Feb 17, 2024

Hi! Thanks for the issue :)

We are indeed very interested in the idea of leveraging uv for linting. I'm not sure if it'll happen soon though.

@zanieb zanieb added plugin Implementing a known but unsupported plugin packaging Package management related, i.e. uv labels Feb 17, 2024
@baggiponte
Copy link

+1 on the request. Deptry latest alpha is already using a bit of rust to parse the AST. ruff alone could perform these kind of checks, I guess. The biggest roadblock is that some packages are installed as something and imported as something_else.

@charliermarsh
Copy link
Member

I think the main challenges here aren't technical, but more-so that it requires deeper coupling to Python, since we need to know the sys.path in order to look for installed packages (at least for some of these rules, and to resolve the issue around something being imported as something_else). That also means we need to be running within a virtual environment, or have a path to a .venv provided by the user (like in Pyright).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
packaging Package management related, i.e. uv plugin Implementing a known but unsupported plugin
Projects
None yet
Development

No branches or pull requests

4 participants