-
-
Notifications
You must be signed in to change notification settings - Fork 142
Replace pip
with uv
#579
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Replace pip
with uv
#579
Changes from all commits
ef1ed5c
456eca8
ee8b5ea
985c4f5
617ffad
cf73476
56e3f32
990f824
6634c9b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,15 @@ | ||
image: "archlinux:latest" | ||
|
||
before_script: | ||
- pacman -Syu --needed --noconfirm python-pip git | ||
- pip install coverage flake8 | ||
- pip install -r requirements.txt | ||
- python manage.py collectstatic --noinput | ||
- pacman -Syu --needed --noconfirm git uv | ||
- uv sync | ||
- uv run python manage.py collectstatic --noinput | ||
|
||
lint: | ||
script: | ||
- flake8 --exclude "*/migrations/" devel main mirrors news packages releng templates todolists visualize *.py | ||
- uv run flake8 --exclude "*/migrations/" devel main mirrors news packages releng templates todolists visualize *.py | ||
|
||
# TODO: https://docs.gitlab.com/ee/ci/junit_test_reports.html | ||
test: | ||
script: | ||
- coverage run --rcfile .coveragerc manage.py test | ||
- uv run coverage run --rcfile .coveragerc manage.py test |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,15 +18,15 @@ test-pdb: test | |
.PHONY: test lint coverage | ||
|
||
lint: | ||
flake8 --extend-exclude "*/migrations/,local_settings.py" devel main mirrors news packages releng templates todolists visualize *.py | ||
uv run flake8 --extend-exclude "*/migrations/,local_settings.py" devel main mirrors news packages releng templates todolists visualize *.py | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. should re-evaluate if ruff already has the formatting rules, or ugh There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. "replaces", not entirely most of the E1 rules are not yet implemented and if implemented are preview rules. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Anyway, this will be handled in a follow up by moving to ruff format |
||
|
||
collectstatic: | ||
python manage.py collectstatic --noinput | ||
uv run python manage.py collectstatic --noinput | ||
|
||
test: test-py | ||
|
||
test-py coverage: | ||
DJANGO_SETTINGS_MODULE=settings ${PYTEST} ${PYTEST_OPTIONS} ${PYTEST_COVERAGE_OPTIONS} ${PYTEST_INPUT} | ||
DJANGO_SETTINGS_MODULE=settings uv run ${PYTEST} ${PYTEST_OPTIONS} ${PYTEST_COVERAGE_OPTIONS} ${PYTEST_INPUT} | ||
|
||
open-coverage: coverage | ||
${BROWSER} htmlcov/index.html |
Original file line number | Diff line number | Diff line change | ||
---|---|---|---|---|
@@ -1,10 +1,9 @@ | ||||
import cssmin | ||||
import jsmin | ||||
from django.contrib.staticfiles.storage import ManifestStaticFilesStorage | ||||
from django.core.files.base import ContentFile | ||||
from django.utils.encoding import smart_str | ||||
|
||||
import cssmin | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could it be that you are running a different version of archweb/.github/workflows/main.yml Line 19 in 59229f2
This is one of the benefits of managing dependencies with |
||||
|
||||
|
||||
class MinifiedStaticFilesStorage(ManifestStaticFilesStorage): | ||||
""" | ||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,7 +16,7 @@ def dictfetchall(cursor): | |
"Returns all rows from a cursor as a dict." | ||
desc = cursor.description | ||
return [ | ||
dict(zip([col[0] for col in desc], row)) | ||
dict(zip([col[0] for col in desc], row, strict=False)) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This seems to be a place where |
||
for row in cursor.fetchall() | ||
] | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,55 @@ | ||
[project] | ||
name = "archweb" | ||
version = "0.1.0" | ||
description = "Archlinux website code" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Arch Linux ;-) |
||
readme = "README.md" | ||
requires-python = ">=3.13" | ||
dependencies = [ | ||
"bencode-py==4.0.0", | ||
"bleach==6.0.0", | ||
"django==5.1.10", | ||
"django-countries==7.6.1", | ||
"django-csp==4.0", | ||
"django-extensions==4.1", | ||
"django-prometheus==2.3.1", | ||
"feedparser==6.0.11", | ||
"ipy==1.1", | ||
"jsmin==3.0.1", | ||
"markdown==3.3.7", | ||
"parse==1.20.2", | ||
"pgpdump==1.5", | ||
"ptpython==2.0.4", | ||
"requests==2.32.4", | ||
"sqlparse==0.5.0", | ||
"xtarfile==0.2.1", | ||
"zstandard==0.23.0", | ||
] | ||
|
||
[dependency-groups] | ||
dev = [ | ||
"flake8>=7.3.0", | ||
"pytest>=8.4.1", | ||
"pytest-cov>=6.2.1", | ||
"pytest-django>=4.11.1", | ||
"ruff>=0.12.11", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. venv managed ruff :( There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This will still be in There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Right, but I prefer system linters ;-) |
||
] | ||
prod = [ | ||
"pyasyncore==1.0.4", | ||
"pyinotify==0.9.6", | ||
"pymemcache==3.5.0", | ||
] | ||
smtp = [ | ||
"aiosmtpd>=1.4.6", | ||
] | ||
|
||
[tool.ruff] | ||
line-length = 118 | ||
exclude = [ | ||
"*/migrations/*.py", # Ignore Django migrations | ||
"src/cssmin/*" # cssmin, not our code | ||
] | ||
|
||
[lint] | ||
[tool.ruff.lint] | ||
select = [ | ||
"A", # flake8-builtins | ||
"B", # flake8-bugbear | ||
|
@@ -33,8 +82,3 @@ ignore = [ | |
"DJ008", # Model does not define `__str__` method | ||
"DJ012", # Order of model's inner classes, methods, and fields does not follow the Django Style Guide: `Meta` class should come before `get_absolute_url` | ||
] | ||
|
||
exclude = [ | ||
"*/migrations/*.py", # Ignore Django migrations | ||
"src/cssmin/*" # cssmin, not our code | ||
] |
This file was deleted.
This file was deleted.
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
renovatebot/renovate#34494