Skip to content

Commit 5cbc526

Browse files
akxofek
authored andcommitted
Switch to PEP 517 packaging using hatchling (redis#2930)
* Switch to PEP 517 packaging using hatchling Refs redis#1316 Refs redis#1649 Remake of redis#2388 Co-authored-by: Ofek Lev <[email protected]> * Use a single source of truth for version info * Uninstall redis wheel installed as redis-entraid dep * Add build as dev_requirement * Get rid of requirements.txt * Get rid of setuptools and wheel deps * Move pytest configuration to pyproject.toml * Retain tests and dev_requirements.txt in sdist --------- Co-authored-by: Ofek Lev <[email protected]>
1 parent 70142d8 commit 5cbc526

File tree

16 files changed

+110
-127
lines changed

16 files changed

+110
-127
lines changed

.github/actions/run-tests/action.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@ runs:
3636
set -e
3737
3838
echo "::group::Installing dependencies"
39-
pip install -U setuptools wheel
40-
pip install -r requirements.txt
4139
pip install -r dev_requirements.txt
40+
pip uninstall -y redis # uninstall Redis package installed via redis-entraid
41+
pip install -e . # install the working copy
4242
if [ "${{inputs.parser-backend}}" == "hiredis" ]; then
4343
pip install "hiredis${{inputs.hiredis-version}}"
4444
echo "PARSER_BACKEND=$(echo "${{inputs.parser-backend}}_${{inputs.hiredis-version}}" | sed 's/[^a-zA-Z0-9]/_/g')" >> $GITHUB_ENV

.github/workflows/docs.yaml

Lines changed: 1 addition & 1 deletion
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 -r dev_requirements.txt -r docs/requirements.txt
4040
invoke build-docs
4141
4242
- name: upload docs

.github/workflows/install_and_test.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ python -m venv ${DESTENV}
2121
source ${DESTENV}/bin/activate
2222
pip install --upgrade --quiet pip
2323
pip install --quiet -r dev_requirements.txt
24+
pip uninstall -y redis # uninstall Redis package installed via redis-entraid
2425
invoke devenv --endpoints=all-stack
2526
invoke package
2627

.github/workflows/integration.yaml

Lines changed: 2 additions & 1 deletion
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: dev_requirements.txt
4242
ignore-vulns: |
4343
GHSA-w596-4wvx-j9j6 # subversion related git pull, dependency for pytest. There is no impact here.
4444
@@ -54,6 +54,7 @@ jobs:
5454
- name: run code linters
5555
run: |
5656
pip install -r dev_requirements.txt
57+
pip uninstall -y redis # uninstall Redis package installed via redis-entraid
5758
invoke linters
5859
5960
redis_version:

.github/workflows/pypi-publish.yaml

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,10 @@ jobs:
1818
uses: actions/setup-python@v5
1919
with:
2020
python-version: 3.9
21-
- name: Install dev tools
22-
run: |
23-
pip install -r dev_requirements.txt
24-
pip install twine wheel
21+
- run: pip install build twine
2522

2623
- name: Build package
27-
run: |
28-
python setup.py build
29-
python setup.py sdist bdist_wheel
24+
run: python -m build .
3025

3126
- name: Basic package test prior to upload
3227
run: |

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
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

Lines changed: 0 additions & 6 deletions
This file was deleted.

MANIFEST.in

Lines changed: 0 additions & 8 deletions
This file was deleted.

dev_requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
build
12
black==24.3.0
23
click==8.0.4
34
flake8-isort
@@ -14,6 +15,5 @@ pytest-timeout
1415
ujson>=4.2.0
1516
uvloop
1617
vulture>=2.3.0
17-
wheel>=0.30.0
1818
numpy>=1.24.0
1919
redis-entraid==0.3.0b1

docs/examples/opentelemetry/README.md

Lines changed: 1 addition & 1 deletion
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:

0 commit comments

Comments
 (0)