-
Notifications
You must be signed in to change notification settings - Fork 431
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
Remove unused dependencies, add deptry
to make sure the dependencies stay up-to-date
#955
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like this idea.
We should fix the errors before adding this to the pipeline though. Additionally, would be good to have documentation in docs/community/contribute.md
referencing how to run this command. Currently I need to run deptry ./outlines
to avoid errors from .myenv/
and build/
.
Do these errors mean we would need to explicitly depend on outlines
in pyproject.toml?
outlines/__init__.py:2:8: DEP003 'outlines' imported but it is a transitive dependency
outlines/__init__.py:3:8: DEP003 'outlines' imported but it is a transitive dependency
outlines/__init__.py:4:8: DEP003 'outlines' imported but it is a transitive dependency
outlines/__init__.py:5:8: DEP003 'outlines' imported but it is a transitive dependency
outlines/__init__.py:6:8: DEP003 'outlines' imported but it is a transitive dependency
outlines/__init__.py:7:1: DEP003 'outlines' imported but it is a transitive dependency
outlines/__init__.py:8:1: DEP003 'outlines' imported but it is a transitive dependency
outlines/__init__.py:9:1: DEP003 'outlines' imported but it is a transitive dependency
outlines/__init__.py:10:1: DEP003 'outlines' imported but it is a transitive dependency
outlines/caching.py:51:5: DEP003 'outlines' imported but it is a transitive dependency
outlines/fsm/fsm.py:4:1: DEP003 'outlines' imported but it is a transitive dependency
outlines/fsm/guide.py:7:1: DEP003 'outlines' imported but it is a transitive dependency
outlines/fsm/guide.py:8:1: DEP003 'outlines' imported but it is a transitive dependency
outlines/fsm/guide.py:9:1: DEP003 'outlines' imported but it is a transitive dependency
outlines/fsm/parsing.py:38:1: DEP003 'outlines' imported but it is a transitive dependency
outlines/function.py:7:1: DEP003 'outlines' imported but it is a transitive dependency
outlines/generate/api.py:5:1: DEP003 'outlines' imported but it is a transitive dependency
outlines/generate/api.py:6:1: DEP003 'outlines' imported but it is a transitive dependency
outlines/generate/cfg.py:3:1: DEP003 'outlines' imported but it is a transitive dependency
outlines/generate/cfg.py:4:1: DEP003 'outlines' imported but it is a transitive dependency
outlines/generate/cfg.py:5:1: DEP003 'outlines' imported but it is a transitive dependency
outlines/generate/choice.py:4:1: DEP003 'outlines' imported but it is a transitive dependency
outlines/generate/choice.py:5:1: DEP003 'outlines' imported but it is a transitive dependency
outlines/generate/choice.py:6:1: DEP003 'outlines' imported but it is a transitive dependency
outlines/generate/format.py:3:1: DEP003 'outlines' imported but it is a transitive dependency
outlines/generate/format.py:4:1: DEP003 'outlines' imported but it is a transitive dependency
outlines/generate/format.py:5:1: DEP003 'outlines' imported but it is a transitive dependency
outlines/generate/format.py:6:1: DEP003 'outlines' imported but it is a transitive dependency
outlines/generate/fsm.py:3:1: DEP003 'outlines' imported but it is a transitive dependency
outlines/generate/fsm.py:4:1: DEP003 'outlines' imported but it is a transitive dependency
outlines/generate/fsm.py:5:1: DEP003 'outlines' imported but it is a transitive dependency
outlines/generate/json.py:7:1: DEP003 'outlines' imported but it is a transitive dependency
outlines/generate/json.py:8:1: DEP003 'outlines' imported but it is a transitive dependency
outlines/generate/json.py:9:1: DEP003 'outlines' imported but it is a transitive dependency
outlines/generate/json.py:10:1: DEP003 'outlines' imported but it is a transitive dependency
outlines/generate/regex.py:3:1: DEP003 'outlines' imported but it is a transitive dependency
outlines/generate/regex.py:4:1: DEP003 'outlines' imported but it is a transitive dependency
outlines/generate/regex.py:5:1: DEP003 'outlines' imported but it is a transitive dependency
outlines/generate/regex.py:6:1: DEP003 'outlines' imported but it is a transitive dependency
outlines/generate/regex.py:7:1: DEP003 'outlines' imported but it is a transitive dependency
outlines/generate/regex.py:8:1: DEP003 'outlines' imported but it is a transitive dependency
outlines/generate/regex.py:9:1: DEP003 'outlines' imported but it is a transitive dependency
outlines/generate/regex.py:10:1: DEP003 'outlines' imported but it is a transitive dependency
outlines/generate/regex.py:49:5: DEP003 'outlines' imported but it is a transitive dependency
outlines/generate/regex.py:61:5: DEP003 'outlines' imported but it is a transitive dependency
outlines/generate/regex.py:73:5: DEP003 'outlines' imported but it is a transitive dependency
outlines/generate/text.py:3:1: DEP003 'outlines' imported but it is a transitive dependency
outlines/generate/text.py:4:1: DEP003 'outlines' imported but it is a transitive dependency
outlines/generate/text.py:5:1: DEP003 'outlines' imported but it is a transitive dependency
outlines/generate/text.py:6:1: DEP003 'outlines' imported but it is a transitive dependency
outlines/processors/base_logits_processor.py:11:16: DEP001 'mlx' imported but missing from the dependency definitions
outlines/processors/base_logits_processor.py:96:24: DEP001 'mlx' imported but missing from the dependency definitions
outlines/processors/structured.py:34:1: DEP003 'outlines' imported but it is a transitive dependency
outlines/processors/structured.py:35:1: DEP003 'outlines' imported but it is a transitive dependency
outlines/processors/structured.py:36:1: DEP003 'outlines' imported but it is a transitive dependency
outlines/serve/serve.py:38:1: DEP003 'outlines' imported but it is a transitive dependency
outlines/serve/vllm.py:1:1: DEP003 'outlines' imported but it is a transitive dependency
outlines/types/locales.py:3:1: DEP003 'outlines' imported but it is a transitive dependency
outlines/types/locales.py:4:1: DEP003 'outlines' imported but it is a transitive dependency
Found 61 dependency issues.
@@ -36,9 +36,8 @@ dependencies = [ | |||
"jsonschema", | |||
"requests", | |||
"tqdm", | |||
"datasets", | |||
"pycountry", | |||
"pyairports", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pyairports
is necessary for import outlines
. It's wrapped in a try-except block, but the block doesn't pass.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see. then these try-except blocks can be removed, right? Since it will now never enter the except
part; in order for people to be able to run that code, they have to install outlines
, which has pyairports
and pycountry
as a direct dependency.
I added both pyairports
and pycountry
back to the dependencies. Let me know if you want me to make any further changes regarding this, e.g. remove the try-except
block.
The reason for this, is that when |
Thank you for contributing! We are not willing to add additional checks in CI just now, but will re-open should this change. |
Running
deptry
on the codebase with this configurationgives:
This PR proposes to fix these issues. In addition, it proposes to remove
pyairports
andpycountry
, since their imports are wrapped in a try-except block:This PR also proposes to add
deptry
to the CI/CD pipeline to make sure the list of dependencies stays up to date.Feel free to let me now your thoughts on this PR, or to close the PR if you think it is not a useful addition.
Disclaimer: I am the author of
deptry
.