Skip to content

Commit

Permalink
feat: added generate_requirements.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
julienroyd committed Feb 16, 2024
1 parent 0354e00 commit 02d5dde
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions generate_requirements.sh
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

0 comments on commit 02d5dde

Please sign in to comment.