Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions .github/scripts/setup-env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -71,19 +71,19 @@ if [[ $GPU_ARCH_TYPE == 'cuda' ]]; then
fi
echo '::endgroup::'

if [[ "${OS_TYPE}" == "windows" ]]; then
echo '::group::Install third party dependencies prior to TorchVision install on Windows'
# `easy_install`, i.e. `python setup.py` has problems downloading the dependencies due to SSL.
# Thus, we install them upfront with `pip` to avoid that.
# Instead of fixing the SSL error, we can probably maintain this special case until we switch away from the deprecated
# `easy_install` anyway.
python setup.py egg_info
# The requires.txt cannot be used with `pip install -r` directly. The requirements are listed at the top and the
# optional dependencies come in non-standard syntax after a blank line. Thus, we just extract the header.
sed -e '/^$/,$d' *.egg-info/requires.txt > requirements.txt
pip install --progress-bar=off -r requirements.txt
echo '::endgroup::'
fi
echo '::group::Install third party dependencies prior to TorchVision install'
# Installing with `easy_install`, e.g. `python setup.py install` or `python setup.py develop`, has some quirks when
# when pulling in third-party dependencies. For example:
# - On Windows, we often hit an SSL error although `pip` can install just fine.
# - It happily pulls in pre-releases, which can lead to more problems down the line.
# `pip` does not unless explicitly told to do so.
# Thus, we use `easy_install` to extract the third-party dependencies here and install them upfront with `pip`.
python setup.py egg_info
# The requires.txt cannot be used with `pip install -r` directly. The requirements are listed at the top and the
# optional dependencies come in non-standard syntax after a blank line. Thus, we just extract the header.
sed -e '/^$/,$d' *.egg-info/requires.txt | tee requirements.txt
pip install --progress-bar=off -r requirements.txt
echo '::endgroup::'

echo '::group::Install TorchVision'
python setup.py develop
Expand Down
4 changes: 1 addition & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,8 @@ def write_version_file():
if os.getenv("PYTORCH_VERSION"):
pytorch_dep += "==" + os.getenv("PYTORCH_VERSION")

numpy_dep = "numpy" if sys.version_info[:2] >= (3, 9) else "numpy < 1.25"

requirements = [
numpy_dep,
"numpy",
"requests",
pytorch_dep,
]
Expand Down