Skip to content

Commit 4da01fb

Browse files
committed
Adding uv
1 parent 9008110 commit 4da01fb

File tree

5 files changed

+2555
-16
lines changed

5 files changed

+2555
-16
lines changed

CHANGELOG.md

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,16 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
This project (not yet) adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## Unreleased
9+
10+
### Fixed
11+
12+
- Images remain in the upload section through validation
13+
14+
### Changed
15+
16+
- Using uv as python package manager now
17+
818
## mB-v2509.1
919

1020
### Changed
@@ -373,9 +383,3 @@ count as labels)
373383
- actions: only create actions for phases and projects if the project is not
374384
a draft (!1437)
375385
- reformat CHANGELOG.md
376-
377-
## Unreleased
378-
379-
### Fixed
380-
381-
- Images remain in the upload section through validation

Makefile

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
all: help
22

3-
VIRTUAL_ENV ?= venv
3+
VIRTUAL_ENV ?= .venv
44
SOURCE_DIRS = adhocracy4 tests
55
NODE_BIN = node_modules/.bin
66
ARGUMENTS=$(filter-out $(firstword $(MAKECMDGOALS)), $(MAKECMDGOALS))
@@ -30,9 +30,12 @@ help:
3030
.PHONY: install
3131
install:
3232
npm install
33-
if [ ! -f $(VIRTUAL_ENV)/bin/python3 ]; then python3 -m venv $(VIRTUAL_ENV); fi
34-
$(VIRTUAL_ENV)/bin/pip install -r requirements/dev.txt
35-
33+
@if [ ! -f $(VIRTUAL_ENV)/bin/pip ]; then python3 -m venv $(VIRTUAL_ENV); fi
34+
@if ! command -v uv --version; then \
35+
$(VIRTUAL_ENV)/bin/pip install pipx; \
36+
$(VIRTUAL_ENV)/bin/pipx install uv; \
37+
fi
38+
uv sync --all-groups
3639
.PHONY: clean
3740
clean:
3841
if [ -f package-lock.json ]; then rm package-lock.json; fi

README.md

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,26 @@ To try it out yourself, best start with [a+][https://github.com/liqd/adhocracy-p
2424
git clone https://github.com/liqd/adhocracy4.git
2525
cd adhocracy4
2626
make install
27+
# make install adds an installation of uv in a global virtual env via pipx
28+
# Uv install the packages to .venv
2729

28-
## Start virtual environment
30+
## Use Make
31+
make test
32+
make help
33+
34+
## Development
35+
To add a new Library use uv
2936
```
30-
source venv/bin/activate
37+
uv add module
3138
```
32-
## Check if tests work
39+
this automaticly updates pyproject.toml and uv.lock
40+
41+
## Virtual Enviroment
42+
if you want to do something inside the venv manually use
3343
```
34-
make test
44+
uv run python manage.py ...
3545
```
46+
(which invokes .venev/bin/python manage.py ... )
3647

3748

3849

pyproject.toml

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ dependencies = [
2525
"django-allauth",
2626
"django-autoslug",
2727
"django-background-tasks",
28-
"django-ckeditor-5",
28+
"django-ckeditor-5 @ https://github.com/liqd/django-ckeditor-5/releases/download/v0.2.11-liqd/django_ckeditor_5-0.2.11-py3-none-any.whl",
2929
"django-enumfield",
3030
"django-filter",
3131
"django-multiselectfield",
@@ -40,10 +40,26 @@ dependencies = [
4040
"python-magic",
4141
"requests",
4242
"rules",
43+
"whitenoise>=6.7.0",
4344
"XlsxWriter",
4445
]
4546
dynamic = ["version"]
4647

48+
[dependency-groups]
49+
dev = [
50+
"black",
51+
"factory-boy",
52+
"Faker",
53+
"flake8",
54+
"freezegun",
55+
"isort",
56+
"psycopg[binary]",
57+
"pytest",
58+
"pytest-cov",
59+
"pytest-django",
60+
"pytest-factoryboy",
61+
]
62+
4763
[project.urls]
4864
"Homepage" = "https://github.com/liqd/adhocracy4"
4965
"Bug Tracker" = "https://github.com/liqd/adhocracy4/issues"
@@ -55,7 +71,7 @@ include = ["adhocracy4"]
5571

5672
[tool.isort]
5773
profile = "black"
58-
skip = ["node_modules", "venv"]
74+
skip = ["node_modules", "venv", ".venv"]
5975
skip_glob = ["*/migrations/*.py"]
6076
known_first_party = ["adhocracy4", "tests"]
6177
force_single_line = true

0 commit comments

Comments
 (0)