Skip to content

Commit

Permalink
Test out uv lockfile
Browse files Browse the repository at this point in the history
  • Loading branch information
larsevj committed Dec 16, 2024
1 parent 72babc5 commit 5411a46
Show file tree
Hide file tree
Showing 12 changed files with 4,129 additions and 36 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@ jobs:

- name: Install ert with dev-deps
run: |
uv pip install ".[dev]"
uv sync --extra dev
- name: Run benchmark
run: |
pytest tests/ert/performance_tests/test_analysis.py::test_and_benchmark_adaptive_localization_with_fields --benchmark-json output.json
uv run pytest tests/ert/performance_tests/test_analysis.py::test_and_benchmark_adaptive_localization_with_fields --benchmark-json output.json
- name: Store benchmark result
uses: benchmark-action/github-action-benchmark@v1
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ jobs:

- name: Install ert
run: |
uv pip install ".[dev, everest]"
uv sync --extra dev --extra everest
- name: Make test directory
run: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/codspeed.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ jobs:
- name: Install uv
uses: astral-sh/setup-uv@v4
- run: |
uv pip install ".[dev, everest]"
uv sync --extra dev --extra everest
uv pip uninstall pytest-benchmark
uv pip install pytest-codspeed
- uses: CodSpeedHQ/action@v3
with:
token: ${{ secrets.CODSPEED_TOKEN }}
run: |
pytest tests/ert/performance_tests --codspeed --timeout=1200
uv run pytest tests/ert/performance_tests --codspeed --timeout=1200
8 changes: 4 additions & 4 deletions .github/workflows/run_ert_test_data_setups.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,23 +47,23 @@ jobs:

- name: Install ERT and dependencies
run: |
uv pip install .
uv sync
- name: Test poly example
run: |
pushd test-data/ert/poly_example
ert test_run poly.ert
uv run ert test_run poly.ert
popd
- name: Test snake_oil
run: |
pushd test-data/ert/snake_oil
uv pip install oil_reservoir_synthesizer resdata
ert test_run snake_oil.ert
uv run ert test_run snake_oil.ert
popd
- name: Test snake_oil_field
run: |
pushd test-data/ert/snake_oil_field
ert test_run snake_oil.ert
uv run ert test_run snake_oil.ert
popd
4 changes: 2 additions & 2 deletions .github/workflows/style.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ jobs:

- name: Install ERT with style dependencies
run: |
uv pip install ".[style]"
uv sync --extra style
- name: Run style check
if: ${{ always() }}
run: |
SKIP=no-commit-to-branch pre-commit run --all-files --show-diff-on-failure
SKIP=no-commit-to-branch uv run pre-commit run --all-files --show-diff-on-failure
14 changes: 7 additions & 7 deletions .github/workflows/test_ert.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@ jobs:

