Commit 02d41450 authored by Guillaume Seguin's avatar Guillaume Seguin

Attempt at improving setup.py for embedding Cython stuff

parent b8f549b6
...@@ -24,8 +24,10 @@ from distutils.command.install_data import install_data as _install_data ...@@ -24,8 +24,10 @@ from distutils.command.install_data import install_data as _install_data
try: try:
from Cython.Build import cythonize from Cython.Build import cythonize
extensions = cythonize("printrun/gcoder_line.pyx") extensions = cythonize("printrun/gcoder_line.pyx")
from Cython.Distutils import build_ext
except ImportError: except ImportError:
extensions = None extensions = None
build_ext = None
INSTALLED_FILES = "installed_files" INSTALLED_FILES = "installed_files"
...@@ -142,6 +144,12 @@ for extra_data_dir in extra_data_dirs: ...@@ -142,6 +144,12 @@ for extra_data_dir in extra_data_dirs:
destpath = os.path.join("share", "pronterface", basedir) destpath = os.path.join("share", "pronterface", basedir)
data_files.append ((destpath, files)) data_files.append ((destpath, files))
cmdclass = {"uninstall" : uninstall,
"install" : install,
"install_data" : install_data}
if build_ext:
cmdclass['build_ext'] = build_ext
setup ( setup (
name = "Printrun", name = "Printrun",
description = "Host software for 3D printers", description = "Host software for 3D printers",
...@@ -151,8 +159,6 @@ setup ( ...@@ -151,8 +159,6 @@ setup (
data_files = data_files, data_files = data_files,
packages = ["printrun", "printrun.cairosvg", "printrun.server", "printrun.gl", "printrun.gl.libtatlin"], packages = ["printrun", "printrun.cairosvg", "printrun.server", "printrun.gl", "printrun.gl.libtatlin"],
scripts = ["pronsole.py", "pronterface.py", "plater.py", "printcore.py", "prontserve.py"], scripts = ["pronsole.py", "pronterface.py", "plater.py", "printcore.py", "prontserve.py"],
cmdclass = {"uninstall" : uninstall, cmdclass = cmdclass,
"install" : install,
"install_data" : install_data},
ext_modules = extensions, ext_modules = extensions,
) )
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment