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 Jan 29, 2025
1 parent cb0726d commit 5a16d21
Show file tree
Hide file tree
Showing 12 changed files with 4,321 additions and 57 deletions.
9 changes: 6 additions & 3 deletions .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ on:
env:
ERT_SHOW_BACKTRACE: 1
ECL_SKIP_SIGNAL: 1
UV_SYSTEM_PYTHON: 1
UV_FROZEN: true

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand Down Expand Up @@ -148,14 +148,17 @@ jobs:

- name: Install uv
uses: astral-sh/setup-uv@v5
with:
enable-cache: true
python-version: ${{ matrix.python-version }}

- name: Install ert
run: |
uv pip install ".[dev, everest]"
uv sync --extra everest --extra dev
- name: Test docs
run: |
just build-ert-docs
uv run just build-ert-docs
publish:
name: Publish to PyPI
Expand Down
9 changes: 6 additions & 3 deletions .github/workflows/codspeed.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
workflow_dispatch:

env:
UV_SYSTEM_PYTHON: 1
UV_FROZEN: true

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand All @@ -28,12 +28,15 @@ jobs:
python-version: '3.12'
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
enable-cache: true
python-version: '3.12'
- run: |
uv pip install ".[dev, everest]"
uv sync --extra everest --extra dev
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
13 changes: 8 additions & 5 deletions .github/workflows/run_ert_test_data_setups.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ concurrency:

env:
ERT_SHOW_BACKTRACE: 1
UV_SYSTEM_PYTHON: 1
UV_FROZEN: true

jobs:
run-ert-test-data:
Expand Down Expand Up @@ -43,26 +43,29 @@ jobs:

- name: Install uv
uses: astral-sh/setup-uv@v5
with:
enable-cache: true
python-version: ${{ matrix.python-version }}

- name: Install ERT and dependencies
run: |
uv pip install .
uv sync --extra dev
- 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
9 changes: 6 additions & 3 deletions .github/workflows/style.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
pull_request:

env:
UV_SYSTEM_PYTHON: 1
UV_FROZEN: true

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand All @@ -35,12 +35,15 @@ jobs:

- name: Install uv
uses: astral-sh/setup-uv@v5
with:
enable-cache: true
python-version: ${{ matrix.python-version }}

- 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
18 changes: 11 additions & 7 deletions .github/workflows/test_ert.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ on:
env:
ERT_SHOW_BACKTRACE: 1
ECL_SKIP_SIGNAL: 1
UV_SYSTEM_PYTHON: 1
ERT_PYTEST_ARGS: '-m ${{ inputs.select-string }} --cov=ert --cov=everest --cov=_ert --cov-report=xml:cov1.xml --junit-xml=junit.xml -o junit_family=legacy -v --durations=25 --benchmark-disable'
UV_FROZEN: true

jobs:
tests-ert:
Expand All @@ -40,15 +40,18 @@ jobs:

- name: Install uv
uses: astral-sh/setup-uv@v5
with:
enable-cache: true
python-version: ${{ inputs.python-version }}

- name: Install ert
run: |
uv pip install ".[dev, everest]"
uv sync --extra everest --extra dev
- name: GUI Test
if: inputs.test-type == 'gui-tests'
run: |
just ert-gui-tests
uv run just ert-gui-tests
- name: Upload artifact images
uses: actions/upload-artifact@v4
Expand All @@ -61,13 +64,13 @@ jobs:
- name: CLI Test
if: inputs.test-type == 'cli-tests'
run: |
just ert-cli-tests
uv run just ert-cli-tests
- name: Unit Test
if: inputs.test-type == 'performance-and-unit-tests'
run: |
just ert-unit-tests
ERT_PYTEST_ARGS='-m ${{ inputs.select-string }} --cov=ert --cov=everest --cov=_ert --cov-report=xml:cov2.xml --junit-xml=junit.xml -o junit_family=legacy -v --durations=25 --benchmark-disable' just ert-doc-tests
uv run just ert-unit-tests
ERT_PYTEST_ARGS='-m ${{ inputs.select-string }} --cov=ert --cov=everest --cov=_ert --cov-report=xml:cov2.xml --junit-xml=junit.xml -o junit_family=legacy -v --durations=25 --benchmark-disable' uv run just ert-doc-tests
- name: Upload coverage to Codecov
id: codecov1
Expand Down Expand Up @@ -105,11 +108,12 @@ jobs:

