-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathsetup.py
107 lines (94 loc) · 2.96 KB
/
setup.py
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
100
101
102
103
104
105
106
107
#!/usr/bin/env python
# -*- coding: utf-8 -*-
##############################################################################
#
# ZopeEdit, client for ExternalEditor
#
##############################################################################
from setuptools import find_packages
from setuptools import setup
import glob
import os
import sys
opj = os.path.join
def get_version():
with open(os.path.join('collective', 'zopeedit', 'zopeedit.py')) as f:
for line in f:
if line.startswith('__version__'):
return eval(line.split('=')[-1])
install_requires = ["setuptools"]
if sys.platform == "darwin":
install_requires.extend(
[
"pyobjc-core",
"pyobjc-framework-LaunchServices",
]
)
packages = find_packages(exclude=["ez_setup"])
def data_files():
"""Build list of data files to be installed"""
files = []
files.append(
(opj("share", "man", "man1", ""), ["collective/zopeedit/man/zopeedit.1"])
)
files.append(
(
opj("share", "mime", "application"),
["collective/zopeedit/posix/x-zope-edit-zem.xml"],
)
)
files.append(
(opj("share", "applications"), ["collective/zopeedit/posix/zopeedit.desktop"])
)
files.append((opj("share", "icons"), ["collective/zopeedit/posix/zopeedit.svg"]))
files.append(
(
opj("collective", "zopeedit", "docs"),
[f for f in glob.glob("docs/*") if os.path.isfile(f)],
)
)
files.append((opj("collective", "zopeedit", "docs"), ["README.txt"]))
return files
setup(
name="collective.zopeedit",
app=[os.path.join("collective", "zopeedit", "zopeedit.py")],
version=get_version(),
description="ZopeEdit : External Editor Client",
long_description=open("README.txt").read()
+ "\n"
+ open(os.path.join("docs", "HISTORY.txt")).read(),
# Get more strings from
# http://pypi.python.org/pypi?%3Aaction=list_classifiers
classifiers=[
"Programming Language :: Python",
"Development Status :: 5 - Production/Stable",
"License :: OSI Approved :: Zope Public License",
],
keywords="zope plone externaleditor zopeedit edition",
author="Thierry Benita - atReal",
author_email="[email protected]",
url="https://github.com/collective/collective.zopeedit/",
license="ZPL",
packages=packages,
namespace_packages=["collective"],
include_package_data=True,
zip_safe=False,
install_requires=install_requires,
entry_points={
"console_scripts": [
"zopeedit = collective.zopeedit.zopeedit:main",
]
},
data_files=data_files(),
windows=[
{
"script": os.path.join("collective", "zopeedit", "zopeedit.py"),
"icon_resources": [
(1, os.path.join("collective", "zopeedit", "win32", "zopeedit.ico"))
],
}
],
options={
"py2app": {"argv_emulation": True},
},
)