From 2ba0c8ef6afc61d5556c02cfd95a59ded2440ac2 Mon Sep 17 00:00:00 2001 From: Jochen Kupperschmidt Date: Wed, 3 Mar 2021 19:12:41 +0100 Subject: [PATCH] Move package configuration to `setup.cfg` --- .travis.yml | 1 + pyproject.toml | 7 +++++++ setup.cfg | 37 +++++++++++++++++++++++++++++++++++++ setup.py | 39 +++------------------------------------ src/syslogmp/__init__.py | 3 +++ 5 files changed, 51 insertions(+), 36 deletions(-) create mode 100644 setup.cfg diff --git a/.travis.yml b/.travis.yml index 5387726..c3a9c47 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,5 +6,6 @@ python: - "3.9" install: - "pip install -r requirements-test.txt" + - "pip install -e ." script: - "pytest" diff --git a/pyproject.toml b/pyproject.toml index 89c6835..63e6503 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,2 +1,9 @@ +[build-system] +requires = [ + "setuptools >= 51.1.2", + "wheel", +] +build-backend = "setuptools.build_meta" + [tool.pytest.ini_options] testpaths = ["tests"] diff --git a/setup.cfg b/setup.cfg new file mode 100644 index 0000000..1f9c06b --- /dev/null +++ b/setup.cfg @@ -0,0 +1,37 @@ +[metadata] +name = syslogmp +version = attr: syslogmp.VERSION +url = https://homework.nwsnet.de/releases/76d6/#syslogmp +author = Jochen Kupperschmidt +author_email = homework@nwsnet.de +classifiers = + Intended Audience :: Developers + Intended Audience :: System Administrators + License :: OSI Approved :: MIT License + Operating System :: OS Independent + Programming Language :: Python + Programming Language :: Python :: 3 + Programming Language :: Python :: 3.6 + Programming Language :: Python :: 3.7 + Programming Language :: Python :: 3.8 + Programming Language :: Python :: 3.9 + Topic :: Communications + Topic :: Internet + Topic :: System :: Logging + Topic :: System :: Networking :: Monitoring + Topic :: System :: Systems Administration +license = MIT +license_file = LICENSE +description = A parser for BSD syslog protocol (RFC 3164) messages +long_description = file: README.rst, CHANGES.rst +keywords = irc, webhook +platforms = any + +[options] +zip_safe = True +python_requires = >=3.6 +packages = find: +package_dir = =src + +[options.packages.find] +where = src diff --git a/setup.py b/setup.py index 01d1e6f..016df3b 100644 --- a/setup.py +++ b/setup.py @@ -1,38 +1,5 @@ -import codecs +import setuptools -from setuptools import setup - -with codecs.open('README.rst', encoding='utf-8') as f: - long_description = f.read() - - -setup( - name='syslogmp', - version='0.3-dev', - description='A parser for BSD syslog protocol (RFC 3164) messages', - long_description=long_description, - url='http://homework.nwsnet.de/releases/76d6/#syslogmp', - author='Jochen Kupperschmidt', - author_email='homework@nwsnet.de', - license='MIT', - classifiers=[ - 'Intended Audience :: Developers', - 'Intended Audience :: System Administrators', - 'License :: OSI Approved :: MIT License', - 'Operating System :: OS Independent', - 'Programming Language :: Python', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.6', - 'Programming Language :: Python :: 3.7', - 'Programming Language :: Python :: 3.8', - 'Programming Language :: Python :: 3.9', - 'Topic :: Communications', - 'Topic :: Internet', - 'Topic :: System :: Logging', - 'Topic :: System :: Networking :: Monitoring', - 'Topic :: System :: Systems Administration', - ], - package_dir={'': 'src'}, - packages=['syslogmp'], -) +if __name__ == '__main__': + setuptools.setup() diff --git a/src/syslogmp/__init__.py b/src/syslogmp/__init__.py index 4d71be3..8936496 100644 --- a/src/syslogmp/__init__.py +++ b/src/syslogmp/__init__.py @@ -12,6 +12,9 @@ from .parser import Parser from .severity import Severity +VERSION = '0.3-dev' + + def parse(data): """Parse data and return syslog message.""" return Parser.parse(data) -- 2.45.2