Skip to content
Snippets Groups Projects
Commit f98901b4 authored by Hkorb's avatar Hkorb
Browse files

change setup.py for gitlab pipeline

parent c6be1961
No related branches found
No related tags found
1 merge request!84Python bindings, amd, actuator line
...@@ -38,14 +38,13 @@ vf_gpu_cmake_args = [ ...@@ -38,14 +38,13 @@ vf_gpu_cmake_args = [
] ]
class CommandMixin(object): class CommandMixin:
user_options = [ user_options = [
('GPU', None, 'compile pyfluids with GPU backend'), ('GPU', None, 'compile pyfluids with GPU backend'),
] ]
def initialize_options(self): def initialize_options(self):
super().initialize_options() super().initialize_options()
# Initialize options
self.GPU = False self.GPU = False
def finalize_options(self): def finalize_options(self):
...@@ -53,7 +52,8 @@ class CommandMixin(object): ...@@ -53,7 +52,8 @@ class CommandMixin(object):
def run(self): def run(self):
global GPU global GPU
GPU = self.GPU # will be 1 or None GPU = self.GPU
super().run()
class InstallCommand(CommandMixin, install): class InstallCommand(CommandMixin, install):
user_options = getattr(install, 'user_options', []) + CommandMixin.user_options user_options = getattr(install, 'user_options', []) + CommandMixin.user_options
...@@ -67,8 +67,11 @@ class CMakeExtension(Extension): ...@@ -67,8 +67,11 @@ class CMakeExtension(Extension):
self.sourcedir = os.path.abspath(sourcedir) 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): def run(self):
super().run()
try: try:
out = subprocess.check_output(['cmake', '--version']) out = subprocess.check_output(['cmake', '--version'])
except OSError: except OSError:
......
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