diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml index a3512b46dc..f61b2da2f7 100644 --- a/.github/workflows/docs.yaml +++ b/.github/workflows/docs.yaml @@ -36,7 +36,7 @@ jobs: sudo apt-get install -yqq pandoc make - name: run code linters run: | - pip install -r requirements.txt -r dev_requirements.txt -r docs/requirements.txt + pip install -e . -r dev_requirements.txt -r docs/requirements.txt invoke build-docs - name: upload docs diff --git a/.github/workflows/integration.yaml b/.github/workflows/integration.yaml index 8f60efe6c7..3bf8b7e0e1 100644 --- a/.github/workflows/integration.yaml +++ b/.github/workflows/integration.yaml @@ -32,9 +32,9 @@ jobs: - uses: actions/checkout@v4 - uses: pypa/gh-action-pip-audit@v1.0.8 with: - inputs: requirements.txt dev_requirements.txt ignore-vulns: | GHSA-w596-4wvx-j9j6 # subversion related git pull, dependency for pytest. There is no impact here. + inputs: . lint: name: Code linters @@ -72,8 +72,7 @@ jobs: - name: run tests run: | pip install -U setuptools wheel - pip install -r requirements.txt - pip install -r dev_requirements.txt + pip install -e . -r dev_requirements.txt if [ "${{matrix.connection-type}}" == "hiredis" ]; then pip install hiredis fi @@ -126,8 +125,7 @@ jobs: - name: run tests run: | pip install -U setuptools wheel - pip install -r requirements.txt - pip install -r dev_requirements.txt + pip install -e . -r dev_requirements.txt if [ "${{matrix.connection-type}}" == "hiredis" ]; then pip install hiredis fi diff --git a/.github/workflows/pypi-publish.yaml b/.github/workflows/pypi-publish.yaml index 108dfa6da5..865e026339 100644 --- a/.github/workflows/pypi-publish.yaml +++ b/.github/workflows/pypi-publish.yaml @@ -23,9 +23,7 @@ jobs: pip install twine wheel - name: Build package - run: | - python setup.py build - python setup.py sdist bdist_wheel + run: python -m build . - name: Basic package test prior to upload run: | diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index d87e6ba1c3..79983e4cb5 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -38,7 +38,7 @@ Here's how to get started with your code contribution: a. python -m venv .venv b. source .venv/bin/activate c. pip install -r dev_requirements.txt - c. pip install -r requirements.txt + c. pip install -e . 4. If you need a development environment, run `invoke devenv`. Note: this relies on docker-compose to build environments, and assumes that you have a version supporting [docker profiles](https://docs.docker.com/compose/profiles/). 5. While developing, make sure the tests pass by running `invoke tests` 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 48ec278d83..3eddc32696 100644 --- a/dev_requirements.txt +++ b/dev_requirements.txt @@ -1,5 +1,6 @@ click==8.0.4 black==24.3.0 +build>=0.8.0 cachetools flake8==5.0.4 flake8-isort==6.0.0 diff --git a/docs/examples/opentelemetry/README.md b/docs/examples/opentelemetry/README.md index a1d1c04eda..58085c9637 100644 --- a/docs/examples/opentelemetry/README.md +++ b/docs/examples/opentelemetry/README.md @@ -24,7 +24,7 @@ source .venv/bin/active **Step 3**. Install dependencies: ```shell -pip install -r requirements.txt +pip install -e . ``` **Step 4**. Start the services using Docker and make sure Uptrace is running: diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000000..8de7a8586c --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,61 @@ +[build-system] +requires = ["hatchling"] +build-backend = "hatchling.build" + +[project] +name = "redis" +version = "5.1.0b6" +description = "Python client for Redis database and key-value store" +readme = "README.md" +license = "MIT" +requires-python = ">=3.8" +authors = [ + { name = "Redis Inc.", email = "oss@redis.com" }, +] +keywords = [ + "Redis", + "database", + "key-value-store", +] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Console", + "Intended Audience :: Developers", + "License :: OSI Approved :: MIT License", + "Operating System :: OS Independent", + "Programming Language :: Python :: 3 :: Only", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: Implementation :: CPython", + "Programming Language :: Python :: Implementation :: PyPy", + "Programming Language :: Python", +] +dependencies = [ + 'async-timeout>=4.0.3; python_full_version<"3.11.3"', + 'typing-extensions; python_version<"3.8"', +] + +[project.optional-dependencies] +hiredis = [ + "hiredis>=1.0.0", +] +ocsp = [ + "cryptography>=36.0.1", + "pyopenssl==20.0.1", + "requests>=2.26.0", +] + +[project.urls] +Changes = "https://github.com/redis/redis-py/releases" +Code = "https://github.com/redis/redis-py" +Documentation = "https://redis.readthedocs.io/en/latest/" +Homepage = "https://github.com/redis/redis-py" +"Issue tracker" = "https://github.com/redis/redis-py/issues" + +[tool.hatch.build.targets.sdist] +include = [ + "/redis", +] diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index a716b84463..0000000000 --- a/requirements.txt +++ /dev/null @@ -1 +0,0 @@ -async-timeout>=4.0.2 diff --git a/setup.py b/setup.py deleted file mode 100644 index 8df216ccea..0000000000 --- a/setup.py +++ /dev/null @@ -1,61 +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="5.1.0b6", - packages=find_packages( - include=[ - "redis", - "redis._parsers", - "redis.asyncio", - "redis.commands", - "redis.commands.bf", - "redis.commands.json", - "redis.commands.search", - "redis.commands.timeseries", - "redis.commands.graph", - "redis.parsers", - ] - ), - package_data={"redis": ["py.typed"]}, - include_package_data=True, - 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.8", - install_requires=[ - 'async-timeout>=4.0.3; python_full_version<"3.11.3"', - ], - 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.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 7f26081150..d8aa459e97 100644 --- a/tasks.py +++ b/tasks.py @@ -91,4 +91,4 @@ def clean(c): @task def package(c): """Create the python packages""" - run("python setup.py sdist bdist_wheel") + run("python -m build .")