From 62a48852e3b00b67328246205fef4a6d0f651003 Mon Sep 17 00:00:00 2001 From: Jinzhe Zeng Date: Sat, 19 Feb 2022 18:06:07 -0500 Subject: [PATCH 01/12] run test_python on pre-built container --- .github/workflows/test_python.yml | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) diff --git a/.github/workflows/test_python.yml b/.github/workflows/test_python.yml index 93b65dcca5..3712fa6e4c 100644 --- a/.github/workflows/test_python.yml +++ b/.github/workflows/test_python.yml @@ -49,22 +49,9 @@ jobs: gcc: 8 tf: + container: ghcr.io/deepmodeling/deepmd-kit-test-environment:py${{ matrix.python }}-gcc${{ matrix.gcc }}-tf${{ matrix.tf }} steps: - uses: actions/checkout@master - - uses: actions/setup-python@v2 - with: - python-version: ${{ matrix.python }} - - name: pip cache - uses: actions/cache@v2 - with: - path: ~/.cache/pip - key: - ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }}-${{ hashFiles('**/requirements.txt') }} - restore-keys: | - ${{ runner.os }}-pip- - - run: | - sudo apt update - sudo apt install gcc-${{ matrix.gcc }} g++-${{ matrix.gcc }} - run: python -m pip install -U pip>=21.3.1 - run: pip install -e .[cpu,test] codecov env: @@ -72,9 +59,4 @@ jobs: CXX: g++-${{ matrix.gcc }} TENSORFLOW_VERSION: ${{ matrix.tf }} - run: dp --version - - name: Prepare parallel runtime - if: ${{ matrix.tf == '' }} - run: | - sudo apt install libopenmpi-dev openmpi-bin - HOROVOD_WITHOUT_GLOO=1 HOROVOD_WITH_TENSORFLOW=1 pip install horovod mpi4py - run: pytest --cov=deepmd source/tests && codecov From 8c2e4cec93c2299cbe1a145f776f61a5efd7021c Mon Sep 17 00:00:00 2001 From: Jinzhe Zeng Date: Sat, 19 Feb 2022 18:16:16 -0500 Subject: [PATCH 02/12] pin mistune to <2 See https://github.com/miyakogi/m2r/issues/66 --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 2e9e3239ab..558ccc3e96 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,3 +1,3 @@ [build-system] -requires = ["setuptools", "setuptools_scm", "wheel", "scikit-build", "cmake", "ninja", "m2r"] +requires = ["setuptools", "setuptools_scm", "wheel", "scikit-build", "cmake", "ninja", "m2r", "mistune<2"] From a080b01004436bb2749c0e2c3eac9519982edd6e Mon Sep 17 00:00:00 2001 From: Jinzhe Zeng Date: Sat, 19 Feb 2022 18:22:03 -0500 Subject: [PATCH 03/12] I don't understand why we need m2r... --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 558ccc3e96..50fe237581 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,3 +1,3 @@ [build-system] -requires = ["setuptools", "setuptools_scm", "wheel", "scikit-build", "cmake", "ninja", "m2r", "mistune<2"] +requires = ["setuptools", "setuptools_scm", "wheel", "scikit-build", "cmake", "ninja"] From 14cc234d87e268f2473427b43dbb124635ba8822 Mon Sep 17 00:00:00 2001 From: Jinzhe Zeng Date: Sat, 19 Feb 2022 18:24:32 -0500 Subject: [PATCH 04/12] install m2r2 instead --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 50fe237581..658acf62ab 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,3 +1,3 @@ [build-system] -requires = ["setuptools", "setuptools_scm", "wheel", "scikit-build", "cmake", "ninja"] +requires = ["setuptools", "setuptools_scm", "wheel", "scikit-build", "cmake", "ninja", "m2r2"] From 421dd1fc13ab8abf6e053788e222860e4a5713be Mon Sep 17 00:00:00 2001 From: Jinzhe Zeng Date: Sat, 19 Feb 2022 18:27:43 -0500 Subject: [PATCH 05/12] try to encode with utf-8 instead.. --- pyproject.toml | 2 +- setup.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 658acf62ab..50fe237581 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,3 +1,3 @@ [build-system] -requires = ["setuptools", "setuptools_scm", "wheel", "scikit-build", "cmake", "ninja", "m2r2"] +requires = ["setuptools", "setuptools_scm", "wheel", "scikit-build", "cmake", "ninja"] diff --git a/setup.py b/setup.py index d46703e463..f843395ed3 100644 --- a/setup.py +++ b/setup.py @@ -18,7 +18,7 @@ # read readme to markdown readme_file = Path(__file__).parent / "README.md" -readme = readme_file.read_text() +readme = readme_file.read_text(encoding="utf-8") tf_version = os.environ.get("TENSORFLOW_VERSION", "") From c60e7c500c39b014e3193cfffc0540490bac57dc Mon Sep 17 00:00:00 2001 From: Jinzhe Zeng Date: Sat, 19 Feb 2022 19:32:10 -0500 Subject: [PATCH 06/12] add back pip cache --- .github/workflows/test_python.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/test_python.yml b/.github/workflows/test_python.yml index 3712fa6e4c..dd8bded91d 100644 --- a/.github/workflows/test_python.yml +++ b/.github/workflows/test_python.yml @@ -52,6 +52,14 @@ jobs: container: ghcr.io/deepmodeling/deepmd-kit-test-environment:py${{ matrix.python }}-gcc${{ matrix.gcc }}-tf${{ matrix.tf }} steps: - uses: actions/checkout@master + - name: pip cache + uses: actions/cache@v2 + with: + path: ~/.cache/pip + key: + ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }}-${{ hashFiles('**/requirements.txt') }} + restore-keys: | + ${{ runner.os }}-pip- - run: python -m pip install -U pip>=21.3.1 - run: pip install -e .[cpu,test] codecov env: From d9a906e4042576e8fc160b32e7006415c4267741 Mon Sep 17 00:00:00 2001 From: Jinzhe Zeng Date: Sat, 19 Feb 2022 22:18:20 -0500 Subject: [PATCH 07/12] Update test_python.yml --- .github/workflows/test_python.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test_python.yml b/.github/workflows/test_python.yml index dd8bded91d..711298fe9f 100644 --- a/.github/workflows/test_python.yml +++ b/.github/workflows/test_python.yml @@ -61,7 +61,7 @@ jobs: restore-keys: | ${{ runner.os }}-pip- - run: python -m pip install -U pip>=21.3.1 - - run: pip install -e .[cpu,test] codecov + - run: python -m pip install -e .[cpu,test] codecov env: CC: gcc-${{ matrix.gcc }} CXX: g++-${{ matrix.gcc }} From b8b1727c37c95d15e91caae4003666c3ca0ba35d Mon Sep 17 00:00:00 2001 From: Jinzhe Zeng Date: Sat, 19 Feb 2022 23:18:49 -0500 Subject: [PATCH 08/12] bump importlib_metadata version --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 8cd273f803..3d4cca4ee9 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,7 +4,7 @@ pyyaml dargs >= 0.2.6 python-hostlist >= 1.21 typing_extensions; python_version < "3.7" -importlib_metadata>=1.4; python_version < "3.8" +importlib_metadata>=3.1.1; python_version < "3.8" h5py wcmatch packaging From 760d7f9849dd18015e629049397d638fcdf24539 Mon Sep 17 00:00:00 2001 From: Jinzhe Zeng Date: Sat, 19 Feb 2022 23:33:10 -0500 Subject: [PATCH 09/12] Revert "bump importlib_metadata version" This reverts commit b8b1727c37c95d15e91caae4003666c3ca0ba35d. --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 3d4cca4ee9..8cd273f803 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,7 +4,7 @@ pyyaml dargs >= 0.2.6 python-hostlist >= 1.21 typing_extensions; python_version < "3.7" -importlib_metadata>=3.1.1; python_version < "3.8" +importlib_metadata>=1.4; python_version < "3.8" h5py wcmatch packaging From 1e27af429eb71945aabad648dc478d0bce2e9431 Mon Sep 17 00:00:00 2001 From: Jinzhe Zeng Date: Sat, 19 Feb 2022 23:33:11 -0500 Subject: [PATCH 10/12] Revert "Update test_python.yml" This reverts commit d9a906e4042576e8fc160b32e7006415c4267741. --- .github/workflows/test_python.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test_python.yml b/.github/workflows/test_python.yml index 711298fe9f..dd8bded91d 100644 --- a/.github/workflows/test_python.yml +++ b/.github/workflows/test_python.yml @@ -61,7 +61,7 @@ jobs: restore-keys: | ${{ runner.os }}-pip- - run: python -m pip install -U pip>=21.3.1 - - run: python -m pip install -e .[cpu,test] codecov + - run: pip install -e .[cpu,test] codecov env: CC: gcc-${{ matrix.gcc }} CXX: g++-${{ matrix.gcc }} From d35bcf0947a9acbcd8763590c1f739f918007eaa Mon Sep 17 00:00:00 2001 From: Jinzhe Zeng Date: Sat, 19 Feb 2022 23:38:34 -0500 Subject: [PATCH 11/12] set PYTHONPATH --- .github/workflows/test_python.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/test_python.yml b/.github/workflows/test_python.yml index dd8bded91d..7e4b813b09 100644 --- a/.github/workflows/test_python.yml +++ b/.github/workflows/test_python.yml @@ -67,4 +67,8 @@ jobs: CXX: g++-${{ matrix.gcc }} TENSORFLOW_VERSION: ${{ matrix.tf }} - run: dp --version + env: + PYTHONPATH: $GITHUB_WORKSPACE - run: pytest --cov=deepmd source/tests && codecov + env: + PYTHONPATH: $GITHUB_WORKSPACE From b145f907e9a1d6cc5d601ab39cb6591debeb0f96 Mon Sep 17 00:00:00 2001 From: Jinzhe Zeng Date: Sat, 19 Feb 2022 23:59:43 -0500 Subject: [PATCH 12/12] Revert "set PYTHONPATH" This reverts commit d35bcf0947a9acbcd8763590c1f739f918007eaa. --- .github/workflows/test_python.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/test_python.yml b/.github/workflows/test_python.yml index 7e4b813b09..dd8bded91d 100644 --- a/.github/workflows/test_python.yml +++ b/.github/workflows/test_python.yml @@ -67,8 +67,4 @@ jobs: CXX: g++-${{ matrix.gcc }} TENSORFLOW_VERSION: ${{ matrix.tf }} - run: dp --version - env: - PYTHONPATH: $GITHUB_WORKSPACE - run: pytest --cov=deepmd source/tests && codecov - env: - PYTHONPATH: $GITHUB_WORKSPACE