forked from PyLink/PyLink
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
113 lines (88 loc) · 3.43 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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
"""Setup module for PyLink IRC Services."""
import sys
if sys.version_info < (3, 4):
raise RuntimeError("PyLink requires Python 3.4 or higher.")
try:
from setuptools import setup, find_packages
except ImportError:
raise ImportError("Please install Setuptools and try again.")
from codecs import open
import subprocess
with open('VERSION', encoding='utf-8') as f:
version = f.read().strip()
# Try to fetch the current commit hash from Git.
try:
real_version = subprocess.check_output(['git', 'describe', '--tags']).decode('utf-8').strip()
except Exception as e:
print('WARNING: Failed to get Git version from "git describe --tags": %s: %s' % (type(e).__name__, e))
print("If you're installing from PyPI or a tarball, ignore the above message.")
real_version = version + '-nogit'
# Write the version to disk.
with open('__init__.py', 'w') as f:
f.write('# Automatically generated by setup.py\n')
f.write('__version__ = %r\n' % version)
f.write('real_version = %r\n' % real_version)
try:
if sys.version_info >= (3, 5):
with open('README.md') as f:
long_description = f.read()
else:
# Work around "TypeError: a bytes-like object is required, not 'str'" errors on Python 3.4
# when the README has Unicode characters (error in distutils.util.rfc822_escape)
import codecs
long_description = codecs.open('README.md', encoding='utf-8').read()
except OSError:
print('WARNING: Failed to read readme, skipping writing long_description')
long_description = None
setup(
name='pylinkirc',
version=version,
description='PyLink IRC Services',
long_description=long_description,
long_description_content_type='text/markdown',
url='https://github.com/jlu5/PyLink',
# Author details
author='James Lu',
author_email='[email protected]',
# License
license='MPL 2.0',
# See https://pypi.python.org/pypi?%3Aaction=list_classifiers
classifiers=[
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Developers',
'Intended Audience :: System Administrators',
'Topic :: Communications :: Chat :: Internet Relay Chat',
'Topic :: Software Development :: Libraries :: Python Modules',
'License :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0)',
'Environment :: Console',
'Operating System :: OS Independent',
'Operating System :: POSIX',
'Natural Language :: English',
'Programming Language :: Python :: 3 :: Only',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
],
keywords='IRC services relay',
install_requires=['pyyaml', 'ircmatch'],
extras_require={
'password-hashing': ['passlib'],
'cron-support': ['psutil'],
'servprotect': ['expiringdict>=1.1.4'],
},
dependency_links=[
"git+https://github.com/mailgun/[email protected]#egg=expiringdict-1.1.4"
],
# Folders (packages of code)
packages=['pylinkirc', 'pylinkirc.protocols', 'pylinkirc.plugins', 'pylinkirc.coremods'],
# Data files
package_data={
'': ['example-conf.yml', 'VERSION', 'README.md'],
},
package_dir = {'pylinkirc': '.'},
# Executable scripts
scripts=["pylink-mkpasswd"],
entry_points = {
'console_scripts': ['pylink=pylinkirc.launcher:main'],
}
)