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