Skip to content

Commit

Permalink
Passage à Python 3.9 et mise à jour des dépendances (zestedesavoir#6530)
Browse files Browse the repository at this point in the history
  • Loading branch information
Situphen authored Oct 7, 2023
1 parent ae460de commit c1c773c
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 16 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:

env:
NODE_VERSION: "16" # needs to be also updated in .nvmrc
PYTHON_VERSION: "3.7"
PYTHON_VERSION: "3.9"
MARIADB_VERSION: "10.4.10"
COVERALLS_VERSION: "3.3.1" # check if Coverage needs to be also updated in requirements-ci.txt
GECKODRIVER_VERSION: "0.33.0"
Expand Down
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
repos:
- repo: https://github.com/asottile/pyupgrade
rev: v3.3.2 # version 3.4.0 doesn't work with Python 3.7
rev: v3.13.0
hooks:
- id: pyupgrade
args: [--py37-plus]
- repo: https://github.com/psf/black
rev: 23.3.0 # needs to be also updated in requirements-dev.txt
args: [--py39-plus]
- repo: https://github.com/psf/black-pre-commit-mirror
rev: 23.9.1 # needs to be also updated in requirements-dev.txt
hooks:
- id: black
language_version: python3
Expand Down
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ clean-back: ## Remove Python bytecode files (*.pyc)
find . -name '*.pyc' -exec rm {} \;

list-outdated-back: ## List outdated Python packages
@echo 'Info: You need to check `easy-thumbnails` version manually!'
@echo "Package Version Latest Type"
@echo "----------------------- --------- --------- -----"
@pip list --outdated | grep "`awk -F== '{ print $$1 }' requirements*.txt | tr -s '\n' '\n' | sort`"
Expand Down
2 changes: 1 addition & 1 deletion doc/source/install/install-macos.rst
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ Pour vérifier, exécutez la commande suivante :

python --version

Si vous obtenez une version inférieure à Python 3.7 (et notamment si vous voyez
Si vous obtenez une version inférieure à Python 3.9 (et notamment si vous voyez
``Python 2.7``), il vous faudra installer une version récente de Python avec
Homebrew. Sinon, vous pouvez utiliser la version intégrée avec macOS de Python,
mais vous devrez installer ``pip``.
Expand Down
8 changes: 4 additions & 4 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
-r requirements.txt

black==23.3.0 # needs to be also updated in .pre-commit-config.yaml
black==23.9.1 # needs to be also updated in .pre-commit-config.yaml
colorlog==6.7.0
django-debug-toolbar==3.8.1
django-extensions==3.2.3
Faker==18.13.0
pre-commit==2.21.0
Faker==19.6.2
pre-commit==3.4.0
PyYAML==6.0.1
selenium==4.9.1
Sphinx==5.3.0
Sphinx==7.2.6
sphinx-rtd-theme==1.3.0
6 changes: 3 additions & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,18 @@ django-model-utils==4.3.1
django-munin==0.2.1
django-recaptcha==3.0.0
Django==3.2.21
easy-thumbnails[svg]==2.8.3
easy-thumbnails[svg]==2.8.5
factory-boy==3.3.0
geoip2==4.7.0
GitPython==3.1.37
homoglyphs==2.0.4
lxml==4.9.3
Pillow==9.5.0
Pillow==10.0.1
pymemcache==4.0.0
requests==2.31.0

# Api dependencies
django-cors-headers==4.1.0
django-cors-headers==4.2.0
django-filter==23.3
django-oauth-toolkit==1.7.0
djangorestframework==3.14.0
Expand Down
5 changes: 3 additions & 2 deletions zds/utils/templatetags/humanize_duration.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import logging
import numbers
from typing import Tuple, List, Iterator, Iterable
from typing import Tuple, List
from collections.abc import Iterator, Iterable

from django import template
from django.utils.translation import ngettext, gettext as _
Expand Down Expand Up @@ -42,7 +43,7 @@ def _truncate_duration(duration: int, bounds: Iterable[int], precisions: Iterabl
return duration


def _minutes_to_hours_and_minutes(duration_min: int) -> Tuple[int, int]:
def _minutes_to_hours_and_minutes(duration_min: int) -> tuple[int, int]:
"""
Convert a duration expressed in minutes to a duration expressed in hours and minutes.
`duration_min` shall be positive to ensure a correct behavior.
Expand Down
2 changes: 1 addition & 1 deletion zds/utils/templatetags/profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@


@register.filter("profile")
@lru_cache()
@lru_cache
def profile(current_user):
# we currently expect to receive a User in most cases, but as we move
# toward using Profiles instead, we have to handle them as well.
Expand Down

0 comments on commit c1c773c

Please sign in to comment.