From f8abfa998187564b35830c373489e7cc6673673f Mon Sep 17 00:00:00 2001 From: Andreas Kloeckner Date: Wed, 1 Nov 2023 15:26:21 -0500 Subject: [PATCH] Install editable for pytest in CI --- .github/workflows/ci.yml | 24 +++++++++++ .gitlab-ci.yml | 86 +++++++++++++++++++++++++++------------- 2 files changed, 82 insertions(+), 28 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6f06acdc9..58f8e7b04 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -59,6 +59,12 @@ jobs: - name: "Main Script" run: | curl -L -O https://gitlab.tiker.net/inducer/ci-support/raw/main/build-and-test-py-project-within-miniconda.sh + + # Pytest gripes about ImportPathMismatchError if 'loopy.xyz' + # is importable both from a venv and the subdirectory. + # -AK, 2023-11-01 + PROJECT_INSTALL_FLAGS="--editable" + . ./build-and-test-py-project-within-miniconda.sh pytest_intel: @@ -77,6 +83,12 @@ jobs: source /opt/enable-intel-cl.sh curl -L -O https://tiker.net/ci-support-v0 . ./ci-support-v0 + + # Pytest gripes about ImportPathMismatchError if 'loopy.xyz' + # is importable both from a venv and the subdirectory. + # -AK, 2023-11-01 + PROJECT_INSTALL_FLAGS="--editable" + build_py_project_in_conda_env test_py_project @@ -89,6 +101,12 @@ jobs: run: | curl -L -O https://gitlab.tiker.net/inducer/ci-support/raw/main/build-and-test-py-project-within-miniconda.sh export _LOOPY_SKIP_ARG_CHECKS=1 + + # Pytest gripes about ImportPathMismatchError if 'loopy.xyz' + # is importable both from a venv and the subdirectory. + # -AK, 2023-11-01 + PROJECT_INSTALL_FLAGS="--editable" + . ./build-and-test-py-project-within-miniconda.sh pytest_twice: @@ -99,6 +117,12 @@ jobs: - name: "Main Script" run: | curl -L -O https://tiker.net/ci-support-v0 + + # Pytest gripes about ImportPathMismatchError if 'loopy.xyz' + # is importable both from a venv and the subdirectory. + # -AK, 2023-11-01 + PROJECT_INSTALL_FLAGS="--editable" + . ./ci-support-v0 build_py_project_in_conda_env ( test_py_project ) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 3b9817a2b..092619a17 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,10 +1,16 @@ Pytest POCL: - script: - - export PYOPENCL_TEST=portable:pthread - - export EXTRA_INSTALL="pybind11 numpy mako" - - export LOOPY_NO_CACHE=1 - - curl -L -O https://gitlab.tiker.net/inducer/ci-support/raw/main/build-and-test-py-project.sh - - ". ./build-and-test-py-project.sh" + script: | + export PYOPENCL_TEST=portable:pthread + export EXTRA_INSTALL="pybind11 numpy mako" + export LOOPY_NO_CACHE=1 + curl -L -O https://gitlab.tiker.net/inducer/ci-support/raw/main/build-and-test-py-project.sh + + # Pytest gripes about ImportPathMismatchError if 'loopy.xyz' + # is importable both from a venv and the subdirectory. + # -AK, 2023-11-01 + PROJECT_INSTALL_FLAGS="--editable" + + . ./build-and-test-py-project.sh tags: - python3 - pocl @@ -15,13 +21,19 @@ Pytest POCL: junit: test/pytest.xml Pytest Nvidia Titan V: - script: - - export PYOPENCL_TEST=nvi:titan - - export EXTRA_INSTALL="pybind11 numpy mako" - - export LOOPY_NO_CACHE=1 - - source /opt/enable-intel-cl.sh - - curl -L -O https://gitlab.tiker.net/inducer/ci-support/raw/main/build-and-test-py-project.sh - - ". ./build-and-test-py-project.sh" + script: | + export PYOPENCL_TEST=nvi:titan + export EXTRA_INSTALL="pybind11 numpy mako" + export LOOPY_NO_CACHE=1 + source /opt/enable-intel-cl.sh + curl -L -O https://gitlab.tiker."net/inducer/ci-support/raw/main/build-and-test-py-project.sh + + # Pytest gripes about ImportPathMismatchError if 'loopy.xyz' + # is importable both from a venv and the subdirectory. + # -AK, 2023-11-01 + PROJECT_INSTALL_FLAGS="--editable" + + . ./build-and-test-py-project.sh tags: - python3 - nvidia-titan-v @@ -32,13 +44,19 @@ Pytest Nvidia Titan V: junit: test/pytest.xml Pytest POCL without arg check: - script: - - export PYOPENCL_TEST=portable:pthread - - export EXTRA_INSTALL="pybind11 numpy mako" - - export LOOPY_NO_CACHE=1 - - export _LOOPY_SKIP_ARG_CHECKS=1 - - curl -L -O https://gitlab.tiker.net/inducer/ci-support/raw/main/build-and-test-py-project.sh - - ". ./build-and-test-py-project.sh" + script: | + export PYOPENCL_TEST=portable:pthread + export EXTRA_INSTALL="pybind11 numpy mako" + export LOOPY_NO_CACHE=1 + export _LOOPY_SKIP_ARG_CHECKS=1 + curl -L -O https://gitlab.tiker.net/inducer/ci-support/raw/main/build-and-test-py-project.sh + + # Pytest gripes about ImportPathMismatchError if 'loopy.xyz' + # is importable both from a venv and the subdirectory. + # -AK, 2023-11-01 + PROJECT_INSTALL_FLAGS="--editable" + + . ./build-and-test-py-project.sh tags: - python3 - pocl @@ -49,14 +67,20 @@ Pytest POCL without arg check: junit: test/pytest.xml Pytest Intel: - script: - - export PYOPENCL_TEST=intel - - export EXTRA_INSTALL="pybind11 numpy mako" - - export LOOPY_NO_CACHE=1 - - export LOOPY_INTEL_CL_OK_FOR_TEST_REF=1 - - source /opt/enable-intel-cl.sh - - curl -L -O https://gitlab.tiker.net/inducer/ci-support/raw/main/build-and-test-py-project.sh - - ". ./build-and-test-py-project.sh" + script: | + export PYOPENCL_TEST=intel + export EXTRA_INSTALL="pybind11 numpy mako" + export LOOPY_NO_CACHE=1 + export LOOPY_INTEL_CL_OK_FOR_TEST_REF=1 + source /opt/enable-intel-cl.sh + curl -L -O https://gitlab.tiker.net/inducer/ci-support/raw/main/build-and-test-py-project.sh + + # Pytest gripes about ImportPathMismatchError if 'loopy.xyz' + # is importable both from a venv and the subdirectory. + # -AK, 2023-11-01 + PROJECT_INSTALL_FLAGS="--editable" + + . ./build-and-test-py-project.sh tags: - python3 - intel-cl-cpu @@ -73,6 +97,12 @@ Pytest POCL Twice With Cache: export EXTRA_INSTALL="pybind11 numpy mako" curl -L -O https://gitlab.tiker.net/inducer/ci-support/raw/main/ci-support.sh . ./ci-support.sh + + # Pytest gripes about ImportPathMismatchError if 'loopy.xyz' + # is importable both from a venv and the subdirectory. + # -AK, 2023-11-01 + PROJECT_INSTALL_FLAGS="--editable" + build_py_project_in_venv ( test_py_project ) ( test_py_project ) -- GitLab