Skip to content

Commit f925a5b

Browse files
authored
Revise and split requirements files (nod-ai#340)
Moves dependencies defined in the root `requirements.txt` to `sharktank/` and splits out test only deps to `requirements-tests.txt` file. Dependencies only used for development / in the CI are moved to `requirements-dev.txt` and the root requirements file is now used to pull in all the deps. Furthermore, some no longer used dependencies are removed.
1 parent 98392d0 commit f925a5b

7 files changed

+36
-36
lines changed

.github/workflows/ci-sharktank.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@ on:
66
paths:
77
- '.github/workflows/ci-sharktank.yml'
88
- 'sharktank/**'
9-
- '*requirements.txt'
9+
- '*requirements*.txt'
1010
push:
1111
branches:
1212
- main
1313
paths:
1414
- '.github/workflows/ci-sharktank.yml'
1515
- 'sharktank/**'
16-
- '*requirements.txt'
16+
- '*requirements*.txt'
1717

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

5757
- name: Install pip deps
5858
run: |

.github/workflows/ci_eval.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ jobs:
4545
id: cache-pip
4646
with:
4747
path: ${{ env.PIP_CACHE_DIR }}
48-
key: pip-${{ steps.setup_python.outputs.python-version }}-${{ hashFiles('*requirements.txt') }}
48+
key: pip-${{ steps.setup_python.outputs.python-version }}-${{ hashFiles('*requirements*.txt','sharktank/requirements*.txt') }}
4949

5050
- name: Install sharktank deps
5151
run: |

requirements-dev.txt

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Used for managing pre-commit flows.
2+
pre-commit
3+
4+
# Type checking
5+
mypy==1.8.0
6+
types-requests==2.31.0.20240125
7+
8+
# Testing
9+
pytest==8.0.0
10+
pytest-xdist==3.5.0

requirements.txt

+4-30
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,4 @@
1-
# Runtime deps.
2-
gguf==0.6.0
3-
numpy==1.26.3
4-
onnx==1.15.0
5-
6-
# Model deps.
7-
huggingface-hub==0.22.2
8-
transformers==4.40.0
9-
sentencepiece==0.2.0
10-
11-
# It is expected that you have installed a PyTorch version/variant specific
12-
# to your needs, so we only include a minimum version spec.
13-
# TODO: Use a versioned release once 2.3.0 drops.
14-
torch>=2.3.0.dev1
15-
16-
# Used for managing pre-commit flows.
17-
pre-commit
18-
19-
# Type checking
20-
mypy==1.8.0
21-
types-requests==2.31.0.20240125
22-
23-
# Testing
24-
parameterized
25-
pytest==8.0.0
26-
pytest-xdist==3.5.0
27-
28-
# Serving deps.
29-
fastapi==0.112.2
30-
uvicorn==0.30.6
1+
-r sharktank/requirements.txt
2+
-r sharktank/requirements-tests.txt
3+
-r shortfin/requirements-tests.txt
4+
-r requirements-dev.txt

sharktank/requirements-tests.txt

+2
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
11
datasets==3.0.0
2+
parameterized
3+
pytest==8.0.0

sharktank/requirements.txt

+16-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,16 @@
1-
gguf
1+
# Runtime deps.
2+
gguf==0.6.0
3+
numpy==1.26.3
4+
5+
# Model deps.
6+
huggingface-hub==0.22.2
7+
transformers==4.40.0
8+
datasets
9+
10+
# It is expected that you have installed a PyTorch version/variant specific
11+
# to your needs, so we only include a minimum version spec.
12+
torch>=2.3.0
13+
14+
# Serving deps.
15+
fastapi==0.112.2
16+
uvicorn==0.30.6

sharktank/setup.py

-1
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,6 @@ def initialize_options(self):
9999
extras_require={
100100
"testing": [
101101
f"pytest{get_version_spec('pytest')}",
102-
f"pytest-xdist{get_version_spec('pytest-xdist')}",
103102
],
104103
},
105104
cmdclass={"build": BuildCommand},

0 commit comments

Comments
 (0)