forked from tlecomte/friture
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.py
More file actions
99 lines (92 loc) · 3.76 KB
/
Copy pathsetup.py
File metadata and controls
99 lines (92 loc) · 3.76 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
# -*- coding: utf-8 -*-
from distutils.core import setup
from distutils.extension import Extension
from Cython.Distutils import build_ext
from glob import glob
import os
from os.path import join, dirname # for README content reading
import numpy
import friture # for the version number
py2exe_build = True
try:
import py2exe
except ImportError:
print "Cannot find py2exe"
py2exe_build = False
# see INSTALL file for details
# to create a source package
# python setup.py sdist --formats=gztar,zip
# to register a new release on PyPI
# python setup.py register
# to upload the source files to PyPI after registering
# Warning: the folder should be clean !
# python setup.py sdist --formats=gztar,zip upload
# to create a bundled windows executable
# python setup.py py2exe
data_files = []
excludes = []
dll_excludes = []
includes = []
if py2exe_build:
#include the QT svg plugin to render the icons
#include the filter coefficients in the pickle file
data_files += [("imageformats", glob(r'C:\Python*\Lib\site-packages\PyQt4\plugins\imageformats\qsvg4.dll'))]
#exclude some python libraries that py2exe includes by error
excludes += ["matplotlib","_ssl","Tkconstants","Tkinter","tcl","email","pyreadline","nose",\
"doctest", "pdb", "pydoc", "_hashlib", "bz2","httplib","cookielib","cookielib","urllib","urllib2","Image",\
"pywin","optparse","zipfile","calendar","compiler",\
"_imaging","_ssl"]
#Note: unittest, inspect are needed by numpy
#exclude dlls that py2exe includes by error
dll_excludes += ["powrprof.dll", "msvcp90.dll", "winnsi.dll", "nsi.dll", "iphlpapi.dll",
"API-MS-Win-Core*.dll"]
#manually include python libraries that py2exe fails to detect
# for pyOpenGL : http://www.jstump.com/blog/archive/2009/06/30/py2exe-and-pyopengl-3x-with-no-manual-tinkering/
# + OpenGL_accelerate.formathandler that is imported by the Python/C
# API so that py2exe does not detect it
includes += ["sip", "PyQt4.QtSvg", "PyQt4.QtXml",
"OpenGL.platform.win32",
"OpenGL.arrays.ctypesarrays",
"OpenGL.arrays.numpymodule",
"OpenGL.arrays.lists",
"OpenGL.arrays.numbers",
"OpenGL.arrays.strings",
"OpenGL_accelerate.formathandler"
]
if os.name == 'nt':
if os.environ.has_key('CPATH'):
os.environ['CPATH'] = os.environ['CPATH'] + numpy.get_include()
else:
os.environ['CPATH'] = numpy.get_include()
ext_modules = [Extension("friture.exp_smoothing_conv", ["friture/extension/exp_smoothing_conv.pyx"],
include_dirs = [numpy.get_include()])]
setup(name = "friture",
version = friture.__version__,
description = 'Real-time visualization of live audio data',
long_description = open(join(dirname(__file__), 'README.rst')).read(),
license = "GNU GENERAL PUBLIC LICENSE",
author = 'Timothée Lecomte',
author_email = 'lecomte.timothee@gmail.com',
url='http://tlecomte.github.com/friture/',
keywords = ["audio", "spectrum", "spectrogram"],
classifiers = [
"Programming Language :: Python",
"Programming Language :: Cython",
"Development Status :: 4 - Beta",
"Environment :: MacOS X",
"Environment :: Win32 (MS Windows)",
"Environment :: X11 Applications :: Qt",
"Intended Audience :: End Users/Desktop",
"License :: OSI Approved :: GNU General Public License (GPL)",
"Operating System :: OS Independent",
"Topic :: Multimedia :: Sound/Audio :: Analysis",
"Topic :: Multimedia :: Sound/Audio :: Speech"
],
packages = ['friture'],
scripts = ['scripts/friture'],
windows = [{"script":'friture.py', "icon_resources":[(1, "resources/images/friture.ico")]}],
options = {"py2exe":{"includes":includes, "excludes":excludes, "dll_excludes":dll_excludes}},
data_files = data_files,
cmdclass = {"build_ext": build_ext},
ext_modules = ext_modules,
)