Skip to content

Commit 0f335c3

Browse files
akxofek
andcommitted
Switch to PEP 517 packaging using hatchling
Refs redis#1316 Refs redis#1649 Remake of redis#2388 Co-authored-by: Ofek Lev <ofekmeister@gmail.com>
1 parent d6ddb0d commit 0f335c3

File tree

9 files changed

+70
-27
lines changed

9 files changed

+70
-27
lines changed

Diff for: .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 -e . -r dev_requirements.txt -r docs/requirements.txt
4040
invoke build-docs
4141
4242
- name: upload docs

Diff for: .github/workflows/integration.yaml

+3-7
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838
- uses: actions/checkout@v4
3939
- uses: pypa/gh-action-pip-audit@v1.0.8
4040
with:
41-
inputs: requirements.txt dev_requirements.txt
41+
inputs: .
4242
ignore-vulns: |
4343
GHSA-w596-4wvx-j9j6 # subversion related git pull, dependency for pytest. There is no impact here.
4444
@@ -79,9 +79,7 @@ jobs:
7979

8080
- name: Run tests
8181
run: |
82-
pip install -U setuptools wheel
83-
pip install -r requirements.txt
84-
pip install -r dev_requirements.txt
82+
pip install -e . -r dev_requirements.txt
8583
if [ "${{matrix.connection-type}}" == "hiredis" ]; then
8684
pip install hiredis
8785
fi
@@ -146,9 +144,7 @@ jobs:
146144

147145
- name: Run tests
148146
run: |
149-
pip install -U setuptools wheel
150-
pip install -r requirements.txt
151-
pip install -r dev_requirements.txt
147+
pip install -e . -r dev_requirements.txt
152148
if [ "${{matrix.connection-type}}" == "hiredis" ]; then
153149
pip install hiredis
154150
fi

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

+2-4
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,10 @@ jobs:
2020
- name: Install dev tools
2121
run: |
2222
pip install -r dev_requirements.txt
23-
pip install twine wheel
23+
pip install build twine wheel
2424
2525
- name: Build package
26-
run: |
27-
python setup.py build
28-
python setup.py sdist bdist_wheel
26+
run: python -m build .
2927

3028
- name: Basic package test prior to upload
3129
run: |

Diff for: CONTRIBUTING.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ Here's how to get started with your code contribution:
3838
a. python -m venv .venv
3939
b. source .venv/bin/activate
4040
c. pip install -r dev_requirements.txt
41-
c. pip install -r requirements.txt
41+
c. pip install -e .
4242

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

Diff for: INSTALL

-6
This file was deleted.

Diff for: MANIFEST.in

-6
This file was deleted.

Diff for: docs/examples/opentelemetry/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ source .venv/bin/active
2424
**Step 3**. Install dependencies:
2525

2626
```shell
27-
pip install -r requirements.txt
27+
pip install -e .
2828
```
2929

3030
**Step 4**. Start the services using Docker and make sure Uptrace is running:

Diff for: pyproject.toml

+61
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
[build-system]
2+
requires = ["hatchling"]
3+
build-backend = "hatchling.build"
4+
5+
[project]
6+
name = "redis"
7+
version = "5.1.0b7"
8+
description = "Python client for Redis database and key-value store"
9+
readme = "README.md"
10+
license = "MIT"
11+
requires-python = ">=3.8"
12+
authors = [
13+
{ name = "Redis Inc.", email = "oss@redis.com" },
14+
]
15+
keywords = [
16+
"Redis",
17+
"database",
18+
"key-value-store",
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 :: 3 :: Only",
27+
"Programming Language :: Python :: 3",
28+
"Programming Language :: Python :: 3.8",
29+
"Programming Language :: Python :: 3.9",x
30+
"Programming Language :: Python :: 3.10",
31+
"Programming Language :: Python :: 3.11",
32+
"Programming Language :: Python :: 3.12",
33+
"Programming Language :: Python :: Implementation :: CPython",
34+
"Programming Language :: Python :: Implementation :: PyPy",
35+
"Programming Language :: Python",
36+
]
37+
dependencies = [
38+
'async-timeout>=4.0.3; python_full_version<"3.11.3"',
39+
]
40+
41+
[project.optional-dependencies]
42+
hiredis = [
43+
"hiredis>=3.0.0",
44+
]
45+
ocsp = [
46+
"cryptography>=36.0.1",
47+
"pyopenssl==20.0.1",
48+
"requests>=2.26.0",
49+
]
50+
51+
[project.urls]
52+
Changes = "https://github.com/redis/redis-py/releases"
53+
Code = "https://github.com/redis/redis-py"
54+
Documentation = "https://redis.readthedocs.io/en/latest/"
55+
Homepage = "https://github.com/redis/redis-py"
56+
"Issue tracker" = "https://github.com/redis/redis-py/issues"
57+
58+
[tool.hatch.build.targets.sdist]
59+
include = [
60+
"/redis",
61+
]

Diff for: tasks.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -91,4 +91,4 @@ def clean(c):
9191
@task
9292
def package(c):
9393
"""Create the python packages"""
94-
run("python setup.py sdist bdist_wheel")
94+
run("python -m build .")

0 commit comments

Comments
 (0)