Unverified Commit a6f63879 authored by Philip Meier's avatar Philip Meier Committed by GitHub
Browse files

always install dependencies upfront with pip in CI (#7645)

parent 70c8f500
......@@ -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
......
......@@ -57,10 +57,8 @@ pytorch_dep = "torch"
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,
]
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment