Skip to content

Commit

Permalink
Merge branch 'dev' into install-update
Browse files Browse the repository at this point in the history
  • Loading branch information
philippemilink authored Oct 7, 2023
2 parents e497bc9 + c1c773c commit 6e3c730
Show file tree
Hide file tree
Showing 14 changed files with 51 additions and 33 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
8 changes: 4 additions & 4 deletions templates/misc/pagination.part.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
{% endcaptureas %}

<ul class="pagination pagination-{{ position }}">
{% ifnotequal nb 1 %}
{% if nb != 1 %}
<li class="prev">
{% with prev=nb|add:-1 %}
<a href="{% append_query_params page=prev %}{{ full_anchor }}" class="ico-after arrow-left blue" rel="prev">
Expand All @@ -21,18 +21,18 @@
</a>
{% endwith %}
</li>
{% endifnotequal %}
{% endif %}


{% for page in pages %}
{% if page %}
<li>
<a
{% ifnotequal page nb %}
{% if page != nb %}
href="{% append_query_params page=page %}{{ full_anchor }}"
{% else %}
class="current"
{% endifnotequal %}
{% endif %}
{% if page|add:-1 == nb %}
rel="next"
{% elif page|add:1 == nb %}
Expand Down
4 changes: 2 additions & 2 deletions templates/misc/paginator.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@
{% if page_nb %}
<li>
<a
{% ifnotequal page_nb page_obj.number %}
{% if page_nb != page_obj.number %}
href="{% append_query_params page=page_nb %}{{ full_anchor }}"
{% else %}
class="current"
{% endifnotequal %}
{% endif %}
{% if page_nb|add:-1 == page_obj.number %}
rel="next"
{% elif page_nb|add:1 == page_obj.number %}
Expand Down
19 changes: 14 additions & 5 deletions zds/forum/signals.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,16 @@
from django.dispatch import Signal

topic_moved = Signal(providing_args=["topic"])
topic_edited = Signal(providing_args=["topic"])
topic_read = Signal(providing_args=["instance", "user"])
post_read = Signal(providing_args=["instance", "user"])
post_unread = Signal(providing_args=["post", "user"])
# argument: topic
topic_moved = Signal()

# argument: topic
topic_edited = Signal()

# arguments: instance, user
topic_read = Signal()

# arguments: instance, user
post_read = Signal()

# arguments: post, user
post_unread = Signal()
3 changes: 2 additions & 1 deletion zds/notification/signals.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from django.dispatch import Signal

# is sent when a content is read (topic, article or tutorial)
content_read = Signal(providing_args=["instance", "user", "target"])
# arguments: instance, user, target
content_read = Signal()
9 changes: 6 additions & 3 deletions zds/tutorialv2/signals.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
from django.dispatch.dispatcher import Signal

# Display management
content_read = Signal(providing_args=["instance", "user", "target"])
# arguments: instance, user, target
content_read = Signal()

# Publication events
content_published = Signal(providing_args=["instance", "user", "by_email"])
content_unpublished = Signal(providing_args=["instance", "target", "moderator"])
# arguments: instance, user, by_email
content_published = Signal()
# arguments: instance, target, moderator
content_unpublished = Signal()

# Authors management
# For the signal below, the arguments "performer", "content", "author" and "action" shall be provided.
Expand Down
7 changes: 5 additions & 2 deletions zds/utils/signals.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
from django.dispatch import Signal

ping = Signal(providing_args=["instance", "user", "by_email"])
unping = Signal(providing_args=["instance", "user"])
# arguments: instance, user, by_email
ping = Signal()

# arguments: instance, user
unping = Signal()
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 6e3c730

Please sign in to comment.