Skip to content
Snippets Groups Projects
Commit 6d5cae16 authored by Leon Keim's avatar Leon Keim
Browse files

Merge branch 'ci/use-python-venv' into 'master'

[ci] use Python venv ci-env for ci dependencies

See merge request !3786
parents 8ee24162 f48ef1a5
No related branches found
No related tags found
1 merge request!3786[ci] use Python venv ci-env for ci dependencies
Pipeline #43808 failed
+5
...@@ -44,6 +44,12 @@ configure: ...@@ -44,6 +44,12 @@ configure:
python3 -m pip install -r requirements.txt python3 -m pip install -r requirements.txt
cp -r /dune/modules/dune-common/build-cmake/dune-env build-cmake cp -r /dune/modules/dune-common/build-cmake/dune-env build-cmake
fi fi
# create Python venv with ci dependencies
- |
mkdir build-cmake/ci-env
python3 -m venv build-cmake/ci-env
source build-cmake/ci-env/bin/activate
python3 -m pip install -r requirements.txt
artifacts: artifacts:
paths: paths:
- build-cmake - build-cmake
...@@ -53,6 +59,7 @@ configure: ...@@ -53,6 +59,7 @@ configure:
linters: linters:
stage: linting stage: linting
script: script:
- source build-cmake/ci-env/bin/activate
# black # black
- echo "Running black" - echo "Running black"
- black --version - black --version
...@@ -87,15 +94,15 @@ linters: ...@@ -87,15 +94,15 @@ linters:
mv build-cmake/dune-env /dune/modules/dune-common/build-cmake/dune-env mv build-cmake/dune-env /dune/modules/dune-common/build-cmake/dune-env
fi fi
- | - |
pylint --rcfile=.pylintrc bin
pylint --rcfile=.pylintrc dumux/porenetwork/util/*.py
flake8 bin
flake8 dumux/porenetwork/util
if [ -d build-cmake/python/dumux ] ; then if [ -d build-cmake/python/dumux ] ; then
source /dune/modules/dune-common/build-cmake/dune-env/bin/activate source /dune/modules/dune-common/build-cmake/dune-env/bin/activate
pylint --rcfile=.pylintrc build-cmake/python/dumux pylint --rcfile=.pylintrc build-cmake/python/dumux
flake8 build-cmake/python/dumux flake8 build-cmake/python/dumux
fi fi
pylint --rcfile=.pylintrc bin
pylint --rcfile=.pylintrc dumux/porenetwork/util/*.py
flake8 bin
flake8 dumux/porenetwork/util
needs: needs:
- job: configure - job: configure
artifacts: true artifacts: true
...@@ -232,6 +239,7 @@ test cpp: ...@@ -232,6 +239,7 @@ test cpp:
DUMUX_NUM_THREADS: 4 DUMUX_NUM_THREADS: 4
script: script:
- | - |
source build-cmake/ci-env/bin/activate
pushd build-cmake pushd build-cmake
if [ -s ../affectedtests.json ]; then if [ -s ../affectedtests.json ]; then
python3 ../bin/testing/runselectedtests.py -c ../affectedtests.json -t python3 ../bin/testing/runselectedtests.py -c ../affectedtests.json -t
...@@ -255,6 +263,7 @@ test python: ...@@ -255,6 +263,7 @@ test python:
DUMUX_NUM_THREADS: 4 DUMUX_NUM_THREADS: 4
script: script:
- | - |
source build-cmake/ci-env/bin/activate
if ( [ -d "build-cmake/python" ] && ([ ! -s changedfiles.txt ] || grep -q python "changedfiles.txt")); then if ( [ -d "build-cmake/python" ] && ([ ! -s changedfiles.txt ] || grep -q python "changedfiles.txt")); then
if [ ! -s changedfiles.txt ]; then if [ ! -s changedfiles.txt ]; then
echo "Skipping test selection: considering all Python tests." echo "Skipping test selection: considering all Python tests."
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment