Skip to content

Commit 1d9d6e3

Browse files
authored
Merge pull request geodynamics#681 from bobmyhill/relax_deps
Relax dependencies, add coverage script
2 parents 4114dc6 + cea6f9e commit 1d9d6e3

File tree

2 files changed

+32
-3
lines changed

2 files changed

+32
-3
lines changed

pyproject.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,17 @@ classifiers = [
2020

2121
[tool.poetry.dependencies]
2222
python = "^3.8"
23-
numpy = ">=1.24,<=2.2"
23+
numpy = "^2"
2424
scipy = "^1.10"
2525
sympy = "^1.12"
2626
cvxpy = "^1.3"
2727
matplotlib = "^3.7"
28-
numba = ">=0.59,<=0.61"
28+
numba = ">=0.59,^0"
2929
pycddlib-standalone = {version = "^3.0", optional = true}
3030

3131
[tool.poetry.dev-dependencies]
3232
ipython = "^8.5"
33-
numba = ">=0.59,<=0.61"
33+
numba = ">=0.59,^0"
3434

3535
[tool.poetry.extras]
3636
dev = ["pycddlib-standalone"]

run_coverage.sh

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#!/bin/bash
2+
3+
# This script runs the test suite and checks that code coverage has not decreased
4+
# relative to the main branch. It also generates an HTML coverage report.
5+
6+
# Uninstall numba to avoid issues with coverage measurement
7+
python -m pip install -q -e .[dev]
8+
python -m pip uninstall -y numba
9+
10+
# Get current coverage
11+
coverage run -m unittest discover ./tests
12+
coverage report > new_coverage.tmp
13+
current_coverage=$(coverage report --precision=7 --format=total)
14+
echo "Coverage: $current_coverage"
15+
16+
# Generate HTML coverage report
17+
coverage html -d htmlcov
18+
19+
# Reinstall numba, clean up temporary files
20+
python -m pip install -q -e .[dev]
21+
rm new_coverage.tmp
22+
echo "Numba reinstalled:"
23+
pip freeze | grep numba
24+
25+
26+
# Open the HTML coverage report in the default web browser if on macOS
27+
if [[ "$OSTYPE" == "darwin"* ]]; then
28+
open "htmlcov/index.html"
29+
fi

0 commit comments

Comments
 (0)