Skip to content

Commit b3c69a3

Browse files
committed
convert to pyproject.toml
1 parent 8e2f2d3 commit b3c69a3

16 files changed

+102
-128
lines changed

.github/workflows/docs.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636
sudo apt-get install -yqq pandoc make
3737
- name: run code linters
3838
run: |
39-
pip install -r requirements.txt -r dev_requirements.txt -r docs/requirements.txt
39+
pip install .[dev,docbuild]
4040
invoke build-docs
4141
4242
- name: upload docs

.github/workflows/integration.yaml

+1-12
Original file line numberDiff line numberDiff line change
@@ -32,17 +32,6 @@ env:
3232
CURRENT_REDIS_VERSION: '7.4.1'
3333

3434
jobs:
35-
dependency-audit:
36-
name: Dependency audit
37-
runs-on: ubuntu-latest
38-
steps:
39-
- uses: actions/checkout@v4
40-
- uses: pypa/gh-action-pip-audit@v1.0.8
41-
with:
42-
inputs: requirements.txt dev_requirements.txt
43-
ignore-vulns: |
44-
GHSA-w596-4wvx-j9j6 # subversion related git pull, dependency for pytest. There is no impact here.
45-
4635
lint:
4736
name: Code linters
4837
runs-on: ubuntu-latest
@@ -54,7 +43,7 @@ jobs:
5443
cache: 'pip'
5544
- name: run code linters
5645
run: |
57-
pip install -r dev_requirements.txt
46+
pip install .[dev]
5847
invoke linters
5948
6049
redis_version:

.github/workflows/pypi-publish.yaml

+3-4
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,12 @@ jobs:
2020
python-version: 3.9
2121
- name: Install dev tools
2222
run: |
23-
pip install -r dev_requirements.txt
24-
pip install twine wheel
23+
pip install .[dev]
24+
pip install twine wheel build
2525
2626
- name: Build package
2727
run: |
28-
python setup.py build
29-
python setup.py sdist bdist_wheel
28+
python -m build
3029
3130
- name: Basic package test prior to upload
3231
run: |

CONTRIBUTING.md

+2-3
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,11 @@ Here's how to get started with your code contribution:
3333
1. Create your own fork of redis-py
3434
2. Do the changes in your fork
3535
3.
36-
*Create a virtualenv and install the development dependencies from the dev_requirements.txt file:*
36+
*Create a virtualenv and install the project with dependencies:*
3737

3838
a. python -m venv .venv
3939
b. source .venv/bin/activate
40-
c. pip install -r dev_requirements.txt
41-
c. pip install -r requirements.txt
40+
c. pip install -e .
4241

4342
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/).
4443
5. While developing, make sure the tests pass by running `invoke tests`

INSTALL

-6
This file was deleted.

MANIFEST.in

-6
This file was deleted.

dev_requirements.txt

-19
This file was deleted.

doctests/README.md

+2-4
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,10 @@ See https://github.com/redis-stack/redis-stack-website#readme for more details.
1313
## How to test examples
1414

1515
Examples are standalone python scripts, committed to the *doctests* directory. These scripts assume that the
16-
```requirements.txt``` and ```dev_requirements.txt``` from this repository have been installed, as per below.
16+
dependencies from this repository have been installed, as per below.
1717

1818
```bash
19-
pip install -r requirements.txt
20-
pip install -r dev_requirements.txt
21-
pip install -r doctests/requirements.txt
19+
pip install .[dev,doctest]
2220
```
2321

2422
Note - the CI process, runs the basic ```black``` and ```isort``` linters against the examples. Assuming

doctests/requirements.txt

-5
This file was deleted.

pyproject.toml

