Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 892e81c6 authored by hhakim's avatar hhakim
Browse files

Add gitlab ci jobs for windows pip-wheel pkg generation and a custom setup.py.

The setup.py is more complicated now because we need a separate windows code.
Indeed, windows wrapper dynamic libs are pre-compiled externally without setup-tools so we simply include them as data.
(I haven't been able to compile the py. wrapper through visual studio so far and setup.py forces to use it, even with --compiler option it told me it's not able to compile with g++ compiler).

Related issue: #73
parent 4cf17b83
Branches
Tags
No related merge requests found
......@@ -283,4 +283,44 @@ package_linux_purepy_release:
tags:
- linux
########### pip binary packages for windows
.package_win_purepy: &package_win_purepy
script:
- if NOT EXIST build (mkdir build) else rmdir /S /Q build
- cd build
- 'cmake -G "MinGW Makefiles" -DBUILD_WRAPPER_MATLAB=OFF -DBUILD_WRAPPER_PYTHON=ON -DSLOW_TESTS=OFF -DCPACK_PACKAGE_VERSION=%VERSION% -DBUILD_DOCUMENTATION=ON -DEXCLUDE_FAUST_LIB_INSTALL=ON -DCMAKE_INSTALL_PREFIX=win_pkg_build -DBUILD_TESTING=OFF ..'
- make
- cd wrapper/python
- 'start %PYTHON2_PATH% setup.py bdist_wheel'
- 'start %PYTHON2_PATH% setup.py bdist_egg'
- 'start %PYTHON3_PATH% setup.py bdist_wheel'
- 'start %PYTHON3_PATH% setup.py bdist_egg'
artifacts:
paths:
- build/wrapper/python/dist
tags:
- win7
except:
- schedules
package_win_purepy_rev:
extends: .package_win_purepy
stage: package_rev
before_script:
- 'set VERSION=%CI_COMMIT_SHA:~0,8%'
artifacts:
expire_in: '1 week'
except:
- schedules
- tags
package_win_purepy_release:
extends: .package_win_purepy
before_script:
- 'set VERSION=$CI_COMMIT_TAG'
artifacts:
expire_in: '50 yrs'
only:
- tags
......@@ -42,29 +42,66 @@ from setuptools import setup, Extension
#from distutils.core import setup, Extension
from Cython.Build import cythonize
import numpy
import sys
PyFaust = Extension('FaustCorePy',
sources = ['@FAUST_PYTHON_BIN_DIR@/FaustCorePy.pyx'],
language = 'c++',
include_dirs=[@FAUST_PYTHON_INCLUDE_DIR@, numpy.get_include()],
library_dirs=[@FAUST_PYTHON_LIB_DIR@],
libraries=['faust'@FAUST_PYTHON_LIBS@],
extra_compile_args = [ "-std=c++11"],
extra_objects = @PYTHON_EXT_EXTRA_OBJECTS@
)
if sys.platform == 'win32':
# binary libs are compiled manually from cython and then integrated in
# wheel/egg pkgs here
from setuptools.dist import Distribution
from glob import glob
from shutil import copyfile
from os import sep
class BinaryDistribution(Distribution):
"""Distribution which always forces a binary package with platform
name"""
def has_ext_modules(foo):
return True
if sys.version_info > (3,0):
lib = glob('FaustCorePy.cp3*-win_amd64.pyd')[0]
else:
lib = 'FaustCorePy.pyd'
# we need to copy the dyn. lib in pyfaust pkg
copyfile(lib, 'pyfaust'+sep+lib)
setup(
name = 'pyfaust',
version = '@CPACK_PACKAGE_VERSION@',
#ext_modules = cythonize(PyFaust),
distclass = BinaryDistribution, # forces setup-tools to set the arch in
# pkg name
packages = [ 'pyfaust' ],
url = 'http://faust.inria.fr',
description = 'TODO',
long_description = 'TODO',
classifiers = [ 'TODO' ],
install_requires = [ 'scipy', 'numpy', 'matplotlib' ], #ENOTE: order matters (last pkg installed first)
#TODO: license
package_data = {
'pyfaust': ['data/*.mat', lib ]
}
)
else: # linux and mac
PyFaust = Extension('FaustCorePy',
sources = ['@FAUST_PYTHON_BIN_DIR@/FaustCorePy.pyx'],
language = 'c++',
include_dirs=[@FAUST_PYTHON_INCLUDE_DIR@, numpy.get_include()],
library_dirs=[@FAUST_PYTHON_LIB_DIR@],
libraries=['faust'@FAUST_PYTHON_LIBS@],
extra_compile_args = [ "-std=c++11"],
extra_objects = @PYTHON_EXT_EXTRA_OBJECTS@
)
setup(
name = 'pyfaust',
version = '@CPACK_PACKAGE_VERSION@',
ext_modules = cythonize(PyFaust),
packages = [ 'pyfaust' ],
url = 'http://faust.inria.fr',
description = 'TODO',
long_description = 'TODO',
classifiers = [ 'TODO' ],
install_requires = [ 'scipy', 'numpy', 'matplotlib' ], #ENOTE: order matters (last pkg installed first)
#TODO: license
package_data = {
'pyfaust': ['data/*.mat']
}
)
setup(
name = 'pyfaust',
version = '@CPACK_PACKAGE_VERSION@',
ext_modules = cythonize(PyFaust),
packages = [ 'pyfaust' ],
url = 'http://faust.inria.fr',
description = 'TODO',
long_description = 'TODO',
classifiers = [ 'TODO' ],
install_requires = [ 'scipy', 'numpy', 'matplotlib' ], #ENOTE: order matters (last pkg installed first)
#TODO: license
package_data = {
'pyfaust': ['data/*.mat']
}
)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment