Skip to content

Commit b0d9b12

Browse files
authored
Switch from setup.py to pyproject.toml (#230)
Highly inspired by #96 by @ds-cbo (Thanks!) Signed-off-by: Mikhail Koviazin <[email protected]>
1 parent 9ac253a commit b0d9b12

File tree

18 files changed

+135
-149
lines changed

18 files changed

+135
-149
lines changed

.github/wordlist.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ firsttimersonly
9090
fo
9191
genindex
9292
gmail
93+
hatchling
9394
html
9495
http
9596
https
@@ -128,6 +129,7 @@ pubsub
128129
punsubscribe
129130
py
130131
pypi
132+
pyproject
131133
quickstart
132134
readonly
133135
readwrite
@@ -149,6 +151,7 @@ subcommands
149151
thevalueofmykey
150152
timeseries
151153
toctree
154+
toml
152155
topk
153156
triaging
154157
txt

.github/workflows/docs.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ jobs:
3838
sudo apt-get install -yqq pandoc make
3939
- name: run code linters
4040
run: |
41-
pip install -r requirements.txt -r dev_requirements.txt -r docs/requirements.txt
41+
pip install --group dev --group docs
42+
pip install .
4243
invoke build-docs
4344
4445
- name: upload docs

.github/workflows/install_and_test.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ if [ -d ${DESTENV} ]; then
1919
fi
2020
python -m venv ${DESTENV}
2121
source ${DESTENV}/bin/activate
22-
pip install --upgrade --quiet pip setuptools wheel
23-
pip install --quiet -r dev_requirements.txt
22+
pip install --upgrade --quiet pip
23+
pip install --quiet --group dev
2424
invoke devenv
2525
invoke package
2626

.github/workflows/integration.yaml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
- uses: actions/checkout@v5
3333
- uses: pypa/[email protected]
3434
with:
35-
inputs: requirements.txt dev_requirements.txt
35+
inputs: .
3636
ignore-vulns: |
3737
GHSA-w596-4wvx-j9j6 # subversion related git pull, dependency for pytest. There is no impact here.
3838
@@ -47,7 +47,7 @@ jobs:
4747
cache: 'pip'
4848
- name: run code linters
4949
run: |
50-
pip install -r dev_requirements.txt
50+
pip install --group dev
5151
invoke linters
5252
5353
get-date:
@@ -115,9 +115,8 @@ jobs:
115115

116116
- name: run tests
117117
run: |
118-
pip install -U setuptools wheel
119-
pip install -r requirements.txt
120-
pip install -r dev_requirements.txt
118+
pip install --group dev
119+
pip install .
121120
if [ "${{matrix.connection-type}}" == "libvalkey" ]; then
122121
pip install "libvalkey>=4.0.1"
123122
fi

.github/workflows/pypi-publish.yaml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,12 @@ jobs:
2222
python-version: 3.9
2323
- name: Install dev tools
2424
run: |
25-
pip install -r dev_requirements.txt
26-
pip install twine wheel
25+
pip install --group dev
26+
pip install twine
2727
2828
- name: Build package
2929
run: |
30-
python setup.py build
31-
python setup.py sdist bdist_wheel
30+
hatchling build
3231
3332
- name: Basic package test prior to upload
3433
run: |

.readthedocs.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
version: 2
22

3-
python:
4-
install:
5-
- requirements: ./docs/requirements.txt
6-
- requirements: requirements.txt
7-
83
build:
94
os: ubuntu-20.04
105
tools:
116
python: "3.13"
7+
jobs:
8+
install:
9+
- pip install --upgrade pip
10+
- pip install --group docs
11+
- pip install .
1212

1313
sphinx:
1414
configuration: docs/conf.py

CONTRIBUTING.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -89,12 +89,11 @@ Here's how to get started with your code contribution:
8989
1. Create your own fork of valkey-py
9090
2. Do the changes in your fork
9191
3.
92-
*Create a virtualenv and install the development dependencies from the dev_requirements.txt file:*
92+
*Create a virtualenv and install the development dependencies from the dev group:*
9393

9494
a. python -m venv .venv
9595
b. source .venv/bin/activate
96-
c. pip install -r dev_requirements.txt
97-
c. pip install -r requirements.txt
96+
c. pip install --group dev
9897

9998
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/).
10099
5. While developing, make sure the tests pass by running `invoke tests`
@@ -105,8 +104,7 @@ To see what else is part of the automation, run `invoke -l`
105104

106105
## The Development Environment
107106

108-
Running `invoke devenv` installs the development dependencies specified
109-
in the dev_requirements.txt. It starts all of the dockers used by this
107+
Running `invoke devenv` starts all of the dockers used by this
110108
project, and leaves them running. These can be easily cleaned up with
111109
`invoke clean`. NOTE: it is assumed that the user running these tests,
112110
can execute docker and its various commands.

INSTALL

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11

22
Please use
3-
python setup.py install
4-
5-
and report errors to via https://github.com/valkey-io/valkey-py/issues/new
3+
pip install .
64

5+
and report errors to us via https://github.com/valkey-io/valkey-py/issues/new

MANIFEST.in

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

dev_requirements.txt

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

0 commit comments

Comments
 (0)