#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Slixmpp OMEMO plugin Copyright (C) 2019 Maxime “pep” Buquet This file is part of slixmpp-omemo. See the file LICENSE for copying permission. """ import os from importlib.machinery import PathFinder from typing import Optional try: from setuptools import setup except ImportError: from distutils.core import setup def find_version(load_path, name) -> Optional[str]: """Find module version""" module = None spec = PathFinder.find_spec(name, load_path) try: module = spec.loader.load_module(name) except (AttributeError, ImportError, SyntaxError): return None if module is None: return None for key in dir(module): if key != '__version__': continue return getattr(module, key) return None MODULE_FILE_PATH = os.path.join( os.path.dirname(os.path.abspath(__file__)), 'slixmpp_omemo', ) VERSION = find_version(MODULE_FILE_PATH, 'version') DESCRIPTION = ('Slixmpp OMEMO plugin') with open('README.rst', encoding='utf8') as readme: LONG_DESCRIPTION = readme.read() CLASSIFIERS = [ 'Development Status :: 3 - Alpha', 'Intended Audience :: Developers', 'License :: OSI Approved :: GNU General Public License v3 (GPLv3)', 'Programming Language :: Python', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.7', 'Topic :: Internet :: XMPP', 'Topic :: Security :: Cryptography', 'Topic :: Software Development :: Libraries :: Python Modules', ] setup( name="slixmpp-omemo", version=VERSION, description=DESCRIPTION, long_description=LONG_DESCRIPTION, author='Maxime Buquet', author_email='pep@bouah.net', url='https://lab.louiz.org/poezio/slixmpp-omemo', license='GPLv3', platforms=['any'], install_requires=['slixmpp', 'omemo'], classifiers=CLASSIFIERS, )