- name: Test CLI
run: |
ert --help
uv run ert --help
- name: Test for a clean repository
run: |
# Remove things we have generated on purpose:
ls -la
rm -rf .coverage
rm -f coverage.xml cov1.xml cov2.xml junit.xml
rm -f ert.*.whl
Expand Down
15 changes: 9 additions & 6 deletions .github/workflows/test_ert_with_flow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
type: string

env:
UV_SYSTEM_PYTHON: 1
UV_FROZEN: true

jobs:
test-ert-with-flow:
Expand All @@ -29,10 +29,13 @@ jobs:

- name: Install uv
uses: astral-sh/setup-uv@v5
with:
enable-cache: true
python-version: ${{ inputs.python-version }}

- name: Install ert and everest
run: |
uv pip install ".[everest,dev]"
uv sync --extra everest --extra dev
uv pip install git+https://github.com/equinor/everest-models
- name: Install flow
Expand All @@ -50,18 +53,18 @@ jobs:
- name: Run integration tests towards OPM flow without flowrun
run: |
set -e
pytest tests/ert/unit_tests/resources/test_run_flow_simulator.py
uv run pytest tests/ert/unit_tests/resources/test_run_flow_simulator.py
- name: Run Ert on an example configuration with flow
run: |
pushd test-data/ert/flow_example
perl -p -i -e 's/NUM_REALIZATIONS\s*12/NUM_REALIZATIONS 2/g' flow.ert
ert ensemble_experiment flow.ert
uv run ert ensemble_experiment flow.ert
popd
- name: Run Everest on an example configuration with flow
run: |
pushd test-data/everest/egg/everest/model
everest lint config_flow.yml
everest run config_flow.yml
uv run everest lint config_flow.yml
uv run everest run config_flow.yml
popd
13 changes: 8 additions & 5 deletions .github/workflows/test_ert_with_slurm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
type: string

env:
UV_SYSTEM_PYTHON: 1
UV_FROZEN: true

jobs:
test-ert-on-slurm:
Expand All @@ -29,10 +29,13 @@ jobs:

- name: Install uv
uses: astral-sh/setup-uv@v5
with:
enable-cache: true
python-version: ${{ inputs.python-version }}

- name: Install ert
run: |
uv pip install ".[dev]"
uv sync --extra dev
- name: Install and setup slurm
run: |
Expand Down Expand Up @@ -84,11 +87,11 @@ jobs:
run: |
set -e
export _ERT_TESTS_ALTERNATIVE_QUEUE=AlternativeQ
pytest tests/ert/unit_tests/scheduler/test_{generic,slurm}_driver.py -sv --slurm \
uv run pytest tests/ert/unit_tests/scheduler/test_{generic,slurm}_driver.py -sv --slurm \
-n 8 --durations=10 -k "not (LsfDriver or LocalDriver or OpenPBSDriver)"
scontrol show job
pytest tests/ert/ui_tests/cli/test_missing_runpath.py --slurm
uv run pytest tests/ert/ui_tests/cli/test_missing_runpath.py --slurm
- name: Test poly-example on slurm
run: |
Expand All @@ -102,4 +105,4 @@ jobs:
QUEUE_SYSTEM SLURM
EOF
time ert ensemble_experiment poly.ert
time uv run ert ensemble_experiment poly.ert
15 changes: 9 additions & 6 deletions .github/workflows/test_everest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ on:

env:
NO_PROJECT_RES: 1
UV_SYSTEM_PYTHON: 1
UV_FROZEN: true

jobs:
tests-everest:
Expand All @@ -37,32 +37,35 @@ jobs:

- name: Install uv
uses: astral-sh/setup-uv@v5
with:
enable-cache: true
python-version: ${{ inputs.python-version }}

- name: Install Everest and dependencies
run: |
uv pip install ".[dev,everest]"
uv sync --extra everest --extra dev
- name: Run Tests Linux
if: ${{ inputs.test-type == 'test' && runner.os != 'macOS'}}
run: |
ERT_PYTEST_ARGS='--cov=ert --cov=everest --cov=_ert --cov-report=xml:cov1.xml --junit-xml=junit.xml -o junit_family=legacy --dist loadgroup -sv' just everest-tests
ERT_PYTEST_ARGS='--cov=ert --cov=everest --cov=_ert --cov-report=xml:cov1.xml --junit-xml=junit.xml -o junit_family=legacy --dist loadgroup -sv' uv run just everest-tests
- name: Run Tests macOS
if: ${{ inputs.test-type == 'test' && runner.os == 'macOS'}}
run: |
ERT_PYTEST_ARGS='--cov=ert --cov=everest --cov=_ert --cov-report=xml:cov1.xml --junit-xml=junit.xml -o junit_family=legacy -m "not skip_mac_ci" --dist loadgroup -sv' just everest-tests
ERT_PYTEST_ARGS='--cov=ert --cov=everest --cov=_ert --cov-report=xml:cov1.xml --junit-xml=junit.xml -o junit_family=legacy -m "not skip_mac_ci" --dist loadgroup -sv' uv run just everest-tests
- name: Build Documentation
if: inputs.test-type == 'doc'
run: |
uv pip install git+https://github.com/equinor/everest-models.git
sphinx-build -n -v -E -W ./docs/everest ./everest_docs
uv run sphinx-build -n -v -E -W ./docs/everest ./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
ERT_PYTEST_ARGS='--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' just everest-tests
ERT_PYTEST_ARGS='--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 just everest-tests
- name: Upload coverage to Codecov
if: inputs.test-type != 'everest-docs-entry-test' && inputs.test-type != 'doc'
Expand Down
11 changes: 7 additions & 4 deletions .github/workflows/test_semeio.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ name: Test Semeio
on: [pull_request]

env:
UV_SYSTEM_PYTHON: 1
UV_FROZEN: true

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand Down Expand Up @@ -40,10 +40,13 @@ jobs:

- name: Install uv
uses: astral-sh/setup-uv@v5
with:
enable-cache: true
python-version: ${{ matrix.python-version }}

- name: Install ert
run: |
uv pip install .
uv sync
- name: Get semeio
run: |
Expand All @@ -52,5 +55,5 @@ jobs:
- name: Test semeio
run: |
pushd semeio
uv pip install ".[test]"
pytest
VIRTUAL_ENV=../.venv uv pip install ".[test]"
UV_PROJECT_ENVIRONMENT=../.venv uv run --no-sync pytest
9 changes: 6 additions & 3 deletions .github/workflows/typing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
pull_request:

env:
UV_SYSTEM_PYTHON: 1
UV_FROZEN: true

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand All @@ -35,12 +35,15 @@ jobs:

- name: Install uv
uses: astral-sh/setup-uv@v5
with:
enable-cache: true
python-version: ${{ matrix.python-version }}

- name: Install ERT and dependencies
run: |
uv pip install ".[dev, types, everest]"
uv sync --extra everest --extra dev --extra types
- run: echo ::add-matcher::.github/mypy-matcher.json
- name: Run mypy
run: |
mypy src/ert src/everest
uv run mypy src/ert src/everest
Loading

0 comments on commit 5a16d21

Please sign in to comment.