-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsetup.py
73 lines (62 loc) · 2.3 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
import os
from setuptools import setup
requires = (
'coloredlogs>=14.0',
'dash>=1.19.0',
'pandas>=1.0.3',
'parse>=1.19.0',
'plotly>=4.14.3',
'pydash>=4.8.0',
'pyee>=7.0.2',
'python-i18n>=0.3.9',
'pyyaml>=5.4',
'typeguard>=2.12.1',
'xdg==5.1.1',
)
this_directory = os.path.abspath(os.path.dirname(__file__))
# NOTE: solution from https://packaging.python.org/guides/single-sourcing-package-version/
def get_version(rel_path: str) -> str:
init_path = os.path.join(this_directory, rel_path)
with open(init_path, 'r') as f:
for line in f.read().splitlines():
if line.startswith('__version__'):
delim = '"' if '"' in line else "'"
return line.split(delim)[1]
raise RuntimeError(f'Unable to find version string in [{init_path}]!')
def get_long_description() -> str:
descr_path = os.path.join(this_directory, 'doc/pypi/long_description.md')
with open(descr_path, encoding='utf-8') as f:
return f.read()
setup(
name='speaking-eye',
version=get_version('src/speaking_eye/__init__.py'),
description="Track & analyze your computer activity. Focus on work and don't forget to take breaks",
long_description=get_long_description(),
long_description_content_type='text/markdown',
url='https://github.com/alena-bartosh/speaking-eye',
python_requires='>=3.6, <4',
install_requires=requires,
package_dir={'': 'src'},
packages=['speaking_eye'],
# NOTE: data_files will be copied into path with prefix ~/.local/ when installation without "sudo"
# It is expected behaviour
data_files=[
('share/icons/hicolor/scalable/apps', ['src/speaking_eye/desktop/speaking-eye.png']),
('share/applications', ['src/speaking_eye/desktop/speaking-eye.desktop']),
],
include_package_data=True,
entry_points={
'console_scripts': [
'speaking-eye = speaking_eye.__main__:main',
],
},
author='Alena Bartosh',
author_email='alena.mathematics@gmail.com',
keywords='worktracker timetracker gtk wnck dash',
classifiers=[
'Development Status :: 5 - Production/Stable',
'License :: OSI Approved :: MIT License',
'Operating System :: POSIX :: Linux',
'Programming Language :: Python :: 3',
],
)