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

Remove unused dependencies, add deptry to make sure the dependencies stay up-to-date #955

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ jobs:
run: |
python -m pip install --upgrade pip
pip install .[test]
- name: Check dependencies
run: |
deptry .
- name: Run tests
run: |
pytest --cov=outlines
Expand Down
12 changes: 7 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,8 @@ dependencies = [
"jsonschema",
"requests",
"tqdm",
"datasets",
"pycountry",
"pyairports",
Copy link
Collaborator

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.

Copy link
Contributor Author

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.

"typing_extensions",
"torch",
]
dynamic = ["version"]

Expand All @@ -51,19 +50,18 @@ test = [
"pytest-mock",
"coverage[toml]>=5.1",
"diff-cover",
"deptry",
"accelerate",
"beartype<0.16.0",
"responses",
"llama-cpp-python",
"huggingface_hub",
"openai>=1.0.0",
"vllm",
"torch",
"transformers",
]
serve = [
"vllm>=0.3.0",
"ray==2.9.0",
"uvicorn",
"fastapi",
"pydantic>=2.0",
Expand Down Expand Up @@ -157,3 +155,7 @@ show_missing = true
[tool.diff_cover]
compare_branch = "origin/main"
diff_range_notation = ".."

[tool.deptry]
extend_exclude = ["examples", "benchmarks", "outlines/integrations", "outlines/models"]
pep621_dev_dependency_groups = ["test"]