Skip to content

Commit

Permalink
Running tests using python 3.12 (#163)
Browse files Browse the repository at this point in the history
* chore: update python version support 3.12 for tests
  • Loading branch information
salman2013 authored Mar 4, 2024
1 parent d0a6292 commit 809b65c
Show file tree
Hide file tree
Showing 13 changed files with 41 additions and 51 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,11 @@ jobs:
name: tests
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest] # Add macos-latest later?
python-version: ['3.8']
toxenv: ["py38-django32", "py38-django42", "package", "quality"]
python-version: ['3.8','3.12']
toxenv: ["django42", "package", "quality"]
# We're only testing against MySQL 8 right now because 5.7 is
# incompatible with Djagno 4.2. We'd have to make the tox.ini file more
# complicated than it's worth given the short expected shelf-life of
Expand Down
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,11 @@ PIP_COMPILE = pip-compile --rebuild $(PIP_COMPILE_OPTS)
compile-requirements: export CUSTOM_COMPILE_COMMAND=make upgrade
compile-requirements: ## update the requirements/*.txt files with the latest packages satisfying requirements/*.in
pip install -qr requirements/pip-tools.txt
# Make sure to compile files after any other files they include!
# Make sure to compile files after any other files they include!
$(PIP_COMPILE) --allow-unsafe -o requirements/pip.txt requirements/pip.in
$(PIP_COMPILE) -o requirements/pip-tools.txt requirements/pip-tools.in
pip install -qr requirements/pip.txt
pip install -qr requirements/pip-tools.txt
$(PIP_COMPILE) -o requirements/base.txt requirements/base.in
$(PIP_COMPILE) -o requirements/test.txt requirements/test.in
$(PIP_COMPILE) -o requirements/doc.txt requirements/doc.in
Expand Down
2 changes: 1 addition & 1 deletion openedx_learning/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""
Open edX Learning ("Learning Core").
"""
__version__ = "0.6.3"
__version__ = "0.7.0"
11 changes: 5 additions & 6 deletions requirements/base.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,11 @@ asgiref==3.7.2
# via django
attrs==23.2.0
# via -r requirements/base.in
backports-zoneinfo[tzdata]==0.2.1
backports-zoneinfo[tzdata]==0.2.1 ; python_version < "3.9"
# via
# -c requirements/constraints.txt
# celery
# django
# kombu
billiard==4.2.0
# via celery
Expand Down Expand Up @@ -41,9 +43,8 @@ click-repl==0.3.0
# via celery
cryptography==42.0.5
# via pyjwt
django==3.2.24
django==4.2.10
# via
# -c https://raw.githubusercontent.com/edx/edx-lint/master/edx_lint/files/common_constraints.txt
# -c requirements/constraints.txt
# -r requirements/base.in
# django-crum
Expand Down Expand Up @@ -96,9 +97,7 @@ pynacl==1.5.0
python-dateutil==2.9.0.post0
# via celery
pytz==2024.1
# via
# django
# djangorestframework
# via djangorestframework
requests==2.31.0
# via edx-drf-extensions
rules==3.3
Expand Down
6 changes: 3 additions & 3 deletions requirements/constraints.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
# linking to it here is good.

# Common constraints for edx repos
-c https://raw.githubusercontent.com/edx/edx-lint/master/edx_lint/files/common_constraints.txt
# -c https://raw.githubusercontent.com/edx/edx-lint/master/edx_lint/files/common_constraints.txt

# tox>4.0.0 isn't yet compatible with many tox plugins, causing CI failures in almost all repos.
# Details can be found in this discussion: https://github.com/tox-dev/tox/discussions/1810
tox<4.0.0

# Develop primarily on Django 3.2, but we'll want to start testing against 4.2
Django<4.0
Django<5.0
backports-zoneinfo[tzdata]; python_version < '3.9'
17 changes: 4 additions & 13 deletions requirements/dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,12 @@ astroid==3.1.0
# pylint-celery
attrs==23.2.0
# via -r requirements/quality.txt
backports-zoneinfo[tzdata]==0.2.1
backports-zoneinfo[tzdata]==0.2.1 ; python_version < "3.9"
# via
# -c requirements/constraints.txt
# -r requirements/quality.txt
# celery
# django
# kombu
billiard==4.2.0
# via
Expand Down Expand Up @@ -105,9 +107,8 @@ distlib==0.3.8
# via
# -r requirements/ci.txt
# virtualenv
django==3.2.24
django==4.2.10
# via
# -c https://raw.githubusercontent.com/edx/edx-lint/master/edx_lint/files/common_constraints.txt
# -c requirements/constraints.txt
# -r requirements/quality.txt
# django-crum
Expand Down Expand Up @@ -215,11 +216,6 @@ jaraco-classes==3.3.1
# via
# -r requirements/quality.txt
# keyring
jeepney==0.8.0
# via
# -r requirements/quality.txt
# keyring
# secretstorage
jinja2==3.1.3
# via
# -r requirements/quality.txt
Expand Down Expand Up @@ -392,7 +388,6 @@ python-slugify==8.0.4
pytz==2024.1
# via
# -r requirements/quality.txt
# django
# djangorestframework
pyyaml==6.0.1
# via
Expand Down Expand Up @@ -424,10 +419,6 @@ rich==13.7.1
# twine
rules==3.3
# via -r requirements/quality.txt
secretstorage==3.3.3
# via
# -r requirements/quality.txt
# keyring
semantic-version==2.10.0
# via
# -r requirements/quality.txt
Expand Down
8 changes: 4 additions & 4 deletions requirements/doc.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,12 @@ babel==2.14.0
# via
# pydata-sphinx-theme
# sphinx
backports-zoneinfo[tzdata]==0.2.1
backports-zoneinfo[tzdata]==0.2.1 ; python_version < "3.9"
# via
# -c requirements/constraints.txt
# -r requirements/test.txt
# celery
# django
# kombu
beautifulsoup4==4.12.3
# via pydata-sphinx-theme
Expand Down Expand Up @@ -82,9 +84,8 @@ cryptography==42.0.5
# pyjwt
ddt==1.7.2
# via -r requirements/test.txt
django==3.2.24
django==4.2.10
# via
# -c https://raw.githubusercontent.com/edx/edx-lint/master/edx_lint/files/common_constraints.txt
# -c requirements/constraints.txt
# -r requirements/test.txt
# django-crum
Expand Down Expand Up @@ -268,7 +269,6 @@ pytz==2024.1
# via
# -r requirements/test.txt
# babel
# django
# djangorestframework
pyyaml==6.0.1
# via
Expand Down
10 changes: 5 additions & 5 deletions requirements/pip.txt
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
#
# This file is autogenerated by pip-compile
# To update, run:
# This file is autogenerated by pip-compile with Python 3.8
# by the following command:
#
# make upgrade
#
wheel==0.36.2
wheel==0.42.0
# via -r requirements/pip.in

# The following packages are considered to be unsafe in a requirements file:
pip==20.3.3
pip==24.0
# via -r requirements/pip.in
setuptools==51.3.3
setuptools==69.1.1
# via -r requirements/pip.in
14 changes: 4 additions & 10 deletions requirements/quality.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,12 @@ astroid==3.1.0
# pylint-celery
attrs==23.2.0
# via -r requirements/test.txt
backports-zoneinfo[tzdata]==0.2.1
backports-zoneinfo[tzdata]==0.2.1 ; python_version < "3.9"
# via
# -c requirements/constraints.txt
# -r requirements/test.txt
# celery
# django
# kombu
billiard==4.2.0
# via
Expand Down Expand Up @@ -85,9 +87,8 @@ ddt==1.7.2
# via -r requirements/test.txt
dill==0.3.8
# via pylint
django==3.2.24
django==4.2.10
# via
# -c https://raw.githubusercontent.com/edx/edx-lint/master/edx_lint/files/common_constraints.txt
# -c requirements/constraints.txt
# -r requirements/test.txt
# django-crum
Expand Down Expand Up @@ -173,10 +174,6 @@ isort==5.13.2
# pylint
jaraco-classes==3.3.1
# via keyring
jeepney==0.8.0
# via
# keyring
# secretstorage
jinja2==3.1.3
# via
# -r requirements/test.txt
Expand Down Expand Up @@ -298,7 +295,6 @@ python-slugify==8.0.4
pytz==2024.1
# via
# -r requirements/test.txt
# django
# djangorestframework
pyyaml==6.0.1
# via
Expand All @@ -321,8 +317,6 @@ rich==13.7.1
# via twine
rules==3.3
# via -r requirements/test.txt
secretstorage==3.3.3
# via keyring
semantic-version==2.10.0
# via
# -r requirements/test.txt
Expand Down
6 changes: 3 additions & 3 deletions requirements/test.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,12 @@ asgiref==3.7.2
# django
attrs==23.2.0
# via -r requirements/base.txt
backports-zoneinfo[tzdata]==0.2.1
backports-zoneinfo[tzdata]==0.2.1 ; python_version < "3.9"
# via
# -c requirements/constraints.txt
# -r requirements/base.txt
# celery
# django
# kombu
billiard==4.2.0
# via
Expand Down Expand Up @@ -73,7 +75,6 @@ cryptography==42.0.5
ddt==1.7.2
# via -r requirements/test.in
# via
# -c https://raw.githubusercontent.com/edx/edx-lint/master/edx_lint/files/common_constraints.txt
# -c requirements/constraints.txt
# -r requirements/base.txt
# django-crum
Expand Down Expand Up @@ -206,7 +207,6 @@ python-slugify==8.0.4
pytz==2024.1
# via
# -r requirements/base.txt
# django
# djangorestframework
pyyaml==6.0.1
# via code-annotations
Expand Down
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,5 +91,6 @@ def is_requirement(line):
'Natural Language :: English',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.12',
],
)
2 changes: 1 addition & 1 deletion tests/openedx_learning/core/publishing/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def test_auto_datetime(self) -> None:
# Auto-generated datetime checking...
assert isinstance(package.created, datetime)
assert package.created == package.updated
assert package.created.tzinfo == timezone.utc
assert package.created.tzinfo == timezone.utc # pylint: disable=no-member

# Should be auto-generated
assert isinstance(package.uuid, UUID)
Expand Down
5 changes: 3 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tox]
envlist = py38-django{32,42}, quality, docs, pii_check, lint-imports
envlist = py{38,312}-django{42}, quality, docs, pii_check, lint-imports

[doc8]
; D001 = Line too long
Expand Down Expand Up @@ -36,7 +36,7 @@ norecursedirs = .* docs requirements site-packages

[testenv]
deps =
django32: Django>=3.2,<3.3
setuptools
django42: Django>=4.2,<4.3
-r{toxinidir}/requirements/test.txt
setenv =
Expand Down Expand Up @@ -71,6 +71,7 @@ allowlist_externals =
rm
touch
deps =
setuptools
-r{toxinidir}/requirements/quality.txt
commands =
pylint openedx_learning openedx_tagging tests test_utils manage.py setup.py
Expand Down

0 comments on commit 809b65c

Please sign in to comment.