Skip to content

Commit 6380fb1

Browse files
authored
Merge pull request #808 from ae-utbm/update
Update Python and dependencies
2 parents 6918e30 + 341ffc9 commit 6380fb1

File tree

10 files changed

+374
-377
lines changed

10 files changed

+374
-377
lines changed

.github/actions/setup_project/action.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,16 @@ runs:
1616
shell: bash
1717

1818
- name: Set up python
19-
uses: actions/setup-python@v4
19+
uses: actions/setup-python@v5
2020
with:
21-
python-version: "3.10"
21+
python-version: "3.12"
2222

2323
- name: Load cached Poetry installation
2424
id: cached-poetry
2525
uses: actions/cache@v3
2626
with:
2727
path: ~/.local
28-
key: poetry-0 # increment to reset cache
28+
key: poetry-1 # increment to reset cache
2929

3030
- name: Install Poetry
3131
if: steps.cached-poetry.outputs.cache-hit != 'true'

.github/workflows/deploy.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@ jobs:
3636
export PATH="/home/sith/.local/bin:$PATH"
3737
pushd ${{secrets.SITH_PATH}}
3838
39-
git pull
39+
git fetch
40+
git reset --hard origin/master
4041
poetry install --with prod --without docs,tests
4142
poetry run ./manage.py install_xapian
4243
poetry run ./manage.py migrate

.github/workflows/deploy_docs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
deploy:
1010
runs-on: ubuntu-latest
1111
steps:
12-
- uses: actions/checkout@v3
12+
- uses: actions/checkout@v4
1313
- uses: ./.github/actions/setup_project
1414
- run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV
1515
- uses: actions/cache@v3

.github/workflows/taiste.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ jobs:
3535
export PATH="$HOME/.poetry/bin:$PATH"
3636
pushd ${{secrets.SITH_PATH}}
3737
38-
git pull
38+
git fetch
39+
git reset --hard origin/taiste
3940
poetry install --with prod --without docs,tests
4041
poetry run ./manage.py install_xapian
4142
poetry run ./manage.py migrate

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
repos:
22
- repo: https://github.com/astral-sh/ruff-pre-commit
33
# Ruff version.
4-
rev: v0.5.5
4+
rev: v0.5.7
55
hooks:
66
- id: ruff # just check the code, and print the errors
77
- id: ruff # actually fix the fixable errors, but print nothing

club/models.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@
2323
#
2424
from __future__ import annotations
2525

26+
from typing import Self
27+
2628
from django.conf import settings
2729
from django.core import validators
2830
from django.core.cache import cache
@@ -265,12 +267,11 @@ def has_rights_in_club(self, user):
265267

266268

267269
class MembershipQuerySet(models.QuerySet):
268-
def ongoing(self) -> "MembershipQuerySet":
270+
def ongoing(self) -> Self:
269271
"""Filter all memberships which are not finished yet."""
270-
# noinspection PyTypeChecker
271272
return self.filter(Q(end_date=None) | Q(end_date__gte=timezone.now()))
272273

273-
def board(self) -> "MembershipQuerySet":
274+
def board(self) -> Self:
274275
"""Filter all memberships where the user is/was in the board.
275276
276277
Be aware that users who were in the board in the past
@@ -279,7 +280,6 @@ def board(self) -> "MembershipQuerySet":
279280
If you want to get the users who are currently in the board,
280281
mind combining this with the :meth:`ongoing` queryset method
281282
"""
282-
# noinspection PyTypeChecker
283283
return self.filter(role__gt=settings.SITH_MAXIMUM_FREE_ROLE)
284284

285285
def update(self, **kwargs):

counter/models.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,6 @@ def annotate_has_barman(self, user: User) -> CounterQuerySet:
362362
```
363363
"""
364364
subquery = user.counters.filter(pk=OuterRef("pk"))
365-
# noinspection PyTypeChecker
366365
return self.annotate(has_annotated_barman=Exists(subquery))
367366

368367

poetry.lock

Lines changed: 354 additions & 359 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ homepage = "https://ae.utbm.fr/"
2020
license = "GPL-3.0-only"
2121

2222
[tool.poetry.dependencies]
23-
python = "^3.10"
23+
python = "^3.12"
2424
Django = "^4.2.14"
25-
django-ninja = "^1.2.2"
26-
django-ninja-extra = "^0.21.2"
25+
django-ninja = "^1.3.0"
26+
django-ninja-extra = "^0.21.4"
2727
Pillow = "^10.4.0"
2828
mistune = "^3.0.2"
2929
django-jinja = "^2.11"
@@ -63,7 +63,7 @@ optional = true
6363
django-debug-toolbar = "^4.4.6"
6464
ipython = "^8.26.0"
6565
pre-commit = "^3.8.0"
66-
ruff = "^0.5.5" # Version used in pipeline is controlled by pre-commit hooks in .pre-commit.config.yaml
66+
ruff = "^0.5.7" # Version used in pipeline is controlled by pre-commit hooks in .pre-commit.config.yaml
6767
djhtml = "^3.0.6"
6868
faker = "^26.1.0"
6969
rjsmin = "^1.2.2"

sas/models.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
from __future__ import annotations
1717

1818
from io import BytesIO
19+
from typing import Self
1920

2021
from django.conf import settings
2122
from django.core.cache import cache
@@ -61,7 +62,7 @@ def can_be_edited_by(self, user):
6162

6263

6364
class PictureQuerySet(models.QuerySet):
64-
def viewable_by(self, user: User) -> PictureQuerySet:
65+
def viewable_by(self, user: User) -> Self:
6566
"""Filter the pictures that this user can view.
6667
6768
Warnings:
@@ -173,7 +174,7 @@ def get_previous(self):
173174

174175

175176
class AlbumQuerySet(models.QuerySet):
176-
def viewable_by(self, user: User) -> PictureQuerySet:
177+
def viewable_by(self, user: User) -> Self:
177178
"""Filter the albums that this user can view.
178179
179180
Warnings:

0 commit comments

Comments
 (0)