Skip to content

Commit 0a52be9

Browse files
authored
Switch development dependencies to using uv instead of pip-tools (#48)
1 parent 42268ef commit 0a52be9

File tree

7 files changed

+394
-125
lines changed

7 files changed

+394
-125
lines changed

.github/workflows/pr_ci_i18n.yaml

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,15 @@ on:
1010
- synchronize
1111
paths:
1212
- "frontend/**"
13+
- "pyproject.toml"
14+
- "uv.lock"
1315
push:
1416
branches:
1517
- main
1618
paths:
1719
- "frontend/**"
20+
- "pyproject.toml"
21+
- "uv.lock"
1822

1923
jobs:
2024
i18n_check:
@@ -28,16 +32,14 @@ jobs:
2832
- name: Setup Python
2933
uses: actions/setup-python@v5
3034
with:
31-
python-version: "3.11"
35+
python-version: "3.12"
3236

33-
- name: Create Environment and Install Dependencies
34-
run: |
35-
python -m pip install --upgrade uv
36-
uv venv
37-
. .venv/bin/activate
38-
uv pip install -r requirements-dev.txt
39-
echo "$PWD/.venv/bin" >> $GITHUB_PATH
37+
- name: Install uv
38+
uses: astral-sh/setup-uv@v7
39+
40+
- name: Install Dependencies
41+
run: uv sync --frozen --all-extras
4042

4143
- name: Execute All i18n-check Key-Value Checks
4244
run: |
43-
i18n-check -a
45+
uv run i18n-check -a

CONTRIBUTING.md

Lines changed: 24 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -177,21 +177,27 @@ git remote add upstream https://github.com/scribe-org/scri.be.git
177177
- `origin` (forked repository)
178178
- `upstream` (scri.be repository)
179179

180-
4. Create a virtual environment for the developer tools, activate it and install dependencies:
180+
4. Create a virtual environment for i18n-check (Python `>=3.12`), activate it and install dependencies:
181181

182-
```bash
183-
# Unix or MacOS:
184-
python3 -m venv venv
185-
source venv/bin/activate
182+
> [!NOTE]
183+
> First, install `uv` if you don't already have it by following the [official installation guide](https://docs.astral.sh/uv/getting-started/installation/).
186184
187-
# Windows:
188-
python -m venv venv
189-
venv\Scripts\activate.bat
185+
```bash
186+
uv sync --all-extras # create .venv and install all dependencies from uv.lock
187+
188+
# Unix or macOS:
189+
source .venv/bin/activate
190+
191+
# Windows:
192+
.venv\Scripts\activate.bat # .venv\Scripts\activate.ps1 (PowerShell)
193+
```
190194

191-
# After activating venv:
192-
pip install --upgrade pip
193-
pip install -r requirements-dev.txt
194-
```
195+
> [!NOTE]
196+
> If you change dependencies in `pyproject.toml`, regenerate the lock file with the following command:
197+
>
198+
> ```bash
199+
> uv lock # refresh uv.lock for reproducible installs
200+
> ```
195201
196202
5. Start your docker images with the following:
197203
@@ -213,6 +219,7 @@ git remote add upstream https://github.com/scribe-org/scri.be.git
213219
```bash
214220
# In the project root:
215221
pre-commit install
222+
# uv run pre-commit run --all-files # lint and fix common problems in the codebase
216223
```
217224

218225
> [!NOTE]
@@ -222,6 +229,11 @@ git remote add upstream https://github.com/scribe-org/scri.be.git
222229
> pip install pre-commit
223230
> ```
224231
232+
You're now ready to work on `scri.be`!
233+
234+
> [!NOTE]
235+
> Feel free to contact the team in the [Web room on Matrix](https://matrix.to/#/#scri.be:matrix.org) if you're having problems getting your environment setup!
236+
225237
<a id="style-guide-"></a>
226238
227239
## Style guide [`⇧`](#contents)

README.md

Lines changed: 24 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -148,21 +148,27 @@ git remote add upstream https://github.com/scribe-org/scri.be.git
148148
- `origin` (forked repository)
149149
- `upstream` (scri.be repository)
150150

151-
4. Create a virtual environment for the developer tools, activate it and install dependencies:
151+
4. Create a virtual environment for i18n-check (Python `>=3.12`), activate it and install dependencies:
152152

153-
```bash
154-
# Unix or MacOS:
155-
python3 -m venv venv
156-
source venv/bin/activate
153+
> [!NOTE]
154+
> First, install `uv` if you don't already have it by following the [official installation guide](https://docs.astral.sh/uv/getting-started/installation/).
157155
158-
# Windows:
159-
python -m venv venv
160-
venv\Scripts\activate.bat
156+
```bash
157+
uv sync --all-extras # create .venv and install all dependencies from uv.lock
158+
159+
# Unix or macOS:
160+
source .venv/bin/activate
161161

162-
# After activating venv:
163-
pip install --upgrade pip
164-
pip install -r requirements-dev.txt
165-
```
162+
# Windows:
163+
.venv\Scripts\activate.bat # .venv\Scripts\activate.ps1 (PowerShell)
164+
```
165+
166+
> [!NOTE]
167+
> If you change dependencies in `pyproject.toml`, regenerate the lock file with the following command:
168+
>
169+
> ```bash
170+
> uv lock # refresh uv.lock for reproducible installs
171+
> ```
166172
167173
5. Start your docker images with the following:
168174
@@ -184,6 +190,7 @@ git remote add upstream https://github.com/scribe-org/scri.be.git
184190
```bash
185191
# In the project root:
186192
pre-commit install
193+
# uv run pre-commit run --all-files # lint and fix common problems in the codebase
187194
```
188195

189196
> [!NOTE]
@@ -193,6 +200,11 @@ git remote add upstream https://github.com/scribe-org/scri.be.git
193200
> pip install pre-commit
194201
> ```
195202
203+
You're now ready to work on `scri.be`!
204+
205+
> [!NOTE]
206+
> Feel free to contact the team in the [Web room on Matrix](https://matrix.to/#/#scri.be:matrix.org) if you're having problems getting your environment setup!
207+
196208
<a id="tech-stack"></a>
197209
198210
## Tech Stack [`⇧`](#contents)

pyproject.toml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
[project]
2+
name = "scri.be"
3+
version = "1.0.0"
4+
description = "Scribe's community portal scri.be"
5+
readme = "README.md"
6+
requires-python = ">=3.12"
7+
8+
dependencies = []
9+
10+
[project.optional-dependencies]
11+
dev = [
12+
# Keep docs dependencies formatted in this way with ruff to allow for upgrades via VS Code extension.
13+
"i18n-check>=1.18.0",
14+
"pre-commit>=4.5.1",
15+
]
16+
17+
[project.urls]
18+
Homepage = "https://github.com/scribe-org/scri.be"

requirements-dev.in

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

requirements-dev.txt

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

0 commit comments

Comments
 (0)