-
-
Notifications
You must be signed in to change notification settings - Fork 63
/
setup.py
64 lines (56 loc) · 2.06 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
#!/usr/bin/env python
from __future__ import division, absolute_import, print_function
from setuptools import setup
import os
import re
import shutil
_versionRE = re.compile(r'__version__\s*=\s*\"([^\"]+)\"')
# read the version number for the settings file
with open('drawBot/drawBotSettings.py', "r") as settings:
code = settings.read()
found = _versionRE.search(code)
assert found is not None, "drawBot __version__ not found"
__version__ = found.group(1)
externalTools = ("ffmpeg", "gifsicle", "mkbitmap", "potrace")
externalToolsSourceRoot = os.path.join(os.path.dirname(__file__), "Resources", "externalTools")
externalToolsDestRoot = os.path.join(os.path.dirname(__file__), "drawBot", "context", "tools")
# copy all external tools into drawBot.context.tools folder
for externalTool in externalTools:
source = os.path.join(externalToolsSourceRoot, externalTool)
dest = os.path.join(externalToolsDestRoot, externalTool)
shutil.copyfile(source, dest)
os.chmod(dest, 0o775)
setup(name="drawBot",
version=__version__,
description="DrawBot is a powerful tool that invites you to write simple Python scripts to generate two-dimensional graphics. The builtin graphics primitives support rectangles, ovals, (bezier) paths, polygons, text objects and transparency.",
author="Just van Rossum, Erik van Blokland, Frederik Berlaen",
author_email="[email protected]",
url="http://drawbot.com",
license="BSD",
packages=[
"drawBot",
"drawBot.context",
"drawBot.context.tools",
"drawBot.ui"
],
package_data={
"drawBot": [
"context/tools/ffmpeg",
"context/tools/gifsicle",
"context/tools/mkbitmap",
"context/tools/potrace"
]
},
install_requires=[
"pyobjc",
"fontTools",
"booleanOperations",
"pillow",
"packaging",
],
include_package_data=True,
)
# remove all external tools
for externalTool in externalTools:
dest = os.path.join(externalToolsDestRoot, externalTool)
os.remove(dest)