File: setup.py

package info (click to toggle)
dput 0.12.1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 812 kB
  • ctags: 1,191
  • sloc: python: 10,349; sh: 140; makefile: 88
file content (121 lines) | stat: -rw-r--r-- 4,153 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
# -*- coding: utf-8; -*-

# setup.py
# Part of ‘dput’, a Debian package upload toolkit.
#
# This is free software, and you are welcome to redistribute it under
# certain conditions; see the end of this file for copyright
# information, grant of license, and disclaimer of warranty.

""" Distribution setup for ‘dput’ library. """

from __future__ import (absolute_import, unicode_literals)

import email.utils
import os
import os.path
import pydoc

import debian.changelog
import debian.copyright
import debian.deb822
from setuptools import (setup, find_packages)


setup_dir = os.path.dirname(__file__)

readme_file_path = os.path.join(setup_dir, "README")
with open(readme_file_path) as readme_file:
    (synopsis, long_description) = pydoc.splitdoc(readme_file.read())

changelog_file_path = os.path.join(setup_dir, "debian", "changelog")
with open(changelog_file_path) as changelog_file:
    changelog = debian.changelog.Changelog(changelog_file, max_blocks=1)
(author_name, author_email) = email.utils.parseaddr(changelog.author)

control_file_path = os.path.join(setup_dir, "debian", "control")
with open(control_file_path) as control_file:
    control_structure = debian.deb822.Deb822(control_file)
(maintainer_name, maintainer_email) = email.utils.parseaddr(
        control_structure['maintainer'])

copyright_file_path = os.path.join(setup_dir, "debian", "copyright")
with open(copyright_file_path) as copyright_file:
    copyright_structure = debian.copyright.Copyright(copyright_file)
general_files_paragraph = copyright_structure.find_files_paragraph("*")
license = general_files_paragraph.license


setup(
        name=changelog.package,
        version=str(changelog.version),
        packages=find_packages(exclude=["test"]),

        # Setuptools metadata.
        maintainer=maintainer_name,
        maintainer_email=maintainer_email,
        zip_safe=False,
        setup_requires=[
            "python-debian",
            ],
        test_suite="unittest2.collector",
        tests_require=[
            "unittest2 >=0.5.1",
            "testtools",
            "testscenarios >=0.4",
            "mock >=1.3",
            # The ‘pkg_resources’ library is not yet distributed separately,
            # see <URL:https://github.com/PyPA/setuptools/issues/863>.
            #"pkg_resources",
            "python-debian",
            "gpg",
            "httpretty",
            ],
        install_requires=[
            # The ‘pkg_resources’ library is not yet distributed separately,
            # see <URL:https://github.com/PyPA/setuptools/issues/863>.
            #"pkg_resources",
            "python-debian",
            "gpg",
            ],
        entry_points={
            'console_scripts': [
                "execute-dput = dput.dput:main",
                "execute-dcut = dput.dcut:dcut",
                ],
            },

        # PyPI metadata.
        author=author_name,
        author_email=author_email,
        description=synopsis,
        license=license.synopsis,
        keywords="debian package upload test".split(),
        url=control_structure['homepage'],
        long_description=long_description,
        classifiers=[
            # Reference: http://pypi.python.org/pypi?%3Aaction=list_classifiers
            "Development Status :: 5 - Production/Stable",
            "License :: OSI Approved :: GNU General Public License",
            "Operating System :: POSIX",
            "Programming Language :: Python :: 2.7",
            "Programming Language :: Python :: 3",
            "Intended Audience :: Developers",
            "Topic :: Software Development :: Build Tools",
            ],
        )


# Copyright © 2008–2017 Ben Finney <ben+python@benfinney.id.au>
#
# This is free software: you may copy, modify, and/or distribute this work
# under the terms of the GNU General Public License as published by the
# Free Software Foundation; version 3 of that license or any later version.
# No warranty expressed or implied. See the file ‘LICENSE.GPL-3’ for details.


# Local variables:
# coding: utf-8
# mode: python
# End:
# vim: fileencoding=utf-8 filetype=python :