- name: Install ert
run: |
uv pip install ".[dev, everest]"
uv sync --extra dev --extra everest
- name: GUI Test
if: inputs.test-type == 'gui-tests'
run: |
pytest --cov=ert --cov=everest --cov=_ert --cov-report=xml:cov1.xml --junit-xml=junit.xml -o junit_family=legacy -v --mpl --benchmark-disable tests/ert/ui_tests/gui --durations=25
uv run pytest --cov=ert --cov=everest --cov=_ert --cov-report=xml:cov1.xml --junit-xml=junit.xml -o junit_family=legacy -v --mpl --benchmark-disable tests/ert/ui_tests/gui --durations=25
- name: Upload artifact images
uses: actions/upload-artifact@v4
Expand All @@ -53,18 +53,18 @@ jobs:
- name: CLI Test
if: inputs.test-type == 'cli-tests'
run: |
pytest --cov=ert --cov=everest --cov=_ert --cov-report=xml:cov1.xml --junit-xml=junit.xml -o junit_family=legacy -v --benchmark-disable --dist loadgroup tests/ert/ui_tests/cli --durations=25
uv run pytest --cov=ert --cov=everest --cov=_ert --cov-report=xml:cov1.xml --junit-xml=junit.xml -o junit_family=legacy -v --benchmark-disable --dist loadgroup tests/ert/ui_tests/cli --durations=25
- name: Unit Test
if: inputs.test-type == 'unit-tests'
run: |
pytest --cov=ert --cov=everest --cov=_ert --cov-report=xml:cov1.xml --junit-xml=junit.xml -o junit_family=legacy -n logical --show-capture=stderr -v --benchmark-disable --mpl --dist loadgroup tests/ert/unit_tests --durations=25
pytest --doctest-modules --cov=ert --cov=everest --cov=_ert --cov-report=xml:cov2.xml src/ --ignore src/ert/dark_storage
uv run pytest --cov=ert --cov=everest --cov=_ert --cov-report=xml:cov1.xml --junit-xml=junit.xml -o junit_family=legacy -n logical --show-capture=stderr -v --benchmark-disable --mpl --dist loadgroup tests/ert/unit_tests --durations=25
uv run pytest --doctest-modules --cov=ert --cov=everest --cov=_ert --cov-report=xml:cov2.xml src/ --ignore src/ert/dark_storage
- name: Performance Test
if: inputs.test-type == 'performance-tests'
run: |
pytest --cov=ert --cov=everest --cov=_ert --cov-report=xml:cov1.xml --junit-xml=junit.xml -o junit_family=legacy -n logical --show-capture=stderr -v --benchmark-disable --dist loadgroup tests/ert/performance_tests --durations=25
uv run pytest --cov=ert --cov=everest --cov=_ert --cov-report=xml:cov1.xml --junit-xml=junit.xml -o junit_family=legacy -n logical --show-capture=stderr -v --benchmark-disable --dist loadgroup tests/ert/performance_tests --durations=25
- name: Upload coverage to Codecov
id: codecov1
Expand Down Expand Up @@ -102,7 +102,7 @@ jobs:

- name: Test CLI
run: |
ert --help
uv run ert --help
- name: Test for a clean repository
run: |
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/test_ert_with_slurm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:

- name: Install ert
run: |
uv pip install ".[dev]"
uv sync --extra dev
- name: Install and setup slurm
run: |
Expand Down Expand Up @@ -69,8 +69,8 @@ jobs:
run: |
set -e
export _ERT_TESTS_ALTERNATIVE_QUEUE=AlternativeQ
pytest tests/ert/unit_tests/scheduler --slurm
pytest tests/ert/ui_tests/cli/test_missing_runpath.py --slurm
uv run pytest tests/ert/unit_tests/scheduler --slurm
uv run pytest tests/ert/ui_tests/cli/test_missing_runpath.py --slurm
- name: Test poly-example on slurm
run: |
Expand All @@ -84,4 +84,4 @@ jobs:
QUEUE_SYSTEM SLURM
EOF
time ert ensemble_experiment poly.ert
time uv run ert ensemble_experiment poly.ert
16 changes: 8 additions & 8 deletions .github/workflows/test_everest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,45 +35,45 @@ jobs:

