mirror of https://github.com/AlfredoSequeida/fvid
Update setup.py
This commit is contained in:
parent
af49aa187b
commit
94c0b47366
22
setup.py
22
setup.py
|
@ -13,12 +13,15 @@ else:
|
||||||
use_cython = True
|
use_cython = True
|
||||||
ext = 'pyx'
|
ext = 'pyx'
|
||||||
|
|
||||||
if not use_cython:
|
try:
|
||||||
extensions = [Extension("fvid.fvid_cython", ["fvid/fvid_cython.c"], include_dirs=["./fvid", "fvid/"])]
|
if not use_cython:
|
||||||
else:
|
extensions = [Extension("fvid.fvid_cython", ["fvid/fvid_cython.c"], include_dirs=["./fvid", "fvid/"])]
|
||||||
extensions = [Extension("fvid.fvid_cython", ["fvid/fvid_cython.pyx"], include_dirs=["./fvid", "fvid/"])]
|
else:
|
||||||
extensions = cythonize(extensions, compiler_directives={'language_level': "3", 'infer_types': True})
|
extensions = [Extension("fvid.fvid_cython", ["fvid/fvid_cython.pyx"], include_dirs=["./fvid", "fvid/"])]
|
||||||
|
extensions = cythonize(extensions, compiler_directives={'language_level': "3", 'infer_types': True})
|
||||||
|
build_worked = True
|
||||||
|
except: # blanket exception until the exact exception name is found
|
||||||
|
build_worked = False
|
||||||
|
|
||||||
class build_ext(_build_ext):
|
class build_ext(_build_ext):
|
||||||
def finalize_options(self):
|
def finalize_options(self):
|
||||||
|
@ -45,7 +48,8 @@ def get_version(rel_path):
|
||||||
|
|
||||||
dynamic_version = get_version("fvid/__init__.py")
|
dynamic_version = get_version("fvid/__init__.py")
|
||||||
|
|
||||||
setup(
|
|
||||||
|
setup(setup_tuple = (
|
||||||
name="fvid",
|
name="fvid",
|
||||||
version=dynamic_version,
|
version=dynamic_version,
|
||||||
author="Alfredo Sequeida",
|
author="Alfredo Sequeida",
|
||||||
|
@ -83,8 +87,8 @@ setup(
|
||||||
],
|
],
|
||||||
python_requires=">=3.6",
|
python_requires=">=3.6",
|
||||||
entry_points={"console_scripts": ["fvid = fvid.fvid:main"]},
|
entry_points={"console_scripts": ["fvid = fvid.fvid:main"]},
|
||||||
ext_modules=extensions,
|
ext_modules=extensions if build_worked else [],
|
||||||
cmdclass={'build_ext': build_ext},
|
cmdclass={'build_ext': build_ext},
|
||||||
include_package_data=True,
|
include_package_data=True,
|
||||||
zip_safe=False,
|
zip_safe=False,
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in New Issue