Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 6954a787 authored by ADILI Robin's avatar ADILI Robin
Browse files

format project.py

parent 9b290af9
No related branches found
No related tags found
No related merge requests found
import os import os
import sys import sys
# import ipdb
# import ipdb
from sipbuild import Option, Project
from sipbuild import Option, Project
class FBXSDKPyProject(Project):
class FBXSDKPyProject(Project): """A project that adds an additional configuration options to specify
""" A project that adds an additional configuration options to specify the locations of the fib header file and library.
the locations of the fib header file and library. """
"""
def get_options(self):
def get_options(self): """Return the sequence of configurable options."""
""" Return the sequence of configurable options. """
# Get the standard options.
# Get the standard options. options = super().get_options()
options = super().get_options()
# Add our new options.
# Add our new options. win_libs_option = Option(
win_libs_option = Option('win_libraries', "win_libraries",
help="a list of libraries needed on the windows platform for Python >=3.7", option_type=list, metavar="LIST") help="a list of libraries needed on the windows platform for Python >=3.7",
options.append(win_libs_option) option_type=list,
metavar="LIST",
win_py36_libs_option = Option('win_py36_libraries', )
help="a list of libraries needed on the windows platform for Python <=3.6", option_type=list, metavar="LIST") options.append(win_libs_option)
options.append(win_py36_libs_option)
win_py36_libs_option = Option(
linux_libs_option = Option('linux_libraries', "win_py36_libraries",
help="a list of libraries needed on the linuxdows platform", option_type=list, metavar="LIST") help="a list of libraries needed on the windows platform for Python <=3.6",
options.append(linux_libs_option) option_type=list,
metavar="LIST",
linux_static_libs_option = Option('linux_static_libraries', )
help="a list of libraries needed on the linuxdows platform", option_type=list, metavar="LIST") options.append(win_py36_libs_option)
options.append(linux_static_libs_option)
linux_libs_option = Option(
return options "linux_libraries",
help="a list of libraries needed on the linux platform",
def update(self, tool): option_type=list,
""" Update the project configuration. """ metavar="LIST",
)
# Get the fib bindings object. options.append(linux_libs_option)
fbx_bindings = self.bindings['fbx_module']
linux_static_libs_option = Option(
libraries = [] "linux_static_libraries",
if sys.platform == "win32": help="a list of libraries needed on the linux platform",
if sys.version_info.major == 3 and sys.version_info.minor < 7: option_type=list,
libraries = self.win_py36_libraries metavar="LIST",
else: )
libraries = self.win_libraries options.append(linux_static_libs_option)
elif sys.platform == "linux":
libraries = self.linux_libraries return options
else:
raise Exception("Your platform "+sys.platform+" is not supported") def update(self, tool):
"""Update the project configuration."""
fbx_bindings.libraries.extend(libraries)
# Get the fib bindings object.
def setup(self, pyproject, tool, tool_description): fbx_bindings = self.bindings["fbx_module"]
self.verbose = True
# don't download Autodesk's stuff when making sdist libraries = []
if tool != "sdist": if sys.platform == "win32":
if sys.platform == "win32": if sys.version_info.major == 3 and sys.version_info.minor < 7:
super().run_command(["call pull_reqs.bat"],fatal=True) libraries = self.win_py36_libraries
elif sys.platform == "linux": else:
super().run_command(["./pull_reqs.sh"],fatal=True) libraries = self.win_libraries
else: elif sys.platform == "linux":
raise Exception("Your platform "+sys.platform+" is not supported") libraries = self.linux_libraries
super().setup(pyproject, tool, tool_description) else:
raise Exception(
"Your platform " + sys.platform + " is not supported"
)
fbx_bindings.libraries.extend(libraries)
def setup(self, pyproject, tool, tool_description):
self.verbose = True
# don't download Autodesk's stuff when making sdist
if tool != "sdist":
if sys.platform == "win32":
super().run_command(["call pull_reqs.bat"], fatal=True)
elif sys.platform == "linux":
super().run_command(["./pull_reqs.sh"], fatal=True)
else:
raise Exception(
"Your platform " + sys.platform + " is not supported"
)
super().setup(pyproject, tool, tool_description)
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