- name: Install Everest and dependencies
run: |
uv pip install ".[dev,everest]"
uv sync --extra dev --extra everest
- name: Run Tests Linux
if: ${{ inputs.test-type == 'test' && runner.os != 'macOS'}}
run: |
pytest tests/everest -n 4 --cov=ert --cov=everest --cov=_ert --cov-report=xml:cov1.xml --junit-xml=junit.xml -o junit_family=legacy -m "not integration_test" --dist loadgroup -sv
uv run pytest tests/everest -n 4 --cov=ert --cov=everest --cov=_ert --cov-report=xml:cov1.xml --junit-xml=junit.xml -o junit_family=legacy -m "not integration_test" --dist loadgroup -sv
- name: Run Tests macOS
if: ${{ inputs.test-type == 'test' && runner.os == 'macOS'}}
run: |
python -m pytest tests/everest -n 4 --cov=ert --cov=everest --cov=_ert --cov-report=xml:cov1.xml --junit-xml=junit.xml -o junit_family=legacy -m "not integration_test and not fails_on_macos_github_workflow" --dist loadgroup -sv
uv run python -m pytest tests/everest -n 4 --cov=ert --cov=everest --cov=_ert --cov-report=xml:cov1.xml --junit-xml=junit.xml -o junit_family=legacy -m "not integration_test and not fails_on_macos_github_workflow" --dist loadgroup -sv
- name: Run Integration Tests Linux
if: ${{inputs.test-type == 'integration-test' && runner.os != 'macOS'}}
run: |
pytest tests/everest -n 4 --cov=ert --cov=everest --cov=_ert --cov-report=xml:cov1.xml --junit-xml=junit.xml -o junit_family=legacy -m "integration_test" --dist loadgroup -sv
uv run pytest tests/everest -n 4 --cov=ert --cov=everest --cov=_ert --cov-report=xml:cov1.xml --junit-xml=junit.xml -o junit_family=legacy -m "integration_test" --dist loadgroup -sv
- name: Run Integration Tests macOS
if: ${{inputs.test-type == 'integration-test' && runner.os == 'macOS'}}
run: |
python -m pytest tests/everest -n 4 --cov=ert --cov=everest --cov=_ert --cov-report=xml:cov1.xml --junit-xml=junit.xml -o junit_family=legacy -m "integration_test and not fails_on_macos_github_workflow" --dist loadgroup
uv run python -m pytest tests/everest -n 4 --cov=ert --cov=everest --cov=_ert --cov-report=xml:cov1.xml --junit-xml=junit.xml -o junit_family=legacy -m "integration_test and not fails_on_macos_github_workflow" --dist loadgroup
- name: Build Documentation
if: inputs.test-type == 'doc'
run: |
uv pip install git+https://github.com/equinor/everest-models.git
mkdir tmp
sphinx-build -n -v -E -W ./docs/everest ./tmp/everest_docs
uv run sphinx-build -n -v -E -W ./docs/everest ./tmp/everest_docs
- name: Run tests requiring everest-models
if: inputs.test-type == 'everest-models-test'
run: |
uv pip install git+https://github.com/equinor/everest-models.git
python -m pytest tests/everest -n 4 --cov=ert --cov=everest --cov=_ert --cov-report=xml:cov1.xml --junit-xml=junit.xml -o junit_family=legacy -m everest_models_test --dist loadgroup
uv run python -m pytest tests/everest -n 4 --cov=ert --cov=everest --cov=_ert --cov-report=xml:cov1.xml --junit-xml=junit.xml -o junit_family=legacy -m everest_models_test --dist loadgroup
- name: Test docs entry point
if: inputs.test-type == 'everest-docs-entry-test'
run: |
python -m everest.docs
uv run python -m everest.docs
- name: Upload coverage to Codecov
if: inputs.test-type != 'everest-docs-entry-test' && inputs.test-type != 'doc'
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test_semeio.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:

- name: Install ert
run: |
uv pip install .
uv sync
- name: Get semeio
run: |
Expand All @@ -48,4 +48,4 @@ jobs:
run: |
pushd semeio
uv pip install ".[test]"
pytest
uv run pytest
6 changes: 3 additions & 3 deletions .github/workflows/typing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,13 @@ jobs:

- name: Install ERT and dependencies
run: |
uv pip install ".[dev, types, everest]"
uv sync --extra dev --extra types --extra everest
- run: echo ::add-matcher::.github/mypy-matcher.json
- name: Run mypy ert
run: |
mypy src/ert
uv run mypy src/ert
- name: Run mypy everest
run: |
mypy src/everest
uv run mypy src/everest
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ authors = [
{ name = "Equinor ASA", email = "[email protected]" },
]
description = "Ensemble based Reservoir Tool (ERT)"
requires-python = ">=3.11"
requires-python = ">=3.11, <3.13"
readme = "README.md"
license = { text = "GPL-3.0" }
classifiers = [
Expand Down
Loading

0 comments on commit 5411a46

Please sign in to comment.