-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: added generate_requirements.sh
- Loading branch information
1 parent
0354e00
commit 02d5dde
Showing
1 changed file
with
21 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Usage: ./generate_requirements.sh <ENV-NAME> (e.g. ./generate_requirements.sh dev-3.10) | ||
|
||
# set env variable | ||
# to allow pip-compile-cross-platform to use pip with --find-links. | ||
# not entirely sure this is needed. | ||
export PIP_FIND_LINKS=https://data.pyg.org/whl/torch-2.1.2+cpu.html | ||
|
||
# compile the dependencies from .in files | ||
pip-compile-cross-platform requirements/$1.in --min-python-version 3.10 -o requirements/$1.txt | ||
|
||
# remove the hashes from the .txt files | ||
# this is slightly less safe in terms of reproducibility | ||
# (e.g. if a package was re-uploaded to PyPI with the same version) | ||
# but it is necessary to allow `pip install -r requirements` to use --find-links | ||
# in our case, without --find-links, torch-cluster often cannot find the | ||
# proper wheels and throws out an error `no torch module` when trying to build | ||
sed -i '/--hash=/d' requirements/$1.txt | ||
sed -i 's/\\//g' requirements/$1.txt | ||
|
||
# removes the nvidia requirements | ||
sed -i '/nvidia/d' requirements/$1.txt |