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

Revise and split requirements files #340

Merged
merged 2 commits into from
Oct 28, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
6 changes: 3 additions & 3 deletions .github/workflows/ci-sharktank.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ on:
paths:
- '.github/workflows/ci-sharktank.yml'
- 'sharktank/**'
- '*requirements.txt'
- '*requirements*.txt'
push:
branches:
- main
paths:
- '.github/workflows/ci-sharktank.yml'
- 'sharktank/**'
- '*requirements.txt'
- '*requirements*.txt'

concurrency:
# A PR number if a pull request and otherwise the commit hash. This cancels
Expand Down Expand Up @@ -52,7 +52,7 @@ jobs:
id: cache-pip
with:
path: ${{ env.PIP_CACHE_DIR }}
key: pip-${{ steps.setup_python.outputs.python-version }}-${{ hashFiles('*requirements.txt') }}
key: pip-${{ steps.setup_python.outputs.python-version }}-${{ hashFiles('*requirements*.txt','sharktank/requirements*.txt') }}

- name: Install pip deps
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci_eval.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
id: cache-pip
with:
path: ${{ env.PIP_CACHE_DIR }}
key: pip-${{ steps.setup_python.outputs.python-version }}-${{ hashFiles('*requirements.txt') }}
key: pip-${{ steps.setup_python.outputs.python-version }}-${{ hashFiles('*requirements*.txt','sharktank/requirements*.txt') }}

- name: Install sharktank deps
run: |
Expand Down
10 changes: 10 additions & 0 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Used for managing pre-commit flows.
pre-commit

# Type checking
mypy==1.8.0
types-requests==2.31.0.20240125

# Testing
pytest==8.0.0
pytest-xdist==3.5.0
34 changes: 4 additions & 30 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,30 +1,4 @@
# Runtime deps.
gguf==0.6.0
numpy==1.26.3
onnx==1.15.0

# Model deps.
huggingface-hub==0.22.2
transformers==4.40.0
sentencepiece==0.2.0

# It is expected that you have installed a PyTorch version/variant specific
# to your needs, so we only include a minimum version spec.
# TODO: Use a versioned release once 2.3.0 drops.
torch>=2.3.0.dev1

# Used for managing pre-commit flows.
pre-commit

# Type checking
mypy==1.8.0
types-requests==2.31.0.20240125

# Testing
parameterized
pytest==8.0.0
pytest-xdist==3.5.0

# Serving deps.
fastapi==0.112.2
uvicorn==0.30.6
-r sharktank/requirements.txt
-r sharktank/requirements-tests.txt
-r shortfin/requirements-tests.txt
-r requirements-dev.txt
2 changes: 2 additions & 0 deletions sharktank/requirements-tests.txt
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
datasets==3.0.0
parameterized
pytest==8.0.0
17 changes: 16 additions & 1 deletion sharktank/requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1,16 @@
gguf
# Runtime deps.
gguf==0.6.0
numpy==1.26.3

# Model deps.
huggingface-hub==0.22.2
transformers==4.40.0
datasets

# It is expected that you have installed a PyTorch version/variant specific
# to your needs, so we only include a minimum version spec.
torch>=2.3.0

# Serving deps.
fastapi==0.112.2
uvicorn==0.30.6
1 change: 0 additions & 1 deletion sharktank/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@ def initialize_options(self):
extras_require={
"testing": [
f"pytest{get_version_spec('pytest')}",
f"pytest-xdist{get_version_spec('pytest-xdist')}",
Comment on lines 101 to -102
Copy link
Member

Choose a reason for hiding this comment

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

Why drop pytest-xdist from here? It's useful for running tests. I'm not sure what the best practices are for testing deps in extras_require, but I could see an argument for this being minimal (just pytest).

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

pytest-xdist isn't used, as pytest -n is only called in the CI. Thus I would rather go with the minimal requirements instead of pulling in non-strictly required packages.

],
},
cmdclass={"build": BuildCommand},
Expand Down
Loading