forked from cztomczak/cefpython
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.py.template
More file actions
79 lines (74 loc) · 2.33 KB
/
setup.py.template
File metadata and controls
79 lines (74 loc) · 2.33 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
from setuptools import setup
from setuptools.command.install import install as _install
from setuptools.dist import Distribution
try:
# Wheel platform tag gets complicated on Mac, see:
# http://lepture.com/en/2014/python-on-a-hard-wheel
from wheel.bdist_wheel import bdist_wheel
class _bdist_wheel(bdist_wheel):
def get_tag(self):
tag = bdist_wheel.get_tag(self)
platform = ("macosx_10_6_intel"
".macosx_10_9_intel.macosx_10_9_x86_64"
".macosx_10_10_intel.macosx_10_10_x86_64")
tag = (tag[0], tag[1], platform)
return tag
cmdclass = {"bdist_wheel": _bdist_wheel}
except ImportError:
cmdclass = {}
import sys
import os
import subprocess
class BinaryDistribution(Distribution):
def is_pure(self):
return False
def get_package_data(directory, base_dir=""):
""" Lists directory recursively. Includes only files. Empty
directories are not included. File paths include the directory
path passed to this function. """
if base_dir:
old_dir = os.getcwd()
os.chdir(base_dir)
files = os.listdir(directory)
ret = []
for f in files:
f = os.path.join(directory, f)
if os.path.isdir(f):
ret = ret + get_package_data(f)
else:
ret.append(f)
if base_dir:
os.chdir(old_dir)
return ret
setup(
distclass=BinaryDistribution,
cmdclass=cmdclass,
name='cefpython3', # No spaces here, so that it works with deb packages.
version='%(APP_VERSION)s',
description='Python bindings for the Chromium Embedded Framework',
license='BSD 3-Clause',
author='Czarek Tomczak',
author_email='[email protected]',
url='http://code.google.com/p/cefpython/',
platforms=['%(PLATFORM)s'],
packages=['cefpython3', 'cefpython3.wx'],
package_data={'cefpython3': [
'examples/*.py',
'examples/*.html',
'examples/*.js',
'examples/*.css',
'examples/wx/*.py',
'examples/wx/*.html',
'examples/wx/*.png',
'wx/*.txt',
'wx/images/*.png',
'*.txt',
'subprocess',
'*.so',
'*.dylib',
'debug.log',
'examples/debug.log',
'examples/wx/debug.log',]
+ get_package_data("Resources/", "cefpython3/")
}
)