Skip to content

Commit ea7cd2b

Browse files
authored
Merge pull request #17 from openscm/tweak-makefile
Update Makefile
2 parents 9f03851 + 6b8f226 commit ea7cd2b

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

Makefile

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,8 @@
66
TEMP_FILE := $(shell mktemp)
77
# Directory in which to build the Fortran when using a standalone build
88
BUILD_DIR := build
9-
# Coverage directory - needed to trick code cov to look in the right place
10-
COV_DIR := $(shell uv run --no-sync python -c 'from pathlib import Path; import example_fgen_basic; print(Path(example_fgen_basic.__file__).parent)')
119

10+
JUNK := $(shell uv run --no-sync python -c 'from pathlib import Path; import example_fgen_basic; print(Path(example_fgen_basic.__file__).parent)'); \
1211
# A helper script to get short descriptions of each target in the Makefile
1312
define PRINT_HELP_PYSCRIPT
1413
import re, sys
@@ -51,7 +50,10 @@ test: ## run the tests (re-installs the package every time so you might want to
5150
# because it is looking for lines in `src` to be run,
5251
# but they're not because lines in `.venv` are run instead.
5352
# We don't have a solution to this yet.
54-
uv run --no-editable --reinstall-package example-fgen-basic pytest -r a -v tests src --doctest-modules --doctest-report ndiff --cov=$(COV_DIR)
53+
#
54+
# Coverage directory - needed to trick code cov to looking at the right place
55+
COV_DIR=$$(uv run --no-sync python -c 'from pathlib import Path; import example_fgen_basic; print(Path(example_fgen_basic.__file__).parent)'); \
56+
uv run --no-editable --reinstall-package example-fgen-basic pytest -r a -v tests src --doctest-modules --doctest-report ndiff --cov=$$COV_DIR
5557

5658
# Note on code coverage and testing:
5759
# You must specify cov=src.

changelog/17.trivial.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Updated the `Makefile` to avoid confusing `uv` failure messages whenever we run the `Makefile` without having first run `make virtual-environment` (because we determine the value of `COV_DIR` irrespective of whether it is needed or not)

0 commit comments

Comments
 (0)