From f98901b48d8f5621f59b82bd3c6571f5e183158b Mon Sep 17 00:00:00 2001
From: Henry <henry.korb@geo.uu.se>
Date: Tue, 25 Jan 2022 16:28:08 +0100
Subject: [PATCH] change setup.py for gitlab pipeline

---
 setup.py | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/setup.py b/setup.py
index 3611f4474..0599db0b3 100644
--- a/setup.py
+++ b/setup.py
@@ -38,14 +38,13 @@ vf_gpu_cmake_args = [
 ]
 
 
-class CommandMixin(object):
+class CommandMixin:
     user_options = [
         ('GPU', None, 'compile pyfluids with GPU backend'),
     ]
 
     def initialize_options(self):
         super().initialize_options()
-        # Initialize options
         self.GPU = False
 
     def finalize_options(self):
@@ -53,7 +52,8 @@ class CommandMixin(object):
 
     def run(self):
         global GPU
-        GPU = self.GPU # will be 1 or None
+        GPU = self.GPU
+        super().run()
 
 class InstallCommand(CommandMixin, install):
     user_options = getattr(install, 'user_options', []) + CommandMixin.user_options
@@ -67,8 +67,11 @@ class CMakeExtension(Extension):
         self.sourcedir = os.path.abspath(sourcedir)
 
 
-class CMakeBuild(build_ext):
+class CMakeBuild(CommandMixin, build_ext):
+    user_options = getattr(build_ext, 'user_options', []) + CommandMixin.user_options
+
     def run(self):
+        super().run()
         try:
             out = subprocess.check_output(['cmake', '--version'])
         except OSError:
-- 
GitLab