diff --git a/.github/workflows/integration.yaml b/.github/workflows/integration.yaml index 1089b27608..ff8794eff6 100644 --- a/.github/workflows/integration.yaml +++ b/.github/workflows/integration.yaml @@ -25,7 +25,7 @@ jobs: - uses: actions/checkout@v3 - uses: pypa/gh-action-pip-audit@v1.0.0 with: - inputs: requirements.txt dev_requirements.txt + inputs: . lint: name: Code linters diff --git a/.github/workflows/pypi-publish.yaml b/.github/workflows/pypi-publish.yaml index 0d100dd12d..f69378c4d0 100644 --- a/.github/workflows/pypi-publish.yaml +++ b/.github/workflows/pypi-publish.yaml @@ -14,16 +14,10 @@ jobs: uses: actions/setup-python@v3 with: python-version: 3.9 - - name: Install dev tools - run: | - pip install -r dev_requirements.txt - pip install twine wheel - + - name: Install build + run: pip install build - name: Build package - run: | - python setup.py build - python setup.py sdist bdist_wheel - + run: python -m build . - name: Publish to Pypi uses: pypa/gh-action-pypi-publish@release/v1 with: diff --git a/INSTALL b/INSTALL deleted file mode 100644 index 951f7dea8a..0000000000 --- a/INSTALL +++ /dev/null @@ -1,6 +0,0 @@ - -Please use - python setup.py install - -and report errors to Andy McCurdy (sedrik@gmail.com) - diff --git a/MANIFEST.in b/MANIFEST.in deleted file mode 100644 index 97fa305889..0000000000 --- a/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include INSTALL -include LICENSE -include README.md -exclude __pycache__ -recursive-include tests * -recursive-exclude tests *.pyc diff --git a/dev_requirements.txt b/dev_requirements.txt index 31ae26ebea..22727fdb22 100644 --- a/dev_requirements.txt +++ b/dev_requirements.txt @@ -1,4 +1,5 @@ click==8.0.4 +build>=0.8.0 black==22.3.0 flake8==4.0.1 flynt~=0.69.0 diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000000..494479504a --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,58 @@ +[project] +name = "redis" +description = "Python client for Redis database and key-value store" +keywords = [ + "Redis", + "key-value store", + "database", +] +license = "MIT" +version = "4.4.0rc1" +authors = [ + { name = "Redis Inc.", email = "oss@redis.com" }, +] +requires-python = ">=3.7" +dependencies = [ + "deprecated>=1.2.3", + "packaging>=20.4", + "importlib-metadata >= 1.0; python_version < '3.8'", + "typing-extensions; python_version<'3.8'", + "async-timeout>=4.0.2", +] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Console", + "Intended Audience :: Developers", + "License :: OSI Approved :: MIT License", + "Operating System :: OS Independent", + "Programming Language :: Python", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3 :: Only", + "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 :: Implementation :: CPython", + "Programming Language :: Python :: Implementation :: PyPy", +] + +[project.urls] +Documentation = "https://redis.readthedocs.io/en/latest/" +Changes = "https://github.com/redis/redis-py/releases" +Code = "https://github.com/redis/redis-py" +"Issue tracker" = "https://github.com/redis/redis-py/issues" + +[project.optional-dependencies] +hiredis = [ + "hiredis>=1.0.0", +] +ocsp = [ + "cryptography>=36.0.1", + "pyopenssl==20.0.1", + "requests>=2.26.0", +] + +[build-system] +requires = ["hatchling"] +build-backend = "hatchling.build" diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index c40eca70e0..0000000000 --- a/requirements.txt +++ /dev/null @@ -1,4 +0,0 @@ -async-timeout>=4.0.2 -deprecated>=1.2.3 -packaging>=20.4 -typing-extensions; python_version<"3.8" diff --git a/setup.py b/setup.py deleted file mode 100644 index fb6d32a31d..0000000000 --- a/setup.py +++ /dev/null @@ -1,62 +0,0 @@ -#!/usr/bin/env python -from setuptools import find_packages, setup - -setup( - name="redis", - description="Python client for Redis database and key-value store", - long_description=open("README.md").read().strip(), - long_description_content_type="text/markdown", - keywords=["Redis", "key-value store", "database"], - license="MIT", - version="4.4.0rc1", - packages=find_packages( - include=[ - "redis", - "redis.asyncio", - "redis.commands", - "redis.commands.bf", - "redis.commands.json", - "redis.commands.search", - "redis.commands.timeseries", - "redis.commands.graph", - ] - ), - url="https://github.com/redis/redis-py", - project_urls={ - "Documentation": "https://redis.readthedocs.io/en/latest/", - "Changes": "https://github.com/redis/redis-py/releases", - "Code": "https://github.com/redis/redis-py", - "Issue tracker": "https://github.com/redis/redis-py/issues", - }, - author="Redis Inc.", - author_email="oss@redis.com", - python_requires=">=3.7", - install_requires=[ - "deprecated>=1.2.3", - "packaging>=20.4", - 'importlib-metadata >= 1.0; python_version < "3.8"', - 'typing-extensions; python_version<"3.8"', - "async-timeout>=4.0.2", - ], - classifiers=[ - "Development Status :: 5 - Production/Stable", - "Environment :: Console", - "Intended Audience :: Developers", - "License :: OSI Approved :: MIT License", - "Operating System :: OS Independent", - "Programming Language :: Python", - "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3 :: Only", - "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 :: Implementation :: CPython", - "Programming Language :: Python :: Implementation :: PyPy", - ], - extras_require={ - "hiredis": ["hiredis>=1.0.0"], - "ocsp": ["cryptography>=36.0.1", "pyopenssl==20.0.1", "requests>=2.26.0"], - }, -) diff --git a/tasks.py b/tasks.py index 64b3aef80f..2b326e3a85 100644 --- a/tasks.py +++ b/tasks.py @@ -79,4 +79,4 @@ def clean(c): @task def package(c): """Create the python packages""" - run("python setup.py sdist bdist_wheel") + run("python -m build .") diff --git a/tox.ini b/tox.ini index 6afafc2962..46bda167e7 100644 --- a/tox.ini +++ b/tox.ini @@ -15,6 +15,7 @@ asyncio_mode = auto minversion = 3.2.0 requires = tox-docker envlist = {standalone,cluster}-{plain,hiredis,ocsp}-{uvloop,asyncio}-{py37,py38,py39,pypy3},linters,docs +isolated_build = True [docker:master] name = master @@ -268,7 +269,6 @@ multi_line_output = 3 [testenv] deps = - -r {toxinidir}/requirements.txt -r {toxinidir}/dev_requirements.txt docker = unstable @@ -295,7 +295,6 @@ commands = [testenv:redis5] deps = - -r {toxinidir}/requirements.txt -r {toxinidir}/dev_requirements.txt docker = redis5_master @@ -315,7 +314,6 @@ commands = [testenv:redis4] deps = - -r {toxinidir}/requirements.txt -r {toxinidir}/dev_requirements.txt docker = redis4_master