Skip to content

Commit 50afeed

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 3a0c724 commit 50afeed

File tree

12 files changed

+70
-86
lines changed

12 files changed

+70
-86
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-5
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@ jobs:
3232
- uses: actions/checkout@v4
3333
- uses: pypa/[email protected]
3434
with:
35-
inputs: requirements.txt dev_requirements.txt
3635
ignore-vulns: |
3736
GHSA-w596-4wvx-j9j6 # subversion related git pull, dependency for pytest. There is no impact here.
37+
inputs: .
3838

3939
lint:
4040
name: Code linters
@@ -72,8 +72,7 @@ jobs:
7272
- name: run tests
7373
run: |
7474
pip install -U setuptools wheel
75-
pip install -r requirements.txt
76-
pip install -r dev_requirements.txt
75+
pip install -e . -r dev_requirements.txt
7776
if [ "${{matrix.connection-type}}" == "hiredis" ]; then
7877
pip install hiredis
7978
fi
@@ -126,8 +125,7 @@ jobs:
126125
- name: run tests
127126
run: |
128127
pip install -U setuptools wheel
129-
pip install -r requirements.txt
130-
pip install -r dev_requirements.txt
128+
pip install -e . -r dev_requirements.txt
131129
if [ "${{matrix.connection-type}}" == "hiredis" ]; then
132130
pip install hiredis
133131
fi

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

+1-3
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,7 @@ jobs:
2323
pip install 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: dev_requirements.txt

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
click==8.0.4
22
black==24.3.0
3+
build>=0.8.0
34
cachetools
45
flake8==5.0.4
56
flake8-isort==6.0.0

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.0b6"
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.10",
29+
"Programming Language :: Python :: 3.11",
30+
"Programming Language :: Python :: 3.8",
31+
"Programming Language :: Python :: 3.9",
32+
"Programming Language :: Python :: Implementation :: CPython",
33+
"Programming Language :: Python :: Implementation :: PyPy",
34+
"Programming Language :: Python",
35+
]
36+
dependencies = [
37+
'async-timeout>=4.0.3; python_full_version<"3.11.3"',
38+
'typing-extensions; python_version<"3.8"',
39+
]
40+
41+
[project.optional-dependencies]
42+
hiredis = [
43+
"hiredis>=1.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: requirements.txt

-1
This file was deleted.

Diff for: setup.py

-61
This file was deleted.

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)