Skip to content

Commit 372aaaa

Browse files
committed
Migrate to pyproject.toml / PEP-621
1 parent 5fa8ef8 commit 372aaaa

File tree

3 files changed

+57
-82
lines changed

3 files changed

+57
-82
lines changed

pyproject.toml

+54
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
[build-system]
2+
requires = ["setuptools>=61.2"]
3+
build-backend = "setuptools.build_meta"
4+
5+
[project]
6+
name = "kafka-python"
7+
dynamic = ["version"]
8+
authors = [{name = "Dana Powers", email = "[email protected]"}]
9+
description = "Pure Python client for Apache Kafka"
10+
keywords = ["apache kafka", "kafka"]
11+
readme = "README.rst"
12+
classifiers = [
13+
"Development Status :: 5 - Production/Stable",
14+
"Intended Audience :: Developers",
15+
"License :: OSI Approved :: Apache Software License",
16+
"Programming Language :: Python",
17+
"Programming Language :: Python :: 2",
18+
"Programming Language :: Python :: 2.7",
19+
"Programming Language :: Python :: 3",
20+
"Programming Language :: Python :: 3.4",
21+
"Programming Language :: Python :: 3.5",
22+
"Programming Language :: Python :: 3.6",
23+
"Programming Language :: Python :: 3.7",
24+
"Programming Language :: Python :: 3.8",
25+
"Programming Language :: Python :: 3.9",
26+
"Programming Language :: Python :: 3.10",
27+
"Programming Language :: Python :: 3.11",
28+
"Programming Language :: Python :: 3.12",
29+
"Programming Language :: Python :: Implementation :: CPython",
30+
"Programming Language :: Python :: Implementation :: PyPy",
31+
"Topic :: Software Development :: Libraries :: Python Modules",
32+
]
33+
urls = {Homepage = "https://github.com/dpkp/kafka-python"}
34+
35+
[project.optional-dependencies]
36+
crc32c = ["crc32c"]
37+
lz4 = ["lz4"]
38+
snappy = ["python-snappy"]
39+
zstd = ["zstandard"]
40+
testing = ["pytest", "mock", "pytest-mock"]
41+
42+
[tool.setuptools]
43+
include-package-data = false
44+
license-files = [] # workaround for https://github.com/pypa/setuptools/issues/4759
45+
46+
[tool.setuptools.packages.find]
47+
exclude = ["test"]
48+
namespaces = false
49+
50+
[tool.distutils.bdist_wheel]
51+
universal = 1
52+
53+
[tool.setuptools.dynamic]
54+
version = {attr = "kafka.__version__"}

setup.cfg

-5
This file was deleted.

setup.py

+3-77
Original file line numberDiff line numberDiff line change
@@ -1,78 +1,4 @@
1-
import os
2-
import sys
1+
# See pyproject.toml for project / build configuration
2+
from setuptools import setup
33

4-
from setuptools import setup, Command, find_packages
5-
6-
# Pull version from source without importing
7-
# since we can't import something we haven't built yet :)
8-
exec(open('kafka/version.py').read())
9-
10-
11-
class Tox(Command):
12-
13-
user_options = []
14-
15-
def initialize_options(self):
16-
pass
17-
18-
def finalize_options(self):
19-
pass
20-
21-
@classmethod
22-
def run(cls):
23-
import tox
24-
sys.exit(tox.cmdline([]))
25-
26-
27-
test_require = ['tox', 'mock']
28-
29-
here = os.path.abspath(os.path.dirname(__file__))
30-
31-
with open(os.path.join(here, 'README.rst')) as f:
32-
README = f.read()
33-
34-
setup(
35-
name="kafka-python",
36-
version=__version__,
37-
38-
tests_require=test_require,
39-
extras_require={
40-
"crc32c": ["crc32c"],
41-
"lz4": ["lz4"],
42-
"snappy": ["python-snappy"],
43-
"zstd": ["zstandard"],
44-
},
45-
cmdclass={"test": Tox},
46-
packages=find_packages(exclude=['test']),
47-
author="Dana Powers",
48-
author_email="[email protected]",
49-
url="https://github.com/dpkp/kafka-python",
50-
license="Apache License 2.0",
51-
description="Pure Python client for Apache Kafka",
52-
long_description=README,
53-
keywords=[
54-
"apache kafka",
55-
"kafka",
56-
],
57-
classifiers=[
58-
"Development Status :: 5 - Production/Stable",
59-
"Intended Audience :: Developers",
60-
"License :: OSI Approved :: Apache Software License",
61-
"Programming Language :: Python",
62-
"Programming Language :: Python :: 2",
63-
"Programming Language :: Python :: 2.7",
64-
"Programming Language :: Python :: 3",
65-
"Programming Language :: Python :: 3.4",
66-
"Programming Language :: Python :: 3.5",
67-
"Programming Language :: Python :: 3.6",
68-
"Programming Language :: Python :: 3.7",
69-
"Programming Language :: Python :: 3.8",
70-
"Programming Language :: Python :: 3.9",
71-
"Programming Language :: Python :: 3.10",
72-
"Programming Language :: Python :: 3.11",
73-
"Programming Language :: Python :: 3.12",
74-
"Programming Language :: Python :: Implementation :: CPython",
75-
"Programming Language :: Python :: Implementation :: PyPy",
76-
"Topic :: Software Development :: Libraries :: Python Modules",
77-
]
78-
)
4+
setup()

0 commit comments

Comments
 (0)