From a74399a376d6becdde34622b523a6ca8ebfa15e8 Mon Sep 17 00:00:00 2001 From: Jonathan Maddock <78556175+jonmaddock@users.noreply.github.com> Date: Thu, 25 Jan 2024 14:48:26 +0000 Subject: [PATCH 1/3] Make default install editable --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 22230dadf1..db15c7829e 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -177,7 +177,7 @@ ADD_CUSTOM_TARGET(coverage_cleanup # Run the Pip Install ADD_CUSTOM_TARGET(install_process ALL - COMMAND ${Python3_EXECUTABLE} -m pip install --no-cache-dir ${CMAKE_SOURCE_DIR} + COMMAND ${Python3_EXECUTABLE} -m pip install --no-cache-dir -e ${CMAKE_SOURCE_DIR} ) ADD_DEPENDENCIES(install_process ${PIP_NAME} f2py ${FORD_NAME} ${GFORTLIB_NAME} ${DICTS_NAME} coverage_cleanup) From 8e3b56448b45a5f94d5e63ef750ecb639357967a Mon Sep 17 00:00:00 2001 From: Jonathan Maddock <78556175+jonmaddock@users.noreply.github.com> Date: Thu, 25 Jan 2024 14:55:48 +0000 Subject: [PATCH 2/3] Editable install in CI to match default Keep CI in line with local user experience. --- .github/workflows/process.yml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/workflows/process.yml b/.github/workflows/process.yml index 20bed581c6..df8c01e80b 100644 --- a/.github/workflows/process.yml +++ b/.github/workflows/process.yml @@ -91,7 +91,8 @@ jobs: name: process-build-artifacts path: process/ - name: Install PROCESS - run: pip install . + # Editable install to match default install + run: pip install -e . - name: Run unit tests run: pytest --cov=process tests/unit -v - name: Archive unit test coverage data @@ -116,7 +117,7 @@ jobs: # name: process-build-artifacts # path: process/ # - name: Install PROCESS - # run: pip install . + # run: pip install -e . # - name: Run integration tests # run: pytest tests/integration/ -n auto -v @@ -137,7 +138,7 @@ jobs: name: process-build-artifacts path: process/ - name: Install PROCESS - run: pip install . + run: pip install -e . - name: Run regression tests run: pytest tests/regression -v --reg-tolerance=0 @@ -158,7 +159,7 @@ jobs: name: process-build-artifacts path: process/ - name: Install PROCESS - run: pip install . + run: pip install -e . - name: Run regression tests run: pytest tests/regression @@ -179,7 +180,7 @@ jobs: name: process-build-artifacts path: process/ - name: Install PROCESS - run: pip install . + run: pip install -e . - name: Run large tokamak run: | process -i tests/regression/scenarios/large-tokamak/IN.DAT @@ -234,7 +235,7 @@ jobs: name: process-build-artifacts path: process/ - name: Install PROCESS - run: pip install . + run: pip install -e . - name: Setup SSH identity uses: webfactory/ssh-agent@v0.7.0 with: From 6afafee55c8544aac3e26649cf263d6a93d67849 Mon Sep 17 00:00:00 2001 From: Jonathan Maddock <78556175+jonmaddock@users.noreply.github.com> Date: Thu, 25 Jan 2024 15:08:23 +0000 Subject: [PATCH 3/3] Add editable install to docs --- documentation/proc-pages/development/testing.md | 8 +------- .../proc-pages/installation/installation-ubuntu.md | 2 +- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/documentation/proc-pages/development/testing.md b/documentation/proc-pages/development/testing.md index e6674a6b5d..6b14c36402 100644 --- a/documentation/proc-pages/development/testing.md +++ b/documentation/proc-pages/development/testing.md @@ -127,13 +127,7 @@ runs just the regression tests on all available cores. ## Test coverage Test coverage (in Python only) is provided in a badge on the repository homepage. A report can -also be generated locally. First, ensure a development install is being used: - -```bash -pip install -e . -``` - -This ensures that `pytest` and `pytest-cov` will use the same installed location of Process. Then: +also be generated locally. A development (editable) pip installation (which is run by default by the `cmake` build script) ensures that `pytest` and `pytest-cov` will use the same installed location of Process. Then: ```bash pytest --cov=process tests/unit/ diff --git a/documentation/proc-pages/installation/installation-ubuntu.md b/documentation/proc-pages/installation/installation-ubuntu.md index 2eace0ffb1..37bafdf887 100644 --- a/documentation/proc-pages/installation/installation-ubuntu.md +++ b/documentation/proc-pages/installation/installation-ubuntu.md @@ -83,7 +83,7 @@ the PROCESS Python package is then automatically installed using `pip` and shoul on Linux. If the installation was successful the command `process` should be available on the command line. To rebuild, for example after making a change to the Fortran source, run `cmake --build build` again. -Python-only changes can be installed using `pip install .` when in the PROCESS root directory. +Python-only changes are reflected immediately, as the `cmake` build script performs a development (editable) installation by default. The PROCESS test suite provides through tests that can be used to confirm a successful installation; the tests can then be used to verify changes you make have not affected the wider codebase.