Files
ops-eac_logchecker.py/setup.py
itismadness 5759035277 pin pprp to 0.2.6
pprp 0.2.7 was a breaking change in that it refactored the package
structure. While the new structure is an improvement, it also made
nose and coverage runtime dependencies and so we stay on 0.2.6 for
now until a new version comes out that fixes that.
2020-09-20 23:29:12 +01:00

104 lines
2.6 KiB
Python

#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Note: To use the 'upload' functionality of this file, you must:
# $ pip install twine
import io
import os
import sys
from shutil import rmtree
from setuptools import setup, Command
# Package meta-data.
NAME = 'eac_logchecker'
DESCRIPTION = 'Logchecker for logs generated by EAC'
URL = 'https://github.com/OPSnet/eac_logchecker.py'
EMAIL = 'noreply@mail.orpheus.network'
AUTHOR = 'OPS'
REQUIRES_PYTHON = '>=3.5.0'
VERSION = '0.8.0'
here = os.path.abspath(os.path.dirname(__file__))
# Import the README and use it as the long-description.
# Note: this will only work if 'README.md' is present in your MANIFEST.in file!
try:
with io.open(os.path.join(here, 'README.md'), encoding='utf-8') as f:
long_description = '\n' + f.read()
except FileNotFoundError:
long_description = DESCRIPTION
class UploadCommand(Command):
"""Support setup.py upload."""
description = 'Build and publish the package.'
user_options = []
@staticmethod
def status(s):
"""Prints things in bold."""
print('\033[1m{0}\033[0m'.format(s))
def initialize_options(self):
pass
def finalize_options(self):
pass
def run(self):
try:
self.status('Removing previous builds…')
rmtree(os.path.join(here, 'dist'))
except OSError:
pass
self.status('Building Source and Wheel (universal) distribution…')
os.system(
'{0} setup.py sdist bdist_wheel --universal'.format(sys.executable)
)
self.status('Uploading the package to PyPI via Twine…')
os.system('twine upload dist/*')
sys.exit()
# Where the magic happens:
setup(
name=NAME,
version=VERSION,
description=DESCRIPTION,
long_description=long_description,
long_description_content_type='text/markdown',
author=AUTHOR,
author_email=EMAIL,
python_requires=REQUIRES_PYTHON,
url=URL,
py_modules=['eac_logchecker'],
entry_points={
'console_scripts': [
'eac_logchecker = eac_logchecker:main'
]
},
install_requires=['pprp==0.2.6'],
setup_requires=['pytest-runner'],
tests_require=['pytest'],
license='MIT',
classifiers=[
'Development Status :: 4 - Beta',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7'
],
# $ setup.py publish support.
cmdclass={
'upload': UploadCommand,
},
)