Skip to content

feat(deps): added deptry and removed deps#117

Merged
rileyok-ons merged 3 commits intomainfrom
116-add-deptry-for-checking-unnecessary-deps
Feb 2, 2026
Merged

feat(deps): added deptry and removed deps#117
rileyok-ons merged 3 commits intomainfrom
116-add-deptry-for-checking-unnecessary-deps

Conversation

@rileyok-ons
Copy link
Collaborator

@rileyok-ons rileyok-ons commented Jan 28, 2026

✨ Summary

Resolves #116

We have many unneeded deps in our repo we specify at pyproject but do not use, to check and remove these we can use deptry https://deptry.com/, this will check your pyproject, venv and files to find unused explicit deps and packages referred to but not explicitly imported (also transitive deps).

Using this allows us to remove multiple unneeded explicit deps from our repo, cleaning up our deps and making dependabot patches easier to do

Note: this ignores the DEMO folder

📜 Changes Introduced

  • Feature implementation (feat:) / bug fix (fix:) / refactoring (chore:) / documentation (docs:) / testing (test:)
  • Updates to tests and/or documentation
  • Terraform changes (if applicable)

✅ Checklist

Please confirm you've completed these checks before requesting a review.

  • Code passes linting with Ruff
  • Security checks pass using Bandit
  • API and Unit tests are written and pass using pytest
  • Terraform files (if applicable) follow best practices and have been validated (terraform fmt & terraform validate)
  • DocStrings follow Google-style and are added as per Pylint recommendations
  • Documentation has been updated if needed

🔍 How to Test

Run uv run deptry ., try messing around with it to see errors, it will also run each commit
Here's an example where i added an unused dep
image

@rileyok-ons rileyok-ons linked an issue Jan 28, 2026 that may be closed by this pull request
@github-actions github-actions bot added the enhancement New feature or request label Jan 28, 2026
@frayle-ons
Copy link
Contributor

This looks really cool - was experimenting with it a few days ago and saw similar things in the toml file but like that you've also added it to the precommit.

Did you run into any issues with the optional dependencies for google?

I get the following on your branch running uvx deptry . but I don't get this issue when I run uv run deptry .

Screenshot 2026-01-29 at 11 24 26

@rileyok-ons
Copy link
Collaborator Author

This looks really cool - was experimenting with it a few days ago and saw similar things in the toml file but like that you've also added it to the precommit.

Did you run into any issues with the optional dependencies for google?

I get the following on your branch running uvx deptry . but I don't get this issue when I run uv run deptry .

Screenshot 2026-01-29 at 11 24 26

Yeah might have been wrong with the uvx stuff, as it runs in its own venv it doesn't check our env properly, so uv as a dev dep does it
For extras and stuff deptry checks all optional extras but not dev groups so it won't flag up pre commit and stuff as long as its correctly setup (tested in repos where its not and it flags, we have it right in this one)

@rileyok-ons
Copy link
Collaborator Author

For dep groups seems you can get better config if we need separate ones for docs and tests https://deptry.com/usage/#pep-621-dev-dependency-groups which would be good for add when we put those functionalities in

1 similar comment
@rileyok-ons
Copy link
Collaborator Author

For dep groups seems you can get better config if we need separate ones for docs and tests https://deptry.com/usage/#pep-621-dev-dependency-groups which would be good for add when we put those functionalities in

@frayle-ons
Copy link
Contributor

For dep groups seems you can get better config if we need separate ones for docs and tests https://deptry.com/usage/#pep-621-dev-dependency-groups which would be good for add when we put those functionalities in

Seems good to have that as an option that we might need later

Copy link
Contributor

@frayle-ons frayle-ons left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@rileyok-ons rileyok-ons merged commit c4f11e5 into main Feb 2, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Deptry for checking unnecessary deps

2 participants