From a66a30d8b58f8795988dae318a351fbabba30e19 Mon Sep 17 00:00:00 2001 From: cocolato Date: Tue, 2 Jul 2024 21:51:25 +0800 Subject: [PATCH] move static metadata from setup.py to pyproject.toml --- .gitignore | 3 +++ pyproject.toml | 37 +++++++++++++++++++++++++++++++++++++ setup.cfg | 3 --- setup.py | 41 +++-------------------------------------- 4 files changed, 43 insertions(+), 41 deletions(-) diff --git a/.gitignore b/.gitignore index 58f2d905..7b25862a 100644 --- a/.gitignore +++ b/.gitignore @@ -47,6 +47,9 @@ pip-log.txt env/ .vscode/ +# lock file +*.lock + pyvenv.cfg share/* diff --git a/pyproject.toml b/pyproject.toml index 3b109dac..af83bb1e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,2 +1,39 @@ [build-system] requires = ["setuptools", "cython>=0.28.4,<4"] + +[project] +name = "thriftpy2" +version = "0.5.1" +description = "Pure python implementation of Apache Thrift." +authors = [ + {name = "ThriftPy Organization", email = "gotzehsing@gmail.com"}, +] +dependencies = [ + "Cython>=3.0.10", + "ply>=3.4,<4.0", + "six~=1.15", +] +requires-python = ">=3.6" +readme = "README.rst" +license = {file = "LICENSE"} +keywords = ["thrift python thriftpy thriftpy2"] +classifiers = [ + "Development Status :: 4 - Beta", + "Intended Audience :: Developers", + "License :: OSI Approved :: MIT License", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.6", + "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: Implementation :: CPython", + "Programming Language :: Python :: Implementation :: PyPy", + "Topic :: Software Development", +] + +[project.urls] +Homepage = "https://thriftpy2.readthedocs.io/" +Source = "https://github.com/Thriftpy/thriftpy2" diff --git a/setup.cfg b/setup.cfg index f47f307c..d8f9ee14 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,3 @@ -[metadata] -license_files = LICENSE - [wheel] universal = 1 diff --git a/setup.py b/setup.py index f469a200..c52a3ea9 100644 --- a/setup.py +++ b/setup.py @@ -1,17 +1,11 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- -import re import sys import platform -from os.path import join, dirname +from setuptools import setup, find_packages, Extension -from setuptools import setup, find_packages -from setuptools.extension import Extension - -with open(join(dirname(__file__), 'thriftpy2', '__init__.py'), 'r') as f: - version = re.match(r".*__version__ = '(.*?)'", f.read(), re.S).group(1) install_requires = [ "ply>=3.4,<4.0", @@ -39,7 +33,6 @@ "pytest>=6.1.1,<8.2.0", ] + tornado_requires - cmdclass = {} ext_modules = [] @@ -74,24 +67,11 @@ ["thriftpy2/protocol/cybin/cybin.c"], libraries=libraries)) -setup(name="thriftpy2", - version=version, - description="Pure python implementation of Apache Thrift.", - keywords="thrift python thriftpy thriftpy2", - author="ThriftPy Organization", - author_email="gotzehsing@gmail.com", +setup( packages=find_packages(exclude=['benchmark', 'docs', 'tests']), - entry_points={}, - url="https://thriftpy2.readthedocs.io/", - project_urls={ - "Source": "https://github.com/Thriftpy/thriftpy2", - }, - license="MIT", zip_safe=False, long_description=open("README.rst").read(), install_requires=install_requires, - tests_require=tornado_requires, - python_requires='>=3.6', extras_require={ "dev": dev_requires, "tornado": tornado_requires @@ -99,19 +79,4 @@ cmdclass=cmdclass, ext_modules=ext_modules, include_package_data=True, - classifiers=[ - "Topic :: Software Development", - "Development Status :: 4 - Beta", - "Intended Audience :: Developers", - "License :: OSI Approved :: MIT License", - "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.6", - "Programming Language :: Python :: 3.7", - "Programming Language :: Python :: 3.8", - "Programming Language :: Python :: 3.9", - "Programming Language :: Python :: 3.10", - "Programming Language :: Python :: 3.11", - "Programming Language :: Python :: 3.12", - "Programming Language :: Python :: Implementation :: CPython", - "Programming Language :: Python :: Implementation :: PyPy", - ]) +)