Skip to content

Commit db1b716

Browse files
committed
Move setup information to setup.cfg
Use a declarative syntax to avoid mixing code and configuration. Simplifies handling of long description file by reducing some boilerplate. For details on this setuptools feature, see: https://setuptools.readthedocs.io/en/latest/setuptools.html#configuring-setup-using-setup-cfg-files Django also uses supet.cfg, see commit: django/django@85efc14
1 parent aa4d185 commit db1b716

File tree

2 files changed

+46
-45
lines changed

2 files changed

+46
-45
lines changed

setup.cfg

+44
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,47 @@
1+
[metadata]
2+
name = django-debug-toolbar
3+
version = 2.2
4+
description = A configurable set of panels that display various debug information about the current request/response.
5+
long_description = file: README.rst
6+
author = Rob Hudson
7+
author_email = [email protected]
8+
url = https://github.com/jazzband/django-debug-toolbar
9+
download_url = https://pypi.org/project/django-debug-toolbar/
10+
license = BSD
11+
license_files = LICENSE
12+
classifiers =
13+
Development Status :: 5 - Production/Stable
14+
Environment :: Web Environment
15+
Framework :: Django
16+
Framework :: Django :: 2.2
17+
Framework :: Django :: 3.0
18+
Intended Audience :: Developers
19+
License :: OSI Approved :: BSD License
20+
Operating System :: OS Independent
21+
Programming Language :: Python
22+
Programming Language :: Python :: 3
23+
Programming Language :: Python :: 3 :: Only
24+
Programming Language :: Python :: 3.5
25+
Programming Language :: Python :: 3.6
26+
Programming Language :: Python :: 3.7
27+
Programming Language :: Python :: 3.8
28+
Topic :: Software Development :: Libraries :: Python Modules
29+
30+
[options]
31+
python_requires = >=3.5
32+
install_requires =
33+
Django >= 2.2
34+
sqlparse >= 0.2.0
35+
packages = find:
36+
include_package_data = true
37+
zip_safe = false
38+
39+
[options.packages.find]
40+
exclude =
41+
example
42+
tests
43+
tests.*
44+
145
[flake8]
246
exclude = .tox,venv,conf.py
347
ignore = E203,W503,W601

setup.py

+2-45
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,5 @@
11
#!/usr/bin/env python3
22

3-
from io import open
3+
from setuptools import setup
44

5-
from setuptools import find_packages, setup
6-
7-
8-
def readall(path):
9-
with open(path, encoding="utf-8") as fp:
10-
return fp.read()
11-
12-
13-
setup(
14-
name="django-debug-toolbar",
15-
version="2.2",
16-
description="A configurable set of panels that display various debug "
17-
"information about the current request/response.",
18-
long_description=readall("README.rst"),
19-
author="Rob Hudson",
20-
author_email="[email protected]",
21-
url="https://github.com/jazzband/django-debug-toolbar",
22-
download_url="https://pypi.org/project/django-debug-toolbar/",
23-
license="BSD",
24-
license_files=["LICENSE"],
25-
packages=find_packages(exclude=("tests.*", "tests", "example")),
26-
python_requires=">=3.5",
27-
install_requires=["Django>=2.2", "sqlparse>=0.2.0"],
28-
include_package_data=True,
29-
zip_safe=False, # because we're including static files
30-
classifiers=[
31-
"Development Status :: 5 - Production/Stable",
32-
"Environment :: Web Environment",
33-
"Framework :: Django",
34-
"Framework :: Django :: 2.2",
35-
"Framework :: Django :: 3.0",
36-
"Intended Audience :: Developers",
37-
"License :: OSI Approved :: BSD License",
38-
"Operating System :: OS Independent",
39-
"Programming Language :: Python",
40-
"Programming Language :: Python :: 3",
41-
"Programming Language :: Python :: 3 :: Only",
42-
"Programming Language :: Python :: 3.5",
43-
"Programming Language :: Python :: 3.6",
44-
"Programming Language :: Python :: 3.7",
45-
"Programming Language :: Python :: 3.8",
46-
"Topic :: Software Development :: Libraries :: Python Modules",
47-
],
48-
)
5+
setup()

0 commit comments

Comments
 (0)