From ed88c141c35e3d03eade4ac5a5e0f872fbc18851 Mon Sep 17 00:00:00 2001 From: Timo Koch <timo.koch@iws.uni-stuttgart.de> Date: Sat, 20 Nov 2021 16:45:05 +0100 Subject: [PATCH 1/2] [python] Fix setup.py to find all sub-packages and add dev dependencies --- dune.module | 2 +- python/setup.py.in | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/dune.module b/dune.module index 7d3cb02572..4bf3ee560f 100644 --- a/dune.module +++ b/dune.module @@ -6,5 +6,5 @@ Depends: dune-common (>=2.8) dune-grid (>=2.8) dune-localfunctions (>=2.8) dune- Suggests: dune-alugrid (>=2.8) dune-foamgrid (>=2.8) dune-uggrid (>=2.8) dune-functions (>=2.8) opm-common opm-grid dune-subgrid (>=2.8) dune-spgrid (>=2.8) dune-mmesh (>=1.2) Description: DuMux is a module for simulation of multi-phase multi-component flow transport in porous media URL: https://dumux.org -Python-Requires: +Python-Requires: flake8 pylint numpy Whitespace-Hook: Yes diff --git a/python/setup.py.in b/python/setup.py.in index 8504ecc10b..539ce130d7 100644 --- a/python/setup.py.in +++ b/python/setup.py.in @@ -1,4 +1,4 @@ -from setuptools import setup +from setuptools import setup, find_packages REQUIRED_PACKAGES = '${RequiredPythonModules}'.replace(';',' ').split(' ') @@ -8,7 +8,7 @@ setup( version="${ProjectVersionString}", author="${ProjectAuthor}", author_email="${ProjectMaintainerEmail}", - packages=["dumux"], + packages=find_packages(), zip_safe=0, package_data={"": ["*.so"]}, install_requires=REQUIRED_PACKAGES, -- GitLab From 471870397612b74aa2e5b79685b0544f2be8a64a Mon Sep 17 00:00:00 2001 From: Timo Koch <timo.koch@iws.uni-stuttgart.de> Date: Sat, 20 Nov 2021 16:56:50 +0100 Subject: [PATCH 2/2] [ci][python] Linters are now installed in venv as deps of dumux --- .gitlab-ci/default.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.gitlab-ci/default.yml b/.gitlab-ci/default.yml index 17f7d77393..768c56edaa 100644 --- a/.gitlab-ci/default.yml +++ b/.gitlab-ci/default.yml @@ -51,13 +51,15 @@ black (python): pylint-flake8 (python): stage: linting script: + # restore Python virtual env from cache (job:configure artifacts) (Dune 2.9) + - | + if [ -d "build-cmake/dune-env" ]; then + rm -r /dune/modules/dune-common/build-cmake/dune-env + mv build-cmake/dune-env /dune/modules/dune-common/build-cmake/dune-env + fi - | if [ -d build-cmake/python/dumux ] ; then source bin/testing/ci-setup-python-env.sh - # if we are in venv (Dune 2.9) install linters - if [ -d "/dune/modules/dune-common/build-cmake/dune-env" ]; then - python -m pip install pylint flake8 - fi pylint --rcfile=.pylintrc build-cmake/python/dumux pylint --rcfile=.pylintrc bin flake8 build-cmake/python/dumux -- GitLab