Skip to content

Commit

Permalink
Replace requirement files with pyproject
Browse files Browse the repository at this point in the history
  • Loading branch information
dafeda committed Sep 22, 2023
1 parent 1f00934 commit 4e91d7c
Show file tree
Hide file tree
Showing 19 changed files with 188 additions and 214 deletions.
45 changes: 0 additions & 45 deletions .github/workflows/annotate_cpp.yml

This file was deleted.

30 changes: 30 additions & 0 deletions .github/workflows/annotate_python.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Annotate Python

on: [pull_request]

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
annotate-python-linting:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: -1
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: "3.11"
- name: Install flake8
run: pip install flake8 flake8-bugbear flake8-simplify flake8-debugger flake8-pep3101 Flake8-pyproject
- name: install project
run: pip install ".[dev, types]"
- name: find changed files
id: find_changed_files
run: echo "changed_files=$(git diff --name-only ${{github.sha}} ${{github.event.pull_request.base.sha}} | tr ' ' '\n' | xargs ls -d 2>/dev/null | grep -E '.py$' | tr '\n' ' ')" >> "$GITHUB_OUTPUT"
- run: echo ::add-matcher::.github/flake8-matcher.json
- name: run flake8
run: flake8 --exit-zero --ignore "W503, E203" ${{steps.find_changed_files.outputs.changed_files}}
if: steps.find_changed_files.outputs.changed_files != ''
7 changes: 1 addition & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -161,9 +161,7 @@ jobs:
python-version: ${{ matrix.python-version }}
cache: "pip"
cache-dependency-path: |
setup.py
pyproject.toml
dev-requirements.txt
- name: Get wheels
uses: actions/download-artifact@v3
Expand All @@ -172,10 +170,7 @@ jobs:

- name: Install wheel
run: |
find . -name "*.whl" -exec pip install {} \;
- name: Install dependencies
run: pip install -r dev-requirements.txt
find . -name "*.whl" -exec pip install "{}[dev]" \;
- name: Make test directory
run: |
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,7 @@ jobs:

- name: Install with dependencies
run: |
pip install .
pip install -r dev-requirements.txt
pip install ".[dev]"
- name: Test GUI
if: matrix.test-type == 'gui-tests'
Expand Down
7 changes: 1 addition & 6 deletions .github/workflows/doctest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,7 @@ jobs:
cache-dependency-path: |
setup.py
pyproject.toml
dev-requirements.txt
- run: pip install -e .

- name: Install with dependencies
run: |
pip install -r dev-requirements.txt
- run: pip install -e ".[dev]"

- name: Test doctest
run: |
Expand Down
6 changes: 2 additions & 4 deletions .github/workflows/style.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,10 @@ jobs:
cache-dependency-path: |
setup.py
pyproject.toml
style-requirements.txt
- name: Install dependencies
- name: Install ERT with style dependencies
run: |
pip install -r style-requirements.txt
pip install ".[style]"
- name: Clang Format
run: ./script/clang-format --check
Expand All @@ -59,5 +58,4 @@ jobs:

- name: Run pylint
run: |
pip install . # We need the dependencies of ERT to avoid import-error
script/pylint
6 changes: 1 addition & 5 deletions .github/workflows/test_ert.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ jobs:
cache-dependency-path: |
setup.py
pyproject.toml
dev-requirements.txt
- name: Get wheels
uses: actions/download-artifact@v3
Expand All @@ -38,10 +37,7 @@ jobs:

- name: Install wheel
run: |
find . -name "*.whl" -exec pip install {} \;
- name: Install dependencies
run: pip install -r dev-requirements.txt
find . -name "*.whl" -exec pip install "{}[dev]" \;
- name: Test GUI
if: inputs.test-type == 'gui-test'
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/typing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,11 @@ jobs:
python-version: ${{ matrix.python-version }}
- name: Install ERT and dependencies
run: |
pip install .
pip install ".[dev, types]"
- name: Install dependencies
# type checking requires protobuf stubs
run: |
python -m pip install --upgrade pip
python -m pip install -r types-requirements.txt
python -m pip install -r dev-requirements.txt
python -m pip install grpcio-tools
python -m grpc_tools.protoc -I src/_ert_com_protocol --mypy_out=src/_ert_com_protocol src/_ert_com_protocol/_schema.proto
- run: echo ::add-matcher::.github/mypy-matcher.json
Expand Down
9 changes: 5 additions & 4 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
version: 2

python:
install:
- requirements: dev-requirements.txt
- method: pip
path: .
install:
- method: pip
path: .
extra_requirements:
- dev

sphinx:
builder: html
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ noise in the review process.

You can build the documentation after installation by running
```bash
pip install -r dev-requirements.txt
pip install ".[dev]"
sphinx-build -n -v -E -W ./docs ./tmp/ert_docs
```
and then open the generated `./tmp/ert_docs/index.html` in a browser.
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ pip install --editable .
Additional development packages must be installed to run the test suite:

```sh
pip install -r dev-requirements.txt
pip install ".[dev]"
pytest tests/
```

Expand Down
3 changes: 1 addition & 2 deletions ci/run_ert_ctests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,7 @@ build_ert_clib () {

build_ert_dev () {
enable_environment
pip install ${ERT_SOURCE_ROOT}
pip install -r ${ERT_SOURCE_ROOT}/dev-requirements.txt
pip install "${ERT_SOURCE_ROOT}[dev]"
}

run_ctest () {
Expand Down
2 changes: 1 addition & 1 deletion ci/testkomodo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ copy_test_files () {
}

install_test_dependencies () {
pip install -r dev-requirements.txt
pip install "ert[dev]"
}

run_ert_with_opm () {
Expand Down
33 changes: 0 additions & 33 deletions dev-requirements.txt

This file was deleted.

Loading

0 comments on commit 4e91d7c

Please sign in to comment.