Skip to content

Commit 9b8e704

Browse files
committed
docs(contributing): update development setup and testing instructions
- Mark uv installation as optional - Revise environment initialization commands - Update test running examples - Modify pre-commit and linting tool usage - Adjust Docker Compose command for cluster tests - Correct license file reference to LICENSE.md
1 parent 3c22d89 commit 9b8e704

File tree

1 file changed

+24
-23
lines changed

1 file changed

+24
-23
lines changed

CONTRIBUTING.md

Lines changed: 24 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ We welcome feature requests and suggestions. To propose an enhancement:
4040
cd redis_func_cache
4141
```
4242

43-
3. [uv](https://docs.astral.sh/uv/) is the recommended package and project manager. Commonly install it using a package manager, or install it using one of the following commands:
43+
3. (_optional_) [uv](https://docs.astral.sh/uv/) is the recommended package and project manager. Commonly install it using a package manager, or install it using one of the following commands:
4444

4545
- On Unix-like systems:
4646

@@ -62,10 +62,20 @@ We welcome feature requests and suggestions. To propose an enhancement:
6262

6363
- Or any other way to install [uv][]
6464

65-
4. Sync the development environment and install dependencies:
65+
4. initialize the development environment
66+
67+
If you are using [uv][], run:
68+
69+
```bash
70+
uv sync --all-extras
71+
```
72+
73+
or if you are using pip:
6674

6775
```bash
68-
uv sync --all-extras --dev
76+
python -m venv .venv
77+
source .venv/bin/activate
78+
pip install -e .[all] --group dev
6979
```
7080

7181
A virtual environment is created at directory `.venv`. You can activate it by running `source .venv/bin/activate` or `.venv/Scripts/activate` on Windows.
@@ -74,17 +84,6 @@ A virtual environment is created at directory `.venv`. You can activate it by ru
7484

7585
Before submitting changes, ensure all tests pass:
7686

77-
```bash
78-
# Run all tests
79-
uv run pytest
80-
81-
# Run tests with coverage
82-
uv run pytest --cov
83-
84-
# Run specific test categories
85-
uv run pytest tests/test_basic.py
86-
```
87-
8887
#### Code Style
8988

9089
We use several tools to maintain code quality:
@@ -99,12 +98,14 @@ To run checks manually:
9998

10099
```bash
101100
# Run all pre-commit checks
102-
uv run pre-commit run -a
101+
pre-commit run -a
102+
103+
# Run lint and format
104+
ruff check --fix
105+
ruff format
103106
104-
# Run specific checks
105-
uv run ruff check
106-
uv run ruff format
107-
uv run mypy
107+
# Run static type checking
108+
mypy
108109
```
109110

110111
#### Making Changes
@@ -119,17 +120,17 @@ uv run mypy
119120

120121
3. Add tests for new functionality
121122

122-
4. Ensure all tests pass (you shall run redis server on localhost:6379 before running tests):
123+
4. Ensure all tests pass (you may run redis server on localhost:6379 before running tests):
123124

124125
```bash
125-
uv run pytest
126+
pytest -xv --cov
126127
```
127128

128129
If the changes are concerned with Redis cluster, it is recommended to run the tests against a Redis cluster by docker compose:
129130

130131
```bash
131132
cd docker
132-
docker compose up
133+
docker compose up --abort-on-container-exit
133134
```
134135

135136
If you have standalone Redis server(s) running, you can run the tests against it/them by setting the environment variables
@@ -198,4 +199,4 @@ If you need help with your contribution:
198199
199200
## License
200201
201-
By contributing to redis_func_cache, you agree that your contributions will be licensed under what described in the LICENSE file.
202+
By contributing to redis_func_cache, you agree that your contributions will be licensed under what described in the `LICENSE.md` file.

0 commit comments

Comments
 (0)