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
-[Privacy and Data Protection Guidelines](#privacy-and-data-protection-guidelines)
20
26
21
27
## Community Discussions
@@ -65,6 +71,14 @@ We also use the following tools for development.
65
71
We recommend using [pipx](https://pypa.github.io/pipx/installation/) to
66
72
install the development tools.
67
73
74
+
#### UV Package Manager
75
+
76
+
We use [uv](https://github.com/astral-sh/uv), a modern Python package manager built for speed and reliability. Install it using pipx:
77
+
78
+
```sh
79
+
pipx install uv
80
+
```
81
+
68
82
#### Pre-commit
69
83
70
84
We use pre-commit to run various code quality commands prior to each commit.
@@ -85,6 +99,12 @@ pre-commit install
85
99
86
100
Whenever you develop, make sure you are in the project's virtual environment.
87
101
102
+
Create a virtual environment using UV:
103
+
104
+
```sh
105
+
uv venv .venv
106
+
```
107
+
88
108
Linux / OSX:
89
109
90
110
```sh
@@ -99,11 +119,18 @@ Windows:
99
119
100
120
### Install dependencies
101
121
102
-
Once you have the above prerequisites installed, install the project development
103
-
dependencies as follows.
122
+
Once you have the above prerequisites installed, install the project dependencies using UV.
123
+
124
+
For production dependencies:
104
125
105
126
```sh
106
-
pip install -r requirements.dev.txt
127
+
uv sync
128
+
```
129
+
130
+
For development dependencies (includes testing tools):
131
+
132
+
```sh
133
+
uv sync --dev
107
134
```
108
135
109
136
### Migrations
@@ -139,6 +166,66 @@ When all migrations are applied and you have a superuser, run the server as foll
139
166
python manage.py runserver
140
167
```
141
168
169
+
## Package Management with UV
170
+
171
+
### Adding New Dependencies
172
+
173
+
To add a new dependency to the project:
174
+
175
+
```sh
176
+
# Add a regular dependency
177
+
uv add package-name
178
+
179
+
# Add a development dependency
180
+
uv add --dev package-name
181
+
182
+
# Add a dependency with a specific version
183
+
uv add "package-name>=1.0,<2.0"
184
+
```
185
+
186
+
These commands will automatically update your pyproject.toml file and create/update the lock file.
187
+
188
+
### Benefits of UV
189
+
190
+
UV provides several advantages over traditional package management tools:
191
+
192
+
-**Speed**: UV is dramatically faster at resolving and installing dependencies
193
+
-**Reliability**: Consistent installations across environments with lock file support
194
+
-**Dependency Groups**: Cleaner separation between production and development dependencies
195
+
-**Modern Features**: Native support for PEP 517/518 standards with pyproject.toml
196
+
-**Unified Interface**: Single tool for Python version management and package management
197
+
198
+
### Updating Dependencies
199
+
200
+
To update dependencies to their latest compatible versions:
201
+
202
+
```sh
203
+
# Update all dependencies
204
+
uv sync --upgrade
205
+
206
+
# Update specific dependency
207
+
uv add --upgrade package-name
208
+
```
209
+
210
+
### Other Useful UV Commands
211
+
212
+
```sh
213
+
# View dependency tree
214
+
uv tree
215
+
216
+
# Lock dependencies without installing
217
+
uv lock
218
+
219
+
# Run a script within the project environment
220
+
uv run python manage.py runserver
221
+
222
+
# Check for outdated packages
223
+
uv list --outdated
224
+
225
+
# Remove a dependency
226
+
uv remove package-name
227
+
```
228
+
142
229
## Privacy and Data Protection Guidelines
143
230
144
231
As an open-source community committed to upholding the highest standards of privacy and data security, we align our practices with principles derived from the General Data Protection Regulation (GDPR) and other similar privacy frameworks. While some GDPR principles are more relevant at an organizational level, many can be directly applied to software development, especially in features involving user data. Below are key guidelines that contributors should follow:
0 commit comments