From c71c88e376f6ef49030e85390e6539b84b2bc391 Mon Sep 17 00:00:00 2001 From: timka123 Date: Sun, 22 May 2022 11:56:52 +0300 Subject: [PATCH] add setup function and version to init file --- melisa/__init__.py | 2 ++ setup.py | 67 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 69 insertions(+) create mode 100644 setup.py diff --git a/melisa/__init__.py b/melisa/__init__.py index 36a7b0d..16b3b2f 100644 --- a/melisa/__init__.py +++ b/melisa/__init__.py @@ -10,3 +10,5 @@ __title__ = "Melisa" __description__ = "Cache-configurable module to interact with the Discord API." __author__ = "MelisaDev" __license__ = "MIT" +__version__ = '0.0.1a0' + diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..d29b1a9 --- /dev/null +++ b/setup.py @@ -0,0 +1,67 @@ +import re + +from setuptools import setup + +extras_require = { + 'speed': [ + 'orjson>=3.5.4' + ] +} + +requirements = [] + +with open('requirements.txt', encoding='utf-8') as file: + requirements = file.read().splitlines() + +with open('melisa/__init__.py', encoding='utf-8') as file: + version = re.search(r'^__version__\s*=\s*[\'"]([^\'"]*)[\'"]', file.read(), re.MULTILINE).group(1) + +if version is None: + raise RuntimeError('Version is not set!') + +readme = '' + +with open('README.md', encoding='utf-8') as file: + readme = file.read() + + +packages = [ + 'melisa', + 'melisa.listeners', + 'melisa.models', + 'melisa.models.app', + 'melisa.models.guild', + 'melisa.models.message', + 'melisa.models.user', + 'melisa.utils' +] + +setup( + name='melisa', + author='gray-cat, TheMisterSenpai', + url='https://github.com/MelisaDev/melisa', + version=version, + packages=packages, + license='MIT', + description='Cache-optimized Discord microframework for Python 3', + long_description=readme, + long_description_content_type="text/markdown", + include_package_data=True, + install_requires=requirements, + extras_require=extras_require, + classifiers=[ + "Development Status :: 1 - Development", + "License :: OSI Approved :: MIT License", + "Intended Audience :: Developers", + "Natural Language :: English", + "Operating System :: OS Independent", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Topic :: Internet", + "Topic :: Software Development :: Libraries", + "Topic :: Software Development :: Libraries :: Python Modules", + "Topic :: Utilities", + "Typing :: Typed", + ] +)