From: M. Eric Irrgang Date: Tue, 19 Oct 2021 15:25:43 +0000 (+0000) Subject: Pre-install Python dependencies in CI Docker images. X-Git-Url: http://biod.pnpi.spb.ru/gitweb/?p=alexxy%2Fgromacs.git;a=commitdiff_plain;h=3590ab06f96f123de64973e14195db333cbc50ff Pre-install Python dependencies in CI Docker images. Add `pybind11` and `wheel` to the (scripted) Docker image builds so that the admin/ci-scripts/build-and-test-py-gmxapi-0.3.sh script can use `--no-deps --no-index` with pip. Remove `pip install pybind11` where it is no longer needed in CI jobs. Follow-up to #4092. --- diff --git a/admin/ci-scripts/build-and-test-py-gmxapi-0.3.sh b/admin/ci-scripts/build-and-test-py-gmxapi-0.3.sh index b05a625d3a..43cc75f0e0 100644 --- a/admin/ci-scripts/build-and-test-py-gmxapi-0.3.sh +++ b/admin/ci-scripts/build-and-test-py-gmxapi-0.3.sh @@ -21,18 +21,14 @@ pushd python_packaging/src # Make sure to delete any accidentally lingering build artifacts. rm -rf build dist # Build and install the gmxapi Python package. -# TODO(#4092): Revert to using --no-deps and --no-index once Docker images updated. + # TODO(#3273): Reduce requirements for `setup.py` `sdist` command and provide build artifact. GMXTOOLCHAINDIR=$INSTALL_DIR/share/cmake/gromacs \ python -m pip install \ + --no-build-isolation \ --no-cache-dir \ + --no-deps \ + --no-index \ . -# # TODO(#3273): Reduce requirements for `setup.py` `sdist` command and provide build artifact. -# GMXTOOLCHAINDIR=$INSTALL_DIR/share/cmake/gromacs \ -# python -m pip install \ -# --no-cache-dir \ -# --no-deps \ -# --no-index \ -# . popd # Run Python unit tests. diff --git a/admin/containers/scripted_gmx_docker_builds.py b/admin/containers/scripted_gmx_docker_builds.py index 4492c45936..59971bce58 100755 --- a/admin/containers/scripted_gmx_docker_builds.py +++ b/admin/containers/scripted_gmx_docker_builds.py @@ -517,17 +517,14 @@ def prepare_venv(version: StrictVersion) -> typing.Sequence[str]: 'networkx>=2.0' \ 'numpy>=1' \ 'pip>=10.1' \ + 'pybind11>2.6' \ 'Pygments>=2.2.0' \ 'pytest>=3.9' \ 'setuptools>=42' \ + 'scikit-build>=0.10' \ 'Sphinx>=1.6.3' \ - 'sphinxcontrib-plantuml>=0.14'""") - - # TODO: Remove 'importlib_resources' dependency when Python >=3.7 is required. - if minor == 6: - commands.append(f"""{venv_path}/bin/python -m pip install --upgrade \ - 'importlib_resources'""") - + 'sphinxcontrib-plantuml>=0.14' \ + 'wheel'""") return commands diff --git a/admin/gitlab-ci/documentation.gitlab-ci.yml b/admin/gitlab-ci/documentation.gitlab-ci.yml index cb717d2c0d..e0df386b4a 100644 --- a/admin/gitlab-ci/documentation.gitlab-ci.yml +++ b/admin/gitlab-ci/documentation.gitlab-ci.yml @@ -47,8 +47,6 @@ # without additional hinting. Once CMakeCache.txt exists, the later stages # should work fine without reactivating the venv. - source /root/venv/py3.7/bin/activate - # TODO(#4092) Remove `pip install pybind11` once CI images are updated. - - /root/venv/py3.7/bin/pip install pybind11 - cmake .. -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache $CMAKE_COMPILER_SCRIPT @@ -153,8 +151,6 @@ fi - cd $RELEASE_BUILD_DIR - source /root/venv/py3.7/bin/activate - # TODO(#4092) Remove `pip install pybind11` once CI images are updated. - - /root/venv/py3.7/bin/pip install pybind11 - cmake ../$RELEASE_SOURCE/ -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache $CMAKE_COMPILER_SCRIPT @@ -195,8 +191,6 @@ docs:configure: image: ${CI_REGISTRY}/gromacs/gromacs/ci-ubuntu-20.04-llvm-7-docs script: - cd $BUILD_DIR - # TODO(#4092) Remove `pip install pybind11` once CI images are updated. - - /root/venv/py3.7/bin/pip install pybind11 - cmake --build . --target gmx -- -j8 - cd .. artifacts: @@ -244,8 +238,6 @@ docs:build: - cd $BUILD_DIR - cmake --build . --target manual -- -j4 | tee docs/manual/all-output.log | grep -i "warning" | grep -v "TeX" | grep -v "Package" || true - # TODO(#4092) Remove `pip install pybind11` once CI images are updated. - - /root/venv/py3.7/bin/pip install pybind11 - cmake --build . --target webpage -- -j4 - grep "WARNING:" docs/manual/all-output.log | tee pythonErrors.log || true - grep -i "error" docs/sphinx-*.log | tee sphinxDiagnostics.log || true diff --git a/admin/gitlab-ci/lint.gitlab-ci.yml b/admin/gitlab-ci/lint.gitlab-ci.yml index 4c7a414cdf..d5b43ad9b9 100644 --- a/admin/gitlab-ci/lint.gitlab-ci.yml +++ b/admin/gitlab-ci/lint.gitlab-ci.yml @@ -185,8 +185,6 @@ check-source: script: - CMAKE=${CMAKE:-$(which cmake)} - cd $BUILD_DIR - # TODO(#4092) Remove `pip install pybind11` once CI images are updated. - - /root/venv/py3.7/bin/pip install pybind11 - $CMAKE --build . --target check-source - awk '/warning.*include style.*order/,/You can use.*rst|^$/' docs/doxygen/check-source.log | tee doxygenError.txt || true - awk '/warning:.*includes/,/unnecessarily|^$/' docs/doxygen/check-source.log | tee -a doxygenError.txt || true diff --git a/python_packaging/src/setup.py b/python_packaging/src/setup.py index 742509b666..55ee2f4f5e 100644 --- a/python_packaging/src/setup.py +++ b/python_packaging/src/setup.py @@ -242,9 +242,13 @@ def update_gromacs_client_cmake_args(args: typing.List[str]): if suffix is not None: gmx_toolchain_dir = os.path.join(share_cmake, 'gromacs' + suffix) - if gmx_toolchain_dir is None: + if gmx_toolchain_dir is None or not os.path.exists(gmx_toolchain_dir): print(usage) - raise GmxapiInstallError('Could not configure for GROMACS installation. Provide GMXTOOLCHAINDIR.') + raise GmxapiInstallError( + 'Could not configure for GROMACS installation. ' + 'Provide GMXTOOLCHAINDIR or CMAKE_TOOLCHAIN_FILE. ' + 'See https://manual.gromacs.org/current/gmxapi/userguide/install.html' + ) suffix = os.path.basename(gmx_toolchain_dir).strip('gromacs') gmx_toolchain = os.path.abspath(os.path.join(gmx_toolchain_dir, 'gromacs-toolchain' + suffix + '.cmake'))