Skip to content

Commit cc39d30

Browse files
akxofek
andcommitted
Switch to PEP 517 packaging using hatchling
Refs #1316 Refs #1649 Remake of #2388 Co-authored-by: Ofek Lev <[email protected]>
1 parent 1cbb97e commit cc39d30

File tree

12 files changed

+71
-90
lines changed

12 files changed

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

.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/[email protected]
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
@@ -131,9 +129,7 @@ jobs:
131129

132130
- name: Run tests
133131
run: |
134-
pip install -U setuptools wheel
135-
pip install -r requirements.txt
136-
pip install -r dev_requirements.txt
132+
pip install -e . -r dev_requirements.txt
137133
if [ "${{matrix.connection-type}}" == "hiredis" ]; then
138134
pip install hiredis
139135
fi

.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: |

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`

INSTALL

-6
This file was deleted.

MANIFEST.in

-6
This file was deleted.

dev_requirements.txt

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
black==24.3.0
2+
build>=0.8.0
23
cachetools
34
click==8.0.4
45
flake8-isort

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:

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 = "[email protected]" },
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+
]

requirements.txt

-1
This file was deleted.

setup.py

-62
This file was deleted.

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)