Skip to content

Commit d434bf7

Browse files
committed
install_requirements.py: remove unnecessary requirements
Duplicate requirements with the pyproject.toml > /dev/null One unique devel reqiurement > requirements-dev.txt Examples requirements > requirements-examples.txt Nightlies stayed in the script. Rationale: be as "normal" a Python project as seemed possible. Test Plan: install_requirements.sh in a clean venv succeeded ghstack-source-id: decd2bf9fe9c57f3b4f3f39949ca1ff1f88044f4 ghstack-comment-id: 2596313740 Pull Request resolved: #7705
1 parent 1b44a74 commit d434bf7

File tree

2 files changed

+10
-21
lines changed

2 files changed

+10
-21
lines changed

install_requirements.py

+5-21
Original file line numberDiff line numberDiff line change
@@ -104,35 +104,15 @@ def install_requirements(use_pytorch_nightly):
104104
if use_pytorch_nightly
105105
else "torchvision"
106106
), # For testing.
107-
"typing-extensions",
108107
]
109108

110-
# pip packages needed to run examples.
111-
# TODO: Make each example publish its own requirements.txt
112109
EXAMPLES_REQUIREMENTS = [
113-
"timm==1.0.7",
114110
f"torchaudio==2.6.0.{NIGHTLY_VERSION}" if use_pytorch_nightly else "torchaudio",
115-
"torchsr==1.0.4",
116-
"transformers==4.47.1",
117-
]
118-
119-
# pip packages needed for development.
120-
DEVEL_REQUIREMENTS = [
121-
"cmake", # For building binary targets.
122-
"pip>=23", # For building the pip package.
123-
"pyyaml", # Imported by the kernel codegen tools.
124-
"setuptools>=63", # For building the pip package.
125-
"tomli", # Imported by extract_sources.py when using python < 3.11.
126-
"wheel", # For building the pip package archive.
127-
"zstd", # Imported by resolve_buck.py.
128-
"ai-edge-model-explorer>=0.1.16", # For visualizing ExportedPrograms
129111
]
130112

131113
# Assemble the list of requirements to actually install.
132114
# TODO: Add options for reducing the number of requirements.
133-
REQUIREMENTS_TO_INSTALL = (
134-
EXIR_REQUIREMENTS + DEVEL_REQUIREMENTS + EXAMPLES_REQUIREMENTS
135-
)
115+
REQUIREMENTS_TO_INSTALL = EXIR_REQUIREMENTS + EXAMPLES_REQUIREMENTS
136116

137117
# Install the requirements. `--extra-index-url` tells pip to look for package
138118
# versions on the provided URL if they aren't available on the default URL.
@@ -142,6 +122,8 @@ def install_requirements(use_pytorch_nightly):
142122
"-m",
143123
"pip",
144124
"install",
125+
"-r",
126+
"requirements-examples.txt",
145127
*REQUIREMENTS_TO_INSTALL,
146128
"--extra-index-url",
147129
TORCH_NIGHTLY_URL,
@@ -161,6 +143,8 @@ def install_requirements(use_pytorch_nightly):
161143
"-m",
162144
"pip",
163145
"install",
146+
# Without --no-build-isolation, setup.py can't find the torch module.
147+
"--no-build-isolation",
164148
*LOCAL_REQUIREMENTS,
165149
],
166150
check=True,

requirements-examples.txt

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# pip packages needed to run examples.
2+
# TODO: Make each example publish its own requirements.txt
3+
timm == 1.0.7
4+
torchsr == 1.0.4
5+
transformers ==4.47.1

0 commit comments

Comments
 (0)