Skip to content
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

[deps] Added support for django 3.2 and 4.0 alpha #255 #258

Merged
merged 4 commits into from
Oct 15, 2021
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,16 @@ jobs:
fail-fast: false
matrix:
python-version:
- 3.6
- 3.7
- 3.8
django-version:
- django~=2.2.0
- django~=3.0.0
- django~=3.1.0
- django~=3.2.8
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should be 3.2.0 for consisntency.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There were bug in 3.2.0, so I thought to use 3.2.8: https://docs.djangoproject.com/en/3.2/releases/3.2.8/

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@codesankalp there's always bugs in the initial minor versions of a release, the build will install the latest available version anyway. It's a matter of clarify, readability and consistency. By indicating ~=3.2.0 we know the build will use the latest 3.2.x version.

include:
- django-version: django~=4.0a1
python-version: 3.8
experimental: true

steps:
- uses: actions/checkout@v2
Expand Down
2 changes: 1 addition & 1 deletion openwisp_utils/admin.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from django.contrib.admin import ModelAdmin, StackedInline
from django.urls import reverse
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import gettext_lazy as _


class TimeReadonlyAdminMixin(object):
Expand Down
4 changes: 2 additions & 2 deletions openwisp_utils/admin_theme/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from django.conf import settings
from django.contrib import admin
from django.utils.translation import ugettext_lazy
from django.utils.translation import gettext_lazy

from . import settings as app_settings
from .dashboard import get_dashboard_context
Expand All @@ -16,7 +16,7 @@ class OpenwispAdminSite(admin.AdminSite):
# h1 text
site_header = getattr(settings, 'OPENWISP_ADMIN_SITE_HEADER', 'OpenWISP')
# text at the top of the admin index page
index_title = ugettext_lazy(
index_title = gettext_lazy(
getattr(settings, 'OPENWISP_ADMIN_INDEX_TITLE', 'Network Administration')
)
enable_nav_sidebar = False
Expand Down
2 changes: 1 addition & 1 deletion openwisp_utils/admin_theme/apps.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from django.apps import AppConfig
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import gettext_lazy as _

from . import settings as app_settings
from .checks import admin_theme_settings_checks
Expand Down
2 changes: 1 addition & 1 deletion openwisp_utils/base.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import uuid

from django.db import models
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import gettext_lazy as _
from model_utils.fields import AutoCreatedField, AutoLastModifiedField
from openwisp_utils.utils import get_random_key
from openwisp_utils.validators import key_validator
Expand Down
2 changes: 1 addition & 1 deletion openwisp_utils/validators.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from django.core.validators import RegexValidator, _lazy_re_compile
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import gettext_lazy as _

key_validator = RegexValidator(
_lazy_re_compile('^[^\\s/\\.]+$'),
Expand Down
2 changes: 1 addition & 1 deletion tests/test_project/admin.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from django.contrib import admin
from django.contrib.auth.models import User
from django.forms import ModelForm
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import gettext_lazy as _
from openwisp_utils.admin import (
AlwaysHasChangedMixin,
HelpTextStackedInline,
Expand Down
2 changes: 1 addition & 1 deletion tests/test_project/api/views.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from django.http import JsonResponse
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import gettext_lazy as _
from django.views import View

from ..models import Project
Expand Down
3 changes: 2 additions & 1 deletion tests/test_project/apps.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from django.db.models import Case, Count, Sum, When
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import gettext_lazy as _
from openwisp_utils.admin_theme import (
register_dashboard_chart,
register_dashboard_template,
Expand All @@ -18,6 +18,7 @@ class TestAppConfig(ApiAppConfig):
'DEFAULT_THROTTLE_RATES': {'test': '10/minute'},
'TEST': True,
}
default_auto_field = 'django.db.models.AutoField'
nemesifier marked this conversation as resolved.
Show resolved Hide resolved

def ready(self, *args, **kwargs):
super().ready(*args, **kwargs)
Expand Down
2 changes: 1 addition & 1 deletion tests/test_project/models.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from django.core.exceptions import ValidationError
from django.db import models
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import gettext_lazy as _
from openwisp_utils.base import KeyField, TimeStampedEditableModel, UUIDModel


Expand Down
2 changes: 1 addition & 1 deletion tests/test_project/tests/test_storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def create_dir(*paths: str):
and all the intermidiate ones according to the joined path using os.makedirs
"""
joined_path = os.path.join(*paths)
os.makedirs(joined_path)
os.makedirs(joined_path, exist_ok=True)
nemesifier marked this conversation as resolved.
Show resolved Hide resolved
return joined_path


Expand Down
2 changes: 1 addition & 1 deletion tests/test_project/tests/test_test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

from ..models import Shelf

status_signal = Signal(providing_args=['status'])
status_signal = Signal()
codesankalp marked this conversation as resolved.
Show resolved Hide resolved


class TestUtils(TestCase):
Expand Down