Skip to content

Commit

Permalink
Changes for python wheel build
Browse files Browse the repository at this point in the history
  • Loading branch information
lukacu committed Apr 17, 2024
1 parent 903db7e commit 9337344
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions support/python/setup.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
#!/usr/bin/env python

import os, sys, glob
from distutils.core import setup, Extension

from setuptools import setup, Extension

#from distutils.core import setup, Extension
from distutils.command.build_ext import build_ext

root = os.path.abspath(os.path.dirname(__file__))
Expand Down Expand Up @@ -53,6 +56,7 @@ def get_tag(self):
return python, abi, plat

except ImportError:
print("Warning: wheel package not found, bdist_wheel command will not be available")
bdist_wheel = None
try:
with open(os.path.join(root, "VERSION"), encoding='utf-8') as fp:
Expand All @@ -72,12 +76,13 @@ def get_tag(self):

if os.path.isfile(os.path.join("trax", library_prefix + "trax" + library_suffix)):
varargs["package_data"] = {"trax" : [library_prefix + "trax" + library_suffix]}
varargs["cmdclass"] = {'bdist_wheel': bdist_wheel}
varargs["cmdclass"] = {'bdist_wheel': bdist_wheel, 'build_ext': build_ext_ctypes}
varargs["setup_requires"] = ['wheel']
elif os.path.isfile(os.path.join("trax", "trax.c")):
sources = glob.glob("trax/*.c") + glob.glob("trax/*.cpp")
varargs["ext_modules"] = [CTypes("trax.trax", sources=sources, define_macros=[("trax_EXPORTS", "1")])]
varargs["cmdclass"] = {'build_ext': build_ext_ctypes}
varargs["cmdclass"] = { 'build_ext': build_ext_ctypes, 'bdist_wheel': bdist_wheel}
varargs["setup_requires"] = ['wheel']

setup(name='vot-trax',
version=VERSION,
Expand Down

0 comments on commit 9337344

Please sign in to comment.