-
Notifications
You must be signed in to change notification settings - Fork 20
/
Copy pathsetup.py
52 lines (40 loc) · 1.49 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
#!/bin/env python
import os
from setuptools import find_packages, setup
def find_xdg_data_files(from_dir, to_dir, package_name, data_files):
for root, _, files in os.walk(from_dir):
if files:
to_dir = to_dir.format(pkgname=package_name)
sub_path = root.split(from_dir)[1]
if sub_path.startswith("/"):
sub_path = sub_path[1:]
files = [os.path.join(root, file) for file in files]
data_files.append((os.path.join(to_dir, sub_path), files))
def find_data_files(data_map, package_name):
data_files = []
for from_dir, to_dir in data_map:
find_xdg_data_files(from_dir, to_dir, package_name, data_files)
return data_files
DATA_FILES = [
("data/icons", "share/icons"),
("data/applications", "share/applications"),
("data/plugins", "share/{pkgname}/plugins"),
("data/media", "share/{pkgname}/media"),
]
setup(
author="Elio Esteves Duarte",
author_email="[email protected]",
description="A pomodoro timer",
include_package_data=True,
keywords="pomodoro,tomate",
license="GPL-3",
long_description=open("README.md", "r", encoding="utf-8").read(),
name="tomate-gtk",
packages=find_packages(exclude=["tests"]),
py_modules=[],
data_files=find_data_files(DATA_FILES, "tomate"),
url="https://github.com/eliostvs/tomate-gtk",
version="0.25.2",
zip_safe=False,
entry_points={"console_scripts": ["tomate-gtk=tomate.__main__:main"]},
)