+91
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
[build-system]
2+
requires = ["setuptools>=42"]
3+
build-backend = "setuptools.build_meta"
4+
5+
[project]
6+
name = "redis"
7+
version = "5.3.0b4"
8+
description = "Python client for Redis database and key-value store"
9+
readme = "README.md"
10+
keywords = ["Redis", "key-value store", "database"]
11+
license = {text = "MIT"}
12+
authors = [
13+
{name = "Redis Inc.", email = "oss@redis.com"}
14+
]
15+
requires-python = ">=3.8"
16+
dependencies = [
17+
"async-timeout>=4.0.3; python_full_version < \"3.11.3\"",
18+
"PyJWT~=2.9.0"
19+
]
20+
classifiers = [
21+
"Development Status :: 5 - Production/Stable",
22+
"Environment :: Console",
23+
"Intended Audience :: Developers",
24+
"License :: OSI Approved :: MIT License",
25+
"Operating System :: OS Independent",
26+
"Programming Language :: Python",
27+
"Programming Language :: Python :: 3",
28+
"Programming Language :: Python :: 3 :: Only",
29+
"Programming Language :: Python :: 3.8",
30+
"Programming Language :: Python :: 3.9",
31+
"Programming Language :: Python :: 3.10",
32+
"Programming Language :: Python :: 3.11",
33+
"Programming Language :: Python :: 3.12",
34+
"Programming Language :: Python :: Implementation :: CPython",
35+
"Programming Language :: Python :: Implementation :: PyPy"
36+
]
37+
38+
[project.urls]
39+
Homepage = "https://github.com/redis/redis-py"
40+
Documentation = "https://redis.readthedocs.io/en/latest/"
41+
Repository = "https://github.com/redis/redis-py"
42+
Issues = "https://github.com/redis/redis-py/issues"
43+
Changes = "https://github.com/redis/redis-py/releases"
44+
45+
[project.optional-dependencies]
46+
hiredis = ["hiredis>=3.0.0"]
47+
ocsp = ["cryptography>=36.0.1", "pyopenssl==23.2.1", "requests>=2.31.0"]
48+
dev = [
49+
"black==24.3.0",
50+
"click==8.0.4",
51+
"flake8-isort",
52+
"flake8",
53+
"flynt~=0.69.0",
54+
"invoke==2.2.0",
55+
"mock",
56+
"packaging>=20.4",
57+
"pytest",
58+
"pytest-asyncio>=0.23.0,<0.24.0",
59+
"pytest-cov",
60+
"pytest-profiling==1.7.0",
61+
"pytest-timeout",
62+
"ujson>=4.2.0",
63+
"uvloop",
64+
"vulture>=2.3.0",
65+
"wheel>=0.30.0",
66+
"numpy>=1.24.0",
67+
"redis-entraid>=0.1.0b1"
68+
]
69+
docbuild = [
70+
"sphinx>=5.0,<7.0",
71+
"docutils<0.18",
72+
"nbsphinx",
73+
"sphinx_gallery",
74+
"ipython",
75+
"sphinx-autodoc-typehints",
76+
"furo",
77+
"pandoc"
78+
]
79+
doctest = [
80+
"numpy",
81+
"pandas",
82+
"requests",
83+
"sentence_transformers",
84+
"tabulate"
85+
]
86+
87+
[tool.setuptools.packages.find]
88+
where = ["redis", "tests"]
89+
90+
[tool.setuptools.package-data]
91+
redis = ["py.typed"]

requirements.txt

-2
This file was deleted.

setup.py

-64
This file was deleted.

tasks.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ def devenv(c, endpoints="all"):
2020
@task
2121
def build_docs(c):
2222
"""Generates the sphinx documentation."""
23-
run("pip install -r docs/requirements.txt")
23+
run("pip install .[doc]")
2424
run("make -C docs html")
2525

2626

@@ -97,4 +97,4 @@ def clean(c):
9797
@task
9898
def package(c):
9999
"""Create the python packages"""
100-
run("python setup.py sdist bdist_wheel")
100+
run("python -m build")

tests/test_asyncio/testdata/__init__.py

Whitespace-only changes.

tests/test_parsers/__init__.py

Whitespace-only changes.

tests/testdata/__init__.py

Whitespace-only changes.

0 commit comments

Comments
 (0)