Skip to content

Commit 5b319bd

Browse files
authored
move static metadata from setup.py to pyproject.toml (#283)
1 parent ca6389d commit 5b319bd

File tree

4 files changed

+43
-41
lines changed

4 files changed

+43
-41
lines changed

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,9 @@ pip-log.txt
4747
env/
4848
.vscode/
4949

50+
# lock file
51+
*.lock
52+
5053
pyvenv.cfg
5154
share/*
5255

pyproject.toml

+37
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,39 @@
11
[build-system]
22
requires = ["setuptools", "cython>=0.28.4,<4"]
3+
4+
[project]
5+
name = "thriftpy2"
6+
version = "0.5.1"
7+
description = "Pure python implementation of Apache Thrift."
8+
authors = [
9+
{name = "ThriftPy Organization", email = "[email protected]"},
10+
]
11+
dependencies = [
12+
"Cython>=3.0.10",
13+
"ply>=3.4,<4.0",
14+
"six~=1.15",
15+
]
16+
requires-python = ">=3.6"
17+
readme = "README.rst"
18+
license = {file = "LICENSE"}
19+
keywords = ["thrift python thriftpy thriftpy2"]
20+
classifiers = [
21+
"Development Status :: 4 - Beta",
22+
"Intended Audience :: Developers",
23+
"License :: OSI Approved :: MIT License",
24+
"Programming Language :: Python :: 3",
25+
"Programming Language :: Python :: 3.10",
26+
"Programming Language :: Python :: 3.11",
27+
"Programming Language :: Python :: 3.12",
28+
"Programming Language :: Python :: 3.6",
29+
"Programming Language :: Python :: 3.7",
30+
"Programming Language :: Python :: 3.8",
31+
"Programming Language :: Python :: 3.9",
32+
"Programming Language :: Python :: Implementation :: CPython",
33+
"Programming Language :: Python :: Implementation :: PyPy",
34+
"Topic :: Software Development",
35+
]
36+
37+
[project.urls]
38+
Homepage = "https://thriftpy2.readthedocs.io/"
39+
Source = "https://github.com/Thriftpy/thriftpy2"

setup.cfg

-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
[metadata]
2-
license_files = LICENSE
3-
41
[wheel]
52
universal = 1
63

setup.py

+3-38
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,11 @@
11
#!/usr/bin/env python
22
# -*- coding: utf-8 -*-
33

4-
import re
54
import sys
65
import platform
76

8-
from os.path import join, dirname
7+
from setuptools import setup, find_packages, Extension
98

10-
from setuptools import setup, find_packages
11-
from setuptools.extension import Extension
12-
13-
with open(join(dirname(__file__), 'thriftpy2', '__init__.py'), 'r') as f:
14-
version = re.match(r".*__version__ = '(.*?)'", f.read(), re.S).group(1)
159

1610
install_requires = [
1711
"ply>=3.4,<4.0",
@@ -39,7 +33,6 @@
3933
"pytest>=6.1.1,<8.2.0",
4034
] + tornado_requires
4135

42-
4336
cmdclass = {}
4437
ext_modules = []
4538

@@ -74,44 +67,16 @@
7467
["thriftpy2/protocol/cybin/cybin.c"],
7568
libraries=libraries))
7669

77-
setup(name="thriftpy2",
78-
version=version,
79-
description="Pure python implementation of Apache Thrift.",
80-
keywords="thrift python thriftpy thriftpy2",
81-
author="ThriftPy Organization",
82-
author_email="[email protected]",
70+
setup(
8371
packages=find_packages(exclude=['benchmark', 'docs', 'tests']),
84-
entry_points={},
85-
url="https://thriftpy2.readthedocs.io/",
86-
project_urls={
87-
"Source": "https://github.com/Thriftpy/thriftpy2",
88-
},
89-
license="MIT",
9072
zip_safe=False,
9173
long_description=open("README.rst").read(),
9274
install_requires=install_requires,
93-
tests_require=tornado_requires,
94-
python_requires='>=3.6',
9575
extras_require={
9676
"dev": dev_requires,
9777
"tornado": tornado_requires
9878
},
9979
cmdclass=cmdclass,
10080
ext_modules=ext_modules,
10181
include_package_data=True,
102-
classifiers=[
103-
"Topic :: Software Development",
104-
"Development Status :: 4 - Beta",
105-
"Intended Audience :: Developers",
106-
"License :: OSI Approved :: MIT License",
107-
"Programming Language :: Python :: 3",
108-
"Programming Language :: Python :: 3.6",
109-
"Programming Language :: Python :: 3.7",
110-
"Programming Language :: Python :: 3.8",
111-
"Programming Language :: Python :: 3.9",
112-
"Programming Language :: Python :: 3.10",
113-
"Programming Language :: Python :: 3.11",
114-
"Programming Language :: Python :: 3.12",
115-
"Programming Language :: Python :: Implementation :: CPython",
116-
"Programming Language :: Python :: Implementation :: PyPy",
117-
])
82+
)

0 commit comments

Comments
 (0)