You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+24-23Lines changed: 24 additions & 23 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -40,7 +40,7 @@ We welcome feature requests and suggestions. To propose an enhancement:
40
40
cd redis_func_cache
41
41
```
42
42
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:
44
44
45
45
- On Unix-like systems:
46
46
@@ -62,10 +62,20 @@ We welcome feature requests and suggestions. To propose an enhancement:
62
62
63
63
- Or any other way to install [uv][]
64
64
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:
66
74
67
75
```bash
68
-
uv sync --all-extras --dev
76
+
python -m venv .venv
77
+
source .venv/bin/activate
78
+
pip install -e .[all] --group dev
69
79
```
70
80
71
81
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
74
84
75
85
Before submitting changes, ensure all tests pass:
76
86
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
-
88
87
#### Code Style
89
88
90
89
We use several tools to maintain code quality:
@@ -99,12 +98,14 @@ To run checks manually:
99
98
100
99
```bash
101
100
# 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
103
106
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
108
109
```
109
110
110
111
#### Making Changes
@@ -119,17 +120,17 @@ uv run mypy
119
120
120
121
3. Add tests for new functionality
121
122
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):
123
124
124
125
```bash
125
-
uv run pytest
126
+
pytest -xv --cov
126
127
```
127
128
128
129
If the changes are concerned with Redis cluster, it is recommended to run the tests against a Redis cluster by docker compose:
129
130
130
131
```bash
131
132
cd docker
132
-
docker compose up
133
+
docker compose up --abort-on-container-exit
133
134
```
134
135
135
136
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:
198
199
199
200
## License
200
201
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