Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
fail-fast: false
matrix:
python-version: ["3.11", "3.12"]
toxenv: ["django42", "quality", "pii_check", "check_keywords"]
toxenv: ["django42", "django52", "quality", "pii_check", "check_keywords"]

services:
mysql:
Expand Down
4 changes: 2 additions & 2 deletions notesapi/v1/tests/helpers.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
from calendar import timegm
from datetime import datetime, timedelta
from datetime import UTC, datetime, timedelta

import jwt
from django.conf import settings


def get_id_token(user):
now = datetime.utcnow()
now = datetime.now(UTC)
return jwt.encode({
'aud': settings.CLIENT_ID,
'sub': user,
Expand Down
6 changes: 3 additions & 3 deletions notesapi/v1/tests/test_views.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import unittest
from calendar import timegm
from datetime import datetime, timedelta
from datetime import UTC, datetime, timedelta
from unittest.mock import patch
from urllib import parse

Expand Down Expand Up @@ -1193,8 +1193,8 @@ class TokenTests(BaseAnnotationViewTests):
token_data = {
'aud': settings.CLIENT_ID,
'sub': TEST_USER,
'iat': timegm(datetime.utcnow().utctimetuple()),
'exp': timegm((datetime.utcnow() + timedelta(seconds=300)).utctimetuple()),
'iat': timegm(datetime.now(UTC).utctimetuple()),
'exp': timegm((datetime.now(UTC) + timedelta(seconds=300)).utctimetuple()),
}

def _assert_403(self, token):
Expand Down
1 change: 0 additions & 1 deletion notesapi/v1/views/common.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# pylint:disable=possibly-used-before-assignment
import json
import logging

Expand Down
7 changes: 3 additions & 4 deletions notesapi/v1/views/elasticsearch.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,11 @@ class AnnotationSearchView(BaseAnnotationSearchView):
def __init__(self, *args, **kwargs):
self.client = connections.get_connection(
NoteDocument._get_using()
) # pylint: disable=protected-access
self.index = NoteDocument._index._name # pylint: disable=protected-access
)
self.index = NoteDocument._index._name
self.mapping = (
NoteDocument._doc_type.mapping.properties.name
) # pylint: disable=protected-access
# pylint: disable=protected-access
)
self.search = Search(
using=self.client, index=self.index, doc_type=NoteDocument._doc_type.name
)
Expand Down
5 changes: 0 additions & 5 deletions notesserver/settings/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,3 @@
}

CSRF_TRUSTED_ORIGINS = []

# Django 4.0+ uses zoneinfo if this is not set. We can remove this and
# migrate to zoneinfo after Django 4.2 upgrade. See more on following url
# https://docs.djangoproject.com/en/4.2/releases/4.0/#zoneinfo-default-timezone-implementation
USE_DEPRECATED_PYTZ = True
19 changes: 9 additions & 10 deletions requirements/base.in
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,21 @@
-c constraints.txt

Django
requests
django-cors-headers
django-elasticsearch-dsl
django-elasticsearch-dsl-drf
djangorestframework
drf-spectacular
edx-django-release-util
edx-django-utils
edx-drf-extensions
elasticsearch
elasticsearch-dsl
django-elasticsearch-dsl
django-elasticsearch-dsl-drf
django-cors-headers
gunicorn # MIT
meilisearch
mysqlclient
PyJWT
gunicorn # MIT
path.py
PyJWT
python-dateutil
edx-django-release-util
edx-django-utils
edx-drf-extensions
pytz
requests
setuptools
2 changes: 0 additions & 2 deletions requirements/base.txt
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,6 @@ python-dateutil==2.9.0.post0
# via
# -r requirements/base.in
# elasticsearch-dsl
pytz==2025.2
# via -r requirements/base.in
pyyaml==6.0.2
# via
# drf-spectacular
Expand Down
1 change: 0 additions & 1 deletion requirements/pip.in
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,3 @@
pip
setuptools
wheel

2 changes: 1 addition & 1 deletion requirements/quality.in
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
-r test.txt

code-annotations
edx_lint
pycodestyle
pylint
edx_lint
4 changes: 0 additions & 4 deletions requirements/quality.txt
Original file line number Diff line number Diff line change
Expand Up @@ -381,10 +381,6 @@ python-slugify==8.0.4
# via
# -r requirements/test.txt
# code-annotations
pytz==2025.2
# via
# -r requirements/base.txt
# -r requirements/test.txt
pyyaml==6.0.2
# via
# -r requirements/base.txt
Expand Down
6 changes: 3 additions & 3 deletions requirements/test.in
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
astroid
code-annotations
coverage
ddt
diff-cover
factory_boy
more-itertools
pep8
pylint
diff-cover
factory_boy
ddt
pytest
pytest-cov
pytest-django
Expand Down
2 changes: 0 additions & 2 deletions requirements/test.txt
Original file line number Diff line number Diff line change
Expand Up @@ -272,8 +272,6 @@ python-dateutil==2.9.0.post0
# elasticsearch-dsl
python-slugify==8.0.4
# via code-annotations
pytz==2025.2
# via -r requirements/base.txt
pyyaml==6.0.2
# via
# -r requirements/base.txt
Expand Down
3 changes: 2 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
[tox]
envlist = py{311,312}-django{42}, quality, pii_check, check_keywords
envlist = py{311,312}-django{42,52}, quality, pii_check, check_keywords
skipsdist = true
isolated_build = true # Enable isolated build environments

[testenv]
envdir = {toxworkdir}/{envname}
deps =
django42: Django>=4.2,<5.0
django52: Django>=5.2,<6.0
passenv =
CONN_MAX_AGE
DB_ENGINE
Expand Down