Debian Codegraph @

setup.py

raw ◀ ▶
1 Debian patch touch this file
1 #!/usr/bin/env python3
2
3 # Copyright 2008-2024 Canonical Ltd.
4 #
5 # This file is part of launchpadlib.
6 #
7 # launchpadlib is free software: you can redistribute it and/or modify it
8 # under the terms of the GNU Lesser General Public License as published by the
9 # Free Software Foundation, version 3 of the License.
10 #
11 # launchpadlib is distributed in the hope that it will be useful, but WITHOUT
12 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
14 # for more details.
15 #
16 # You should have received a copy of the GNU Lesser General Public License
17 # along with launchpadlib. If not, see <http://www.gnu.org/licenses/>.
18
19 """Setup for the launchpadlib library."""
20
21 from setuptools import setup, find_packages
22
23
24 # generic helpers primarily for the long_description
25 def generate(*docname_or_string):
26 marker = ".. pypi description ends here"
27 res = []
28 for value in docname_or_string:
29 if value.endswith(".rst"):
30 with open(value) as f:
31 value = f.read()
32 idx = value.find(marker)
33 if idx >= 0:
34 value = value[:idx]
35 res.append(value)
36 if not value.endswith("\n"):
37 res.append("")
38 return "\n".join(res)
39
40
41 # end generic helpers
42
43
44 install_requires = [
45 "httplib2",
46 "lazr.restfulclient>=0.14.2",
47 "lazr.uri",
•48 'importlib_resources; python_version < "3.9"',
49 ]
50
51 setup(
52 name="launchpadlib",
53 version="2.1.0",
54 packages=find_packages("src"),
55 package_dir={"": "src"},
56 include_package_data=True,
57 zip_safe=False,
58 author="The Launchpad developers",
59 author_email="[email protected]",
60 maintainer="LAZR Developers",
61 maintainer_email="[email protected]",
62 download_url="https://launchpad.net/launchpadlib/+download",
63 description=open("README.rst").readline().strip(),
64 long_description=generate("src/launchpadlib/docs/index.rst", "NEWS.rst"),
65 license="LGPL v3",
66 python_requires=">=3.8",
67 install_requires=install_requires,
68 url="https://help.launchpad.net/API/launchpadlib",
69 project_urls={
70 "Source": "https://code.launchpad.net/launchpadlib",
71 "Issue Tracker": "https://bugs.launchpad.net/launchpadlib",
72 "Documentation": "https://launchpadlib.readthedocs.io/en/latest/",
73 },
74 classifiers=[
75 "Development Status :: 5 - Production/Stable",
76 "Intended Audience :: Developers",
77 "License :: OSI Approved :: GNU Library or Lesser General Public License (LGPL)", # noqa: E501
78 "Operating System :: OS Independent",
79 "Programming Language :: Python",
80 "Programming Language :: Python :: 3",
81 "Programming Language :: Python :: 3.8",
82 "Programming Language :: Python :: 3.9",
83 "Programming Language :: Python :: 3.10",
84 "Programming Language :: Python :: 3.11",
85 "Programming Language :: Python :: 3.12",
86 "Programming Language :: Python :: 3.13",
87 ],
88 extras_require={
89 "keyring": ["keyring"],
90 "docs": ["Sphinx"],
91 # Dependencies useful when testing other packages with launchpadlib.
92 "testing": [
93 "testresources",
94 "wadllib",
95 ],
96 # Dependencies only needed by launchpadlib's own tests.
97 "test": [
98 "coverage",
99 "pytest",
100 ],
101 },
102 )