]> git.phdru.name Git - mimedecode.git/blob - setup.py
Build(setup.py): Use `importlib` instead of deprecated `imp` for Python 3.4+
[mimedecode.git] / setup.py
1 #! /usr/bin/env python
2
3 from os.path import abspath, dirname, join
4 from setuptools import setup
5 import sys
6
7 if sys.version_info[:2] == (2, 7):
8     from imp import load_source
9
10 elif sys.version_info >= (3, 4):
11     from importlib.machinery import SourceFileLoader
12     import types
13
14     def load_source(fullname, path):
15         loader = SourceFileLoader(fullname, path)
16         loaded = types.ModuleType(loader.name)
17         loader.exec_module(loaded)
18         return loaded
19
20 else:
21     raise ImportError("mimedecode requires Python 2.7 or 3.4+")
22
23 versionpath = join(abspath(dirname(__file__)), "mimedecode", "__version__.py")
24 mimedecode_version = load_source("mimedecode_version", versionpath)
25
26 setup(
27     name="mimedecode",
28     version=mimedecode_version.__version__,
29     description="A program to decode MIME messages",
30     long_description="A program to decode MIME messages. " +
31     mimedecode_version.__copyright__,
32     long_description_content_type="text/plain",
33     author="Oleg Broytman",
34     author_email="phd@phdru.name",
35     url="https://phdru.name/Software/Python/#mimedecode",
36     project_urls={
37         'Homepage': 'https://phdru.name/Software/Python/#mimedecode',
38         'Documentation': 'https://phdru.name/Software/Python/mimedecode.html',
39         'Download':
40             'https://phdru.name/Software/Python/'
41             'mimedecode-%s.tar.bz2' % mimedecode_version.__version__,
42         'Git repo': 'https://git.phdru.name/mimedecode.git',
43         'Github repo': 'https://github.com/phdru/mimedecode',
44         'Issue tracker': 'https://github.com/phdru/mimedecode/issues',
45     },
46     license=mimedecode_version.__license__,
47     keywords=['email', 'MIME'],
48     platforms="Any",
49     classifiers=[
50         'Development Status :: 5 - Production/Stable',
51         'Environment :: Console',
52         'Intended Audience :: End Users/Desktop',
53         'License :: OSI Approved :: GNU General Public License (GPL)',
54         'Operating System :: OS Independent',
55         'Programming Language :: Python :: Implementation :: CPython',
56         'Programming Language :: Python :: Implementation :: PyPy',
57         'Programming Language :: Python :: 2',
58         'Programming Language :: Python :: 2.7',
59         'Programming Language :: Python :: 3',
60         'Programming Language :: Python :: 3.4',
61         'Programming Language :: Python :: 3.5',
62         'Programming Language :: Python :: 3.6',
63         'Programming Language :: Python :: 3.7',
64     ],
65     packages=['mimedecode'],
66     entry_points={
67         'console_scripts': [
68             'mimedecode = mimedecode.__main__:main'
69         ]
70     },
71     python_requires='>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*',
72     install_requires=['m_lib.defenc>=1.0'],
73     tests_require=['m_lib>=3.1'],
74 )