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

install_requirements.py: reorganize requirements #7705

Merged
merged 22 commits into from
Jan 17, 2025
25 changes: 5 additions & 20 deletions install_requirements.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,34 +104,15 @@ def install_requirements(use_pytorch_nightly):
if use_pytorch_nightly
else "torchvision"
), # For testing.
"typing-extensions",
]

# pip packages needed to run examples.
# TODO: Make each example publish its own requirements.txt
EXAMPLES_REQUIREMENTS = [
"timm==1.0.7",
f"torchaudio==2.6.0.{NIGHTLY_VERSION}" if use_pytorch_nightly else "torchaudio",
"torchsr==1.0.4",
"transformers==4.47.1",
]

# pip packages needed for development.
DEVEL_REQUIREMENTS = [
"cmake", # For building binary targets.
"pip>=23", # For building the pip package.
"pyyaml", # Imported by the kernel codegen tools.
"setuptools>=63", # For building the pip package.
"tomli", # Imported by extract_sources.py when using python < 3.11.
"wheel", # For building the pip package archive.
"zstd", # Imported by resolve_buck.py.
Comment on lines -121 to -127
Copy link
Contributor

Choose a reason for hiding this comment

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

do these need to be added to requirements-dev.txt?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

no. they are in the pyproject.toml already.

]

# Assemble the list of requirements to actually install.
# TODO: Add options for reducing the number of requirements.
REQUIREMENTS_TO_INSTALL = (
EXIR_REQUIREMENTS + DEVEL_REQUIREMENTS + EXAMPLES_REQUIREMENTS
)
REQUIREMENTS_TO_INSTALL = EXIR_REQUIREMENTS + EXAMPLES_REQUIREMENTS

# Install the requirements. `--extra-index-url` tells pip to look for package
# versions on the provided URL if they aren't available on the default URL.
Expand All @@ -141,6 +122,8 @@ def install_requirements(use_pytorch_nightly):
"-m",
"pip",
"install",
"-r",
"requirements-examples.txt",
*REQUIREMENTS_TO_INSTALL,
"--extra-index-url",
TORCH_NIGHTLY_URL,
Expand All @@ -160,6 +143,8 @@ def install_requirements(use_pytorch_nightly):
"-m",
"pip",
"install",
# Without --no-build-isolation, setup.py can't find the torch module.
"--no-build-isolation",
*LOCAL_REQUIREMENTS,
],
check=True,
Expand Down
5 changes: 5 additions & 0 deletions requirements-examples.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# pip packages needed to run examples.
# TODO: Make each example publish its own requirements.txt
timm == 1.0.7
torchsr == 1.0.4
transformers ==4.47.1