From d17e6cd369473501162c08039c030370ed70611a Mon Sep 17 00:00:00 2001 From: Roman Snegirev Date: Thu, 26 Dec 2024 09:16:17 +0300 Subject: [PATCH] Move project metadata to pyproject.toml --- pyproject.toml | 62 +++++++++++++++++++++++++++++++++++++++- python_socks/_version.py | 2 +- setup.py | 58 ------------------------------------- 3 files changed, 62 insertions(+), 60 deletions(-) delete mode 100644 setup.py diff --git a/pyproject.toml b/pyproject.toml index 89483a6..72749f9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,66 @@ +[build-system] +requires = ['setuptools'] +build-backend = 'setuptools.build_meta' + +[project] +name = 'python-socks' +license = { text = 'Apache-2.0' } +description = 'Proxy (SOCKS4, SOCKS5, HTTP CONNECT) client for Python' +readme = 'README.md' +authors = [{ name = 'Roman Snegirev', email = 'snegiryev@gmail.com' }] +keywords = [ + 'socks', + 'socks5', + 'socks4', + 'http', + 'proxy', + 'asyncio', + 'trio', + 'curio', + 'anyio', +] +requires-python = ">=3.8.0" +dynamic = ['version'] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Programming Language :: Python", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3 :: Only", + "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 :: 3.13", + "Operating System :: MacOS", + "Operating System :: Microsoft", + "Operating System :: POSIX :: Linux", + "Topic :: Internet :: WWW/HTTP", + "Intended Audience :: Developers", + "Framework :: AsyncIO", + "Framework :: Trio", + "License :: OSI Approved :: Apache Software License", +] + +[project.optional-dependencies] +asyncio = ['async-timeout>=4.0; python_version < "3.11"'] +trio = ['trio>=0.24'] +curio = ['curio>=1.4'] +anyio = ['anyio>=3.3.4,<5.0.0'] + +[project.urls] +homepage = 'https://github.com/romis2012/python-socks' +repository = 'https://github.com/romis2012/python-socks' + +[tool.setuptools.dynamic] +version = { attr = 'python_socks.__version__' } + +[tool.setuptools.packages.find] +include = ['python_socks*'] + [tool.black] line-length = 99 -target-version = ['py37', 'py38', 'py39'] +target-version = ['py38', 'py39', 'py310', 'py311', 'py312'] skip-string-normalization = true preview = true verbose = true diff --git a/python_socks/_version.py b/python_socks/_version.py index 698f02e..fa46ef6 100644 --- a/python_socks/_version.py +++ b/python_socks/_version.py @@ -1,2 +1,2 @@ __title__ = 'python-socks' -__version__ = '2.5.3' +__version__ = '2.6.0' diff --git a/setup.py b/setup.py deleted file mode 100644 index 32216f0..0000000 --- a/setup.py +++ /dev/null @@ -1,58 +0,0 @@ -#!/usr/bin/env python -import os -import re -import sys - -from setuptools import setup - - -if sys.version_info < (3, 6, 1): - raise RuntimeError('python-socks requires Python >= 3.6.2') - - -def get_version(): - here = os.path.dirname(os.path.abspath(__file__)) - filename = os.path.join(here, 'python_socks', '_version.py') - contents = open(filename).read() - pattern = r"^__version__ = '(.*?)'$" - return re.search(pattern, contents, re.MULTILINE).group(1) - - -def get_long_description(): - with open('README.md', mode='r', encoding='utf8') as f: - return f.read() - - -setup( - name='python-socks', - author='Roman Snegirev', - author_email='snegiryev@gmail.com', - version=get_version(), - license='Apache 2', - url='https://github.com/romis2012/python-socks', - description='Core proxy (SOCKS4, SOCKS5, HTTP tunneling) functionality for Python', - long_description=get_long_description(), - long_description_content_type='text/markdown', - packages=[ - 'python_socks', - 'python_socks._protocols', - 'python_socks._connectors', - 'python_socks.sync', - 'python_socks.sync.v2', - 'python_socks.async_', - 'python_socks.async_.asyncio', - 'python_socks.async_.asyncio.v2', - 'python_socks.async_.trio', - 'python_socks.async_.trio.v2', - 'python_socks.async_.curio', - 'python_socks.async_.anyio', - 'python_socks.async_.anyio.v2', - ], - keywords='socks socks5 socks4 http proxy asyncio trio curio anyio', - extras_require={ - 'asyncio': ['async-timeout>=3.0.1; python_version < "3.11"'], - 'trio': ['trio>=0.16.0'], - 'curio': ['curio>=1.4'], - 'anyio': ['anyio>=3.3.4,<5.0.0'], - }, -)