Unverified Commit d3bda798 authored by Min Xu's avatar Min Xu Committed by GitHub
Browse files

[test] setup.py dependency testing (#1045)



* [fix]: experimental import fix

* [test]: catch issue #1042 in the future

* revert trigger for failure

* add numpy dep for users
Co-authored-by: default avatarMin Xu <min.xu.public@gmail.com>
parent 0a5737ca
...@@ -273,6 +273,10 @@ jobs: ...@@ -273,6 +273,10 @@ jobs:
- <<: *check_test_list - <<: *check_test_list
- <<: *setup_venv - <<: *setup_venv
# Do this first to test repo dependencies. Basic import should work after this
# installation. See issue #1042 for an example.
- <<: *install_repo
# Cache the venv directory that contains dependencies # Cache the venv directory that contains dependencies
- restore_cache: - restore_cache:
keys: keys:
...@@ -284,7 +288,6 @@ jobs: ...@@ -284,7 +288,6 @@ jobs:
- ~/venv - ~/venv
key: cache-key-cpu-py38-torch-1-11-0-{{.Environment.CACHE_VERSION}}-{{checksum "setup.py"}}-{{checksum "requirements-dev.txt"}} key: cache-key-cpu-py38-torch-1-11-0-{{.Environment.CACHE_VERSION}}-{{checksum "setup.py"}}-{{checksum "requirements-dev.txt"}}
- <<: *install_repo
- <<: *run_unittests - <<: *run_unittests
- <<: *run_doc_build - <<: *run_doc_build
...@@ -301,6 +304,10 @@ jobs: ...@@ -301,6 +304,10 @@ jobs:
- <<: *check_test_list - <<: *check_test_list
- <<: *setup_venv - <<: *setup_venv
# Do this first to test repo dependencies. Basic import should work after this
# installation. See issue #1042 for an example.
- <<: *install_repo
# Cache the venv directory that contains dependencies # Cache the venv directory that contains dependencies
- restore_cache: - restore_cache:
keys: keys:
...@@ -313,7 +320,6 @@ jobs: ...@@ -313,7 +320,6 @@ jobs:
- ~/venv - ~/venv
key: cache-key-cpu-py39-torch-1-11-0-{{.Environment.CACHE_VERSION}}-{{checksum "setup.py"}}-{{checksum "requirements-dev.txt"}} key: cache-key-cpu-py39-torch-1-11-0-{{.Environment.CACHE_VERSION}}-{{checksum "setup.py"}}-{{checksum "requirements-dev.txt"}}
- <<: *install_repo
- <<: *run_unittests - <<: *run_unittests
- <<: *run_doc_build - <<: *run_doc_build
...@@ -330,6 +336,10 @@ jobs: ...@@ -330,6 +336,10 @@ jobs:
- <<: *check_test_list - <<: *check_test_list
- <<: *setup_venv - <<: *setup_venv
# Do this first to test repo dependencies. Basic import should work after this
# installation. See issue #1042 for an example.
- <<: *install_repo
# Cache the venv directory that contains dependencies # Cache the venv directory that contains dependencies
- restore_cache: - restore_cache:
keys: keys:
...@@ -342,7 +352,6 @@ jobs: ...@@ -342,7 +352,6 @@ jobs:
- ~/venv - ~/venv
key: cache-key-cpu-py310-torch-1-11-0-{{.Environment.CACHE_VERSION}}-{{checksum "setup.py"}}-{{checksum "requirements-dev.txt"}} key: cache-key-cpu-py310-torch-1-11-0-{{.Environment.CACHE_VERSION}}-{{checksum "setup.py"}}-{{checksum "requirements-dev.txt"}}
- <<: *install_repo
- <<: *run_unittests - <<: *run_unittests
- <<: *run_doc_build - <<: *run_doc_build
...@@ -540,6 +549,11 @@ jobs: ...@@ -540,6 +549,11 @@ jobs:
- <<: *setup_venv - <<: *setup_venv
# Do this first to test an issue like #1042. We keep benchmark_1 doing it
# after requirements-dev.txt, but change benchmark_2 to do this earlier to
# ensure both cases are tested.
- <<: *install_repo
# Cache the venv directory that contains dependencies # Cache the venv directory that contains dependencies
- restore_cache: - restore_cache:
keys: keys:
...@@ -558,8 +572,6 @@ jobs: ...@@ -558,8 +572,6 @@ jobs:
- ~/venv - ~/venv
key: cache-key-py-3-9-7-benchmarks-torch-1-11-0-{{.Environment.CACHE_VERSION}}-{{checksum "setup.py"}}-{{checksum "requirements-dev.txt"}} key: cache-key-py-3-9-7-benchmarks-torch-1-11-0-{{.Environment.CACHE_VERSION}}-{{checksum "setup.py"}}-{{checksum "requirements-dev.txt"}}
- <<: *install_repo
- <<: *run_oss_benchmark - <<: *run_oss_benchmark
- save_cache: - save_cache:
......
...@@ -11,6 +11,6 @@ from typing import List ...@@ -11,6 +11,6 @@ from typing import List
# Don't import sub-modules as experimental stuff otherwise gets imported directly # Don't import sub-modules as experimental stuff otherwise gets imported directly
# when user does an `import fairscale`. This can cause experimental code's import # when user does an `import fairscale`. This can cause experimental code's import
# dependencies (like pygit2) to be leaked into the fairscale main code. # dependencies (like pygit2) to leak into the fairscale main dependency.
__all__: List[str] = [] __all__: List[str] = []
# FairScale should only depends on torch, not things higher level than torch. # FairScale should only depends on torch, not things higher level than torch.
# Note1: setup.py automatically reads this file to setup install time dependencies.
# Note2: we use >= in this file but == in requirements-dev.txt for determinism
# in testing.
torch >= 1.8.0 torch >= 1.8.0
numpy >= 1.22.0
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