Skip to content

Commit f98b8e1

Browse files
committed
Switch to PEP 517 packaging using hatchling
Refs redis#1316 Refs redis#1649
1 parent 66c4e60 commit f98b8e1

10 files changed

+65
-92
lines changed

Diff for: .github/workflows/integration.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
- uses: actions/checkout@v3
2626
- uses: pypa/gh-action-pip-audit@v1.0.0
2727
with:
28-
inputs: requirements.txt dev_requirements.txt
28+
inputs: .
2929

3030
lint:
3131
name: Code linters

Diff for: .github/workflows/pypi-publish.yaml

+3-9
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,10 @@ jobs:
1414
uses: actions/setup-python@v3
1515
with:
1616
python-version: 3.9
17-
- name: Install dev tools
18-
run: |
19-
pip install -r dev_requirements.txt
20-
pip install twine wheel
21-
17+
- name: Install build
18+
run: pip install build
2219
- name: Build package
23-
run: |
24-
python setup.py build
25-
python setup.py sdist bdist_wheel
26-
20+
run: python -m build .
2721
- name: Publish to Pypi
2822
uses: pypa/gh-action-pypi-publish@release/v1
2923
with:

Diff for: INSTALL

-6
This file was deleted.

Diff for: MANIFEST.in

-6
This file was deleted.

Diff for: dev_requirements.txt

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
click==8.0.4
2+
build>=0.8.0
23
black==22.3.0
34
flake8==4.0.1
45
flynt~=0.69.0

Diff for: pyproject.toml

+58
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
[project]
2+
name = "redis"
3+
description = "Python client for Redis database and key-value store"
4+
keywords = [
5+
"Redis",
6+
"key-value store",
7+
"database",
8+
]
9+
license = "MIT"
10+
version = "4.4.0rc1"
11+
url = "https://github.com/redis/redis-py"
12+
author = "Redis Inc."
13+
author_email = "oss@redis.com"
14+
requires-python = ">=3.7"
15+
dependencies = [
16+
"deprecated>=1.2.3",
17+
"packaging>=20.4",
18+
"importlib-metadata >= 1.0; python_version < \"3.8\"",
19+
"typing-extensions; python_version<\"3.8\"",
20+
"async-timeout>=4.0.2",
21+
]
22+
classifiers = [
23+
"Development Status :: 5 - Production/Stable",
24+
"Environment :: Console",
25+
"Intended Audience :: Developers",
26+
"License :: OSI Approved :: MIT License",
27+
"Operating System :: OS Independent",
28+
"Programming Language :: Python",
29+
"Programming Language :: Python :: 3",
30+
"Programming Language :: Python :: 3 :: Only",
31+
"Programming Language :: Python :: 3.7",
32+
"Programming Language :: Python :: 3.8",
33+
"Programming Language :: Python :: 3.9",
34+
"Programming Language :: Python :: 3.10",
35+
"Programming Language :: Python :: 3.11",
36+
"Programming Language :: Python :: Implementation :: CPython",
37+
"Programming Language :: Python :: Implementation :: PyPy",
38+
]
39+
40+
[project.urls]
41+
Documentation = "https://redis.readthedocs.io/en/latest/"
42+
Changes = "https://github.com/redis/redis-py/releases"
43+
Code = "https://github.com/redis/redis-py"
44+
"Issue tracker" = "https://github.com/redis/redis-py/issues"
45+
46+
[project.optional-dependencies]
47+
hiredis = [
48+
"hiredis>=1.0.0",
49+
]
50+
ocsp = [
51+
"cryptography>=36.0.1",
52+
"pyopenssl==20.0.1",
53+
"requests>=2.26.0",
54+
]
55+
56+
[build-system]
57+
requires = ["hatchling"]
58+
build-backend = "hatchling.build"

Diff for: requirements.txt

-4
This file was deleted.

Diff for: setup.py

-62
This file was deleted.

Diff for: tasks.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -79,4 +79,4 @@ def clean(c):
7979
@task
8080
def package(c):
8181
"""Create the python packages"""
82-
run("python setup.py sdist bdist_wheel")
82+
run("python -m build .")

Diff for: tox.ini

+1-3
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ asyncio_mode = auto
1515
minversion = 3.2.0
1616
requires = tox-docker
1717
envlist = {standalone,cluster}-{plain,hiredis,ocsp}-{uvloop,asyncio}-{py37,py38,py39,pypy3},linters,docs
18+
isolated_build = True
1819

1920
[docker:master]
2021
name = master
@@ -268,7 +269,6 @@ multi_line_output = 3
268269

269270
[testenv]
270271
deps =
271-
-r {toxinidir}/requirements.txt
272272
-r {toxinidir}/dev_requirements.txt
273273
docker =
274274
unstable
@@ -295,7 +295,6 @@ commands =
295295

296296
[testenv:redis5]
297297
deps =
298-
-r {toxinidir}/requirements.txt
299298
-r {toxinidir}/dev_requirements.txt
300299
docker =
301300
redis5_master
@@ -315,7 +314,6 @@ commands =
315314

316315
[testenv:redis4]
317316
deps =
318-
-r {toxinidir}/requirements.txt
319317
-r {toxinidir}/dev_requirements.txt
320318
docker =
321319
redis4_master

0 commit comments

Comments
 (0)