Skip to content

Commit f7ec289

Browse files
committed
Migrate to uv
1 parent dd016e8 commit f7ec289

8 files changed

Lines changed: 76 additions & 78 deletions

File tree

‎.github/workflows/backend.yml‎

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -27,22 +27,18 @@ jobs:
2727
with:
2828
python-version: '3.12'
2929

30-
- name: Install pipenv
31-
run: python3 -m pip install --upgrade pipenv wheel virtualenv
30+
- name: Install uv
31+
run: python3 -m pip install --upgrade uv wheel virtualenv
3232
working-directory: backend
3333

34-
- id: cache-pipenv
34+
- id: cache-uv
3535
uses: actions/cache@v4
3636
with:
3737
path: ~/.local/share/virtualenvs
38-
key: ${{ runner.os }}-pipenv-${{ hashFiles('**/Pipfile.lock') }}
39-
40-
- name: Install dependencies
41-
run: pipenv install -d
42-
working-directory: backend
38+
key: ${{ runner.os }}-uv-${{ hashFiles('**/Pipfile.lock') }}
4339

4440
- name: Run tests
45-
run: pipenv run pytest --cov --cov-report=xml .
41+
run: uv run pytest --cov --cov-report=xml .
4642
working-directory: backend
4743
env:
4844
ENVIRONMENT: CI
@@ -53,21 +49,21 @@ jobs:
5349
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
5450

5551
- name: Run mypy
56-
run: pipenv run mypy --version && pipenv run mypy .
52+
run: uv run mypy --version && uv run mypy .
5753
working-directory: backend
5854

5955
- name: Run pylint
60-
run: pipenv run pylint bracket tests cli.py
56+
run: uv run pylint bracket tests cli.py
6157
working-directory: backend
6258

6359
- name: Run ruff format
64-
run: pipenv run ruff format --check .
60+
run: uv run ruff format --check .
6561
working-directory: backend
6662

6763
- name: Run ruff
68-
run: pipenv run ruff check .
64+
run: uv run ruff check .
6965
working-directory: backend
7066

7167
- name: Run vulture
72-
run: '! pipenv run vulture |grep "unused function\|unused class\|unused method"'
68+
run: '! uv run vulture |grep "unused function\|unused class\|unused method"'
7369
working-directory: backend

‎README.md‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ be able to view bracket at http://localhost:3000. You can log in with the follow
9090

9191
To insert dummy rows into the database, run:
9292
```bash
93-
sudo docker exec bracket-backend pipenv run ./cli.py create-dev-db
93+
sudo docker exec bracket-backend uv run ./cli.py create-dev-db
9494
```
9595

9696
See also the [quickstart docs](https://docs.bracketapp.nl/docs/running-bracket/quickstart).
@@ -109,12 +109,12 @@ The frontend doesn't can be configured by environment variables as well, as well
109109
# Running Bracket in production
110110
Read the [deployment docs](https://docs.bracketapp.nl/docs/deployment) for how to deploy Bracket and run it in production.
111111

112-
Bracket can be run in Docker or by itself (using `pipenv` and `yarn`).
112+
Bracket can be run in Docker or by itself (using `uv` and `yarn`).
113113

114114
# Development setup
115115
Read the [development docs](https://docs.bracketapp.nl/docs/community/development) for how to run Bracket for development.
116116

117-
Prerequisites are `yarn`, `postgresql` and `pipenv` to run the frontend, database and backend.
117+
Prerequisites are `yarn`, `postgresql` and `uv` to run the frontend, database and backend.
118118

119119
# Translations
120120
Based on your browser settings, your language should be automatically detected and loaded. For now,

‎backend/Dockerfile‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ FROM python:3.12-alpine3.17
22
ARG packages
33
RUN apk --update add ${packages} \
44
&& rm -rf /var/cache/apk/* \
5-
&& pip3 install --upgrade pip pipenv wheel virtualenv
5+
&& pip3 install --upgrade pip uv wheel virtualenv
66

77
COPY . /app
88
WORKDIR /app
@@ -13,16 +13,16 @@ RUN addgroup --system bracket && adduser --system bracket --ingroup bracket \
1313
USER bracket
1414

1515
RUN set -ex \
16-
&& pip3 install --upgrade pip pipenv wheel virtualenv \
17-
&& pipenv install --deploy
16+
&& pip3 install --upgrade pip uv wheel virtualenv \
17+
&& uv install --deploy
1818

1919
EXPOSE 8400
2020

2121
HEALTHCHECK --interval=10s --timeout=5s --retries=5 \
2222
CMD ["wget", "--spider", "http://localhost:8400/ping", "||", "exit", "1"]
2323

2424
CMD [ \
25-
"pipenv", \
25+
"uv", \
2626
"run", \
2727
"gunicorn", \
2828
"-k", "uvicorn.workers.UvicornWorker", \

‎backend/Pipfile‎

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

‎backend/pyproject.toml‎

Lines changed: 54 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,36 @@
1+
[project]
2+
name = "Bracket backend"
3+
version = "0.0.1"
4+
requires-python = ">=3.12"
5+
dependencies = [
6+
"aiofiles==24.1.0",
7+
"aiohttp==3.12.2",
8+
"aiopg==1.4.0",
9+
"alembic==1.16.1",
10+
"bcrypt==4.3.0",
11+
"click==8.2.0",
12+
"databases[asyncpg]<=0.8.0",
13+
"fastapi==0.116.0",
14+
"fastapi-sso==0.18.0",
15+
"gunicorn==23.0.0",
16+
"heliclockter==2.0.0",
17+
"parameterized==0.9.0",
18+
"passlib==1.7.4",
19+
"pydantic==2.11.1",
20+
"pydantic_settings==2.1.0",
21+
"pyjwt==2.10.1",
22+
"python-dotenv==1.1.0",
23+
"python-multipart==0.0.20",
24+
"sentry-sdk==2.35.0",
25+
"sqlalchemy==1.4.54",
26+
"sqlalchemy-stubs==0.4",
27+
"starlette==0.46.2",
28+
"types-aiofiles==24.1.0.20241221",
29+
"types-passlib==1.7.7.20241221",
30+
"types-simplejson==3.20.0.20250218",
31+
"uvicorn==0.35.0",
32+
]
33+
134
[tool.pytest.ini_options]
235
addopts = [
336
'--junitxml=.junit_report.xml',
@@ -14,10 +47,20 @@ filterwarnings = [
1447
'ignore:.*The event_loop fixture provided by pytest-asyncio has been redefined.*:DeprecationWarning',
1548
'ignore:.*Please use `import python_multipart` instead.*:PendingDeprecationWarning',
1649
]
17-
# Enable these once `asyncio_default_test_loop_scope` has been released
18-
# Then remove the `@pytest.mark.asyncio(loop_scope="session")` calls.
19-
#asyncio_default_fixture_loop_scope = "session"
20-
#asyncio_default_test_loop_scope = "session"
50+
51+
[dependency-groups]
52+
dev = [
53+
"aioresponses==0.7.4",
54+
"mypy==1.17.0",
55+
"pluggy==1.6.0",
56+
"pylint==3.3.1",
57+
"pytest==8.4.0",
58+
"pytest-asyncio==1.1.0",
59+
"pytest-cov==6.2.0",
60+
"pytest-xdist==3.8.0",
61+
"ruff==0.12.2",
62+
"vulture==2.14",
63+
]
2164

2265
[tool.mypy]
2366
junit_xml = '.junit_report.xml'
@@ -38,13 +81,19 @@ filterwarnings = [
3881
no_implicit_reexport = true
3982
show_error_codes = true
4083

84+
[tool.uv]
85+
package = false
86+
87+
[[tool.uv.index]]
88+
name = "pypi"
89+
url = "https://pypi.org/simple"
90+
4191
[tool.pydantic-mypy]
4292
init_forbid_extra = true
4393
init_typed = true
4494
warn_required_dynamic_aliases = true
4595
warn_untyped_fields = true
4696

47-
# Per-module options:
4897
[[tool.mypy.overrides]]
4998
module = ['aioresponses.*']
5099
disallow_any_explicit = false

‎docs/content/community/development.mdx‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ The database URL can be specified per environment in the `.env` files (see
3535

3636
## Running the frontend and backend
3737

38-
To run Bracket (frontend and backend) locally without Docker, one needs `yarn` and `pipenv`.
38+
To run Bracket (frontend and backend) locally without Docker, one needs `yarn` and `uv`.
3939

4040
The following starts the frontend and backend for local development in the root
4141
directory of Bracket:
@@ -63,8 +63,8 @@ yarn run dev
6363

6464
```bash
6565
cd backend
66-
pipenv install -d
67-
pipenv shell
66+
uv install -d
67+
uv shell
6868
./run.sh
6969
```
7070

‎docs/content/deployment/nomad.mdx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ job "bracket-backend" {
4646
config {
4747
image = "ghcr.io/evroon/bracket-backend"
4848
ports = ["uvicorn"]
49-
command = "pipenv"
49+
command = "uv"
5050
args = [
5151
"run",
5252
"uvicorn",

‎run.sh‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ function run_frontend() {
66
}
77

88
function run_backend() {
9-
cd backend && ENVIRONMENT=DEVELOPMENT pipenv run gunicorn \
9+
cd backend && ENVIRONMENT=DEVELOPMENT uv run gunicorn \
1010
-k bracket.uvicorn.RestartableUvicornWorker \
1111
bracket.app:app \
1212
--bind localhost:8400 \

0 commit comments

Comments
 (0)