-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.py
More file actions
75 lines (67 loc) · 2.46 KB
/
Copy pathsetup.py
File metadata and controls
75 lines (67 loc) · 2.46 KB
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
# -*- coding: utf-8 -*-
import os.path
from setuptools import setup
import shutil
from pathlib import Path
import traceback
# try:
# from . __version__ import version
# except:
# from __version__ import version
NAME = "gntplib"
def get_version():
"""
Get the version of the ddf module.
Version is taken from the __version__.py file if it exists.
The content of __version__.py should be:
version = "0.33"
"""
try:
version_file = Path(__file__).parent / "__version__.py"
if not version_file.is_file():
version_file = Path(__file__).parent / NAME / "__version__.py"
if version_file.is_file():
with open(version_file, "r") as f:
for line in f:
if line.strip().startswith("version"):
parts = line.split("=")
if len(parts) == 2:
return parts[1].strip().strip('"').strip("'")
except Exception as e:
if os.getenv('TRACEBACK') and os.getenv('TRACEBACK') in ['1', 'true', 'True']:
print(traceback.format_exc())
else:
print(f"ERROR: {e}")
return "3.0.0"
try:
shutil.copy2("__version__.py", "gntplib/__version__.py")
except IOError:
pass
except Exception as e:
print("Unexpected error:", e)
here = os.path.dirname(os.path.abspath(__file__))
setup(name='gntplib',
version=get_version(),
description=('A Growl Notification Transport Protocol (GNTP), client library for Python 3.'),
long_description=open(os.path.join(here, 'README.md')).read(),
long_description_content_type="text/markdown",
author='Hadi Cahyadi',
author_email='cumulus13@gmail.com',
maintainer='cumulus13',
maintainer_email='cumulus13@gmail.com',
url='http://github.com/cumulus13/gntplib',
packages=['gntplib'],
extras_require={'extra': ['tornado'], 'async': ['tornado'], 'ciphers': ['pycryptodome'], 'all': ['tornado', 'pycryptodome']},
keywords='gntp growl async notification advanced',
classifiers=[
'Development Status :: 3 - Alpha',
'Intended Audience :: Developers',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Programming Language :: Python :: 3',
'Topic :: Software Development :: Libraries :: Python Modules',
],
platforms='any',
license='MIT',
license_files=['LICENSE']
)