2016-06-21 02:48:14 +02:00
|
|
|
"""Setup module for PyLink IRC Services."""
|
|
|
|
|
2016-07-29 19:12:56 +02:00
|
|
|
import sys
|
|
|
|
|
|
|
|
if sys.version_info < (3, 4):
|
|
|
|
raise RuntimeError("PyLink requires Python 3.4 or higher.")
|
|
|
|
|
2016-07-20 02:44:22 +02:00
|
|
|
try:
|
|
|
|
from setuptools import setup, find_packages
|
|
|
|
except ImportError:
|
|
|
|
raise ImportError("Please install Setuptools and try again.")
|
2016-06-21 02:48:14 +02:00
|
|
|
from codecs import open
|
2016-07-03 09:26:03 +02:00
|
|
|
import subprocess
|
2016-06-21 02:48:14 +02:00
|
|
|
|
2016-07-03 09:26:03 +02:00
|
|
|
# Get version from Git tags.
|
2016-07-24 07:43:54 +02:00
|
|
|
with open('VERSION', encoding='utf-8') as f:
|
|
|
|
version = f.read().strip()
|
|
|
|
|
2016-07-03 09:26:03 +02:00
|
|
|
try:
|
2016-07-24 07:43:54 +02:00
|
|
|
real_version = subprocess.check_output(['git', 'describe', '--tags']).decode('utf-8').strip()
|
2016-07-03 09:26:03 +02:00
|
|
|
except Exception as e:
|
2016-07-24 07:43:54 +02:00
|
|
|
print('ERROR: Failed to get Git version from "git describe --tags": %s: %s' % (type(e).__name__, e))
|
|
|
|
real_version = version + '-dirty'
|
2016-07-03 09:26:03 +02:00
|
|
|
|
2016-07-03 09:39:10 +02:00
|
|
|
# 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)
|
2016-07-24 07:43:54 +02:00
|
|
|
f.write('real_version = %r\n' % real_version)
|
2016-07-03 09:26:03 +02:00
|
|
|
|
2016-08-04 09:27:15 +02:00
|
|
|
# Convert Markdown to RST for PyPI
|
|
|
|
try:
|
|
|
|
import pypandoc
|
|
|
|
long_description = pypandoc.convert('README.md', 'rst')
|
|
|
|
except ImportError:
|
|
|
|
print('WARNING: PyPandoc not available; skipping writing long description.')
|
|
|
|
long_description = None
|
2016-06-21 02:48:14 +02:00
|
|
|
|
|
|
|
setup(
|
|
|
|
name='pylinkirc',
|
2016-07-03 09:26:03 +02:00
|
|
|
version=version,
|
2016-06-21 02:48:14 +02:00
|
|
|
|
|
|
|
description='PyLink IRC Services',
|
|
|
|
long_description=long_description,
|
|
|
|
|
|
|
|
url='https://github.com/GLolol/PyLink',
|
|
|
|
|
|
|
|
# Author details
|
|
|
|
author='James Lu',
|
|
|
|
author_email='GLolol@overdrivenetworks.com',
|
|
|
|
|
|
|
|
# Choose your license
|
|
|
|
license='MPL 2.0',
|
|
|
|
|
|
|
|
# See https://pypi.python.org/pypi?%3Aaction=list_classifiers
|
|
|
|
classifiers=[
|
2016-08-04 09:27:50 +02:00
|
|
|
'Development Status :: 4 - Beta',
|
2016-06-21 02:48:14 +02:00
|
|
|
|
|
|
|
'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)',
|
2016-08-04 09:27:50 +02:00
|
|
|
'Environment :: Console',
|
2016-06-21 02:48:14 +02:00
|
|
|
|
2016-08-04 09:27:50 +02:00
|
|
|
'Operating System :: OS Independent',
|
|
|
|
'Operating System :: POSIX',
|
|
|
|
|
|
|
|
'Natural Language :: English',
|
|
|
|
|
|
|
|
'Programming Language :: Python :: 3 :: Only',
|
2016-06-21 02:48:14 +02:00
|
|
|
'Programming Language :: Python :: 3.4',
|
|
|
|
'Programming Language :: Python :: 3.5',
|
|
|
|
],
|
|
|
|
|
2016-08-04 09:27:50 +02:00
|
|
|
keywords='IRC services relay',
|
2016-07-20 03:03:43 +02:00
|
|
|
install_requires=['pyyaml', 'ircmatch'],
|
2016-06-21 02:48:14 +02:00
|
|
|
|
|
|
|
# Folders (packages of code)
|
2016-06-21 20:25:47 +02:00
|
|
|
packages=['pylinkirc', 'pylinkirc.protocols', 'pylinkirc.plugins', 'pylinkirc.coremods'],
|
2016-06-21 02:48:14 +02:00
|
|
|
|
|
|
|
# Data files
|
|
|
|
package_data={
|
2016-09-03 02:45:01 +02:00
|
|
|
'': ['example-conf.yml', 'example-permissions.yml'],
|
2016-06-21 02:48:14 +02:00
|
|
|
},
|
|
|
|
|
2016-06-21 03:18:54 +02:00
|
|
|
package_dir = {'pylinkirc': '.'},
|
|
|
|
|
2016-06-21 02:48:14 +02:00
|
|
|
# Executable scripts
|
|
|
|
scripts=["pylink"],
|
|
|
|
)
|