This repository was archived by the owner on Dec 27, 2022. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsetup.py
79 lines (64 loc) · 2.32 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
# setup.py
from glob import glob
import setuptools
import subprocess
app_id = "com.gkayaalp.pomodorino"
with open("Readme.markdown", "r") as f:
long_description = f.read()
def compile_translations():
ret = subprocess.run(["bash", "scripts/compile-translations.bash"])
ret.check_returncode() # raises if nonzero
def compile_docs():
ret = subprocess.run(["bash", "scripts/compile-docs.bash"])
ret.check_returncode() # raises if nonzero
def collect_data_files():
f1 = "share/icons/hicolor/{n}x{n}/apps"
f2 = "assets/icons/hicolor/{n}x{n}/apps/{i}.png"
sizes = [8, 16, 22, 24, 32, 48, 64, 96, 128, 256]
icons = [(f1.format(n=n), [f2.format(n=n, i=app_id)])
for n in sizes]
gsettings_schema = "data/{i}.gschema.xml".format(i=app_id)
compile_translations()
compile_docs()
langs = [*map(lambda s: s.split('/')[-1], glob("data/gettext/*"))]
f3 = "share/locale/{lang}/LC_MESSAGES/"
f4 = "data/gettext/{lang}/LC_MESSAGES/{app_id}.mo"
translations = [(f3.format(lang=l), [f4.format(lang=l, app_id=app_id)])
for l in langs]
return [
*icons,
*translations,
("share/man/man1", ["doc/pomodorino.1"]),
("share/glib-2.0/schemas/", [gsettings_schema]),
("share/applications/", ["assets/pomodorino.desktop"]),
]
setuptools.setup(
name="pomodorino",
version="0.2.0a1",
author="Göktuğ Kayaalp",
author_email="[email protected]",
description="Simple GTK+ Pomodoro(TM) applet",
long_description=long_description,
long_description_content_type="text/markdown",
url="https://gkayaalp.com/pomodorino.html",
project_urls={
"Bug Tracker": "https://github.com/cadadr/pomodorino/issues"
},
classifiers=[
"Development Status :: 3 - Alpha",
"Environment :: X11 Applications :: Gnome",
"Intended Audience :: End Users/Desktop",
"License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)",
"Topic :: Office/Business :: Scheduling",
"Topic :: Utilities",
],
package_dir={'': 'src'},
packages=setuptools.find_packages("src"),
python_requires=">=3.5",
data_files=collect_data_files(),
entry_points={
"console_scripts": [
"pomodorino=pomodorino:app.main",
],
},
)