Add a PEP 257 docstring to the overall ‘gajja’ package.
[python-gajja.git] / setup.py
blobb1b38abb017d01aeb5f456923df904550409043a
1 # -*- coding: utf-8; -*-
3 # setup.py
4 # Part of ‘gajja’, a Python test double library.
6 # Copyright © 2008–2016 Ben Finney <ben+python@benfinney.id.au>
8 # This is free software: you may copy, modify, and/or distribute this work
9 # under the terms of the GNU General Public License as published by the
10 # Free Software Foundation; version 3 of that license or any later version.
11 # No warranty expressed or implied. See the file ‘LICENSE.GPL-3’ for details.
13 """ Distribution setup for ‘gajja’ library. """
15 from __future__ import (absolute_import, unicode_literals)
17 import sys
18 import os
19 import os.path
20 import types
21 import pydoc
22 import email.utils
24 from setuptools import (setup, find_packages)
26 __metaclass__ = type
29 class SimpleNamespace:
30 """ A simple attribute-based namespace. """
33 setup_dir = os.path.dirname(__file__)
35 readme_file_path = os.path.join(setup_dir, "README")
36 with open(readme_file_path) as readme_file:
37 (synopsis, long_description) = pydoc.splitdoc(readme_file.read())
39 changelog = SimpleNamespace()
40 changelog.package = "gajja"
41 changelog.version = "0.1"
42 changelog.author = "Ben Finney <ben+python@benfinney.id.au>"
43 (author_name, author_email) = email.utils.parseaddr(changelog.author)
45 control_structure = dict()
46 control_structure['maintainer'] = changelog.author
47 (maintainer_name, maintainer_email) = email.utils.parseaddr(
48 control_structure['maintainer'])
49 control_structure['homepage'] = "https://notabug.org/bignose/python-gajja"
51 copyright_structure = SimpleNamespace()
52 license = SimpleNamespace()
53 license.synopsis = "GPLv3+"
54 copyright_structure.license = license
57 setup(
58 name=changelog.package,
59 version=str(changelog.version),
60 packages=find_packages(exclude=["test"]),
62 # Setuptools metadata.
63 maintainer=maintainer_name,
64 maintainer_email=maintainer_email,
65 zip_safe=False,
66 setup_requires=[
67 "python-debian",
69 test_suite="unittest2.collector",
70 tests_require=[
71 "unittest2 >=0.5.1",
72 "testtools",
73 "testscenarios >=0.4",
74 "mock >=1.3",
75 "python-debian",
77 install_requires=[
78 "setuptools",
79 "unittest2 >=0.5.1",
80 "testtools",
81 "testscenarios >=0.4",
82 "mock >=1.3",
85 # PyPI metadata.
86 author=author_name,
87 author_email=author_email,
88 description=synopsis,
89 license=license.synopsis,
90 keywords="test double fake mock filesystem subprocess".split(),
91 url=control_structure['homepage'],
92 long_description=long_description,
93 classifiers=[
94 # Reference: http://pypi.python.org/pypi?%3Aaction=list_classifiers
95 "Development Status :: 3 - Alpha",
96 "License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)",
97 "Operating System :: POSIX",
98 "Programming Language :: Python :: 2.7",
99 "Programming Language :: Python :: 3.3",
100 "Programming Language :: Python :: 3.4",
101 "Programming Language :: Python :: 3.5",
102 "Intended Audience :: Developers",
103 "Topic :: Software Development :: Testing",
108 # Local variables:
109 # coding: utf-8
110 # mode: python
111 # End:
112 # vim: fileencoding=utf-8 filetype=python :