From b1cfda661ef8b66070f741acb792ec7c9aee6b4e Mon Sep 17 00:00:00 2001 From: edX requirements bot Date: Fri, 23 Feb 2024 07:37:41 -0500 Subject: [PATCH 01/30] feat: add python 3.12 support --- .github/workflows/ci.yml | 60 ++++++++++++++++++++---------------- tox.ini | 66 +++++++++++++++------------------------- 2 files changed, 57 insertions(+), 69 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 89cdba0c..768eec2d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2,10 +2,10 @@ name: Python CI on: push: - branches: [ main ] + branches: [main] pull_request: branches: - - '**' + - '**' jobs: @@ -15,30 +15,36 @@ jobs: strategy: matrix: os: [ubuntu-20.04] - python-version: ['3.8'] - toxenv: ["quality", "docs", "django32", "django42"] + python-version: + - '3.8' + - '3.12' + toxenv: + - "py38" + - "quality" + - "docs" + - django42 steps: - - uses: actions/checkout@v4 - - name: setup python - uses: actions/setup-python@v5 - with: - python-version: ${{ matrix.python-version }} - - - name: Install pip - run: pip install -r requirements/pip.txt - - - name: Install Dependencies - run: pip install -r requirements/ci.txt - - - name: Run Tests - env: - TOXENV: ${{ matrix.toxenv }} - run: tox - - - name: Run coverage - if: matrix.python-version == '3.8' && matrix.toxenv == 'django42' - uses: codecov/codecov-action@v3 - with: - flags: unittests - fail_ci_if_error: true + - uses: actions/checkout@v4 + - name: setup python + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + + - name: Install pip + run: pip install -r requirements/pip.txt + + - name: Install Dependencies + run: pip install -r requirements/ci.txt + + - name: Run Tests + env: + TOXENV: ${{ matrix.toxenv }} + run: tox + + - name: Run coverage + if: matrix.python-version == '3.8' && matrix.toxenv == 'py38' + uses: codecov/codecov-action@v3 + with: + flags: unittests + fail_ci_if_error: true diff --git a/tox.ini b/tox.ini index c21befde..b94cc537 100644 --- a/tox.ini +++ b/tox.ini @@ -1,8 +1,7 @@ [tox] -envlist = py{38}-django{32, 42}, quality, docs, pii_check +envlist = py{38, 312}, quality, docs, pii_check [doc8] -; D001 = Line too long ignore = D001 [pycodestyle] @@ -11,51 +10,31 @@ max-line-length = 120 max-doc-length = 120 [pydocstyle] -; D101 = Missing docstring in public class -; D200 = One-line docstring should fit on one line with quotes -; D203 = 1 blank line required before class docstring -; D212 = Multi-line docstring summary should start at the first line -; D215 = Section underline is over-indented (numpy style) -; D404 = First word of the docstring should not be This (numpy style) -; D405 = Section name should be properly capitalized (numpy style) -; D406 = Section name should end with a newline (numpy style) -; D407 = Missing dashed underline after section (numpy style) -; D408 = Section underline should be in the line following the section's name (numpy style) -; D409 = Section underline should match the length of its name (numpy style) -; D410 = Missing blank line after section (numpy style) -; D411 = Missing blank line before section (numpy style) -; D412 = No blank lines allowed between a section header and its content (numpy style) -; D413 = Missing blank line after last section (numpy style) -; D414 = Section has no content (numpy style) ignore = D101,D200,D203,D212,D215,D404,D405,D406,D407,D408,D409,D410,D411,D412,D413,D414 -match-dir = (?!migrations) [pytest] -DJANGO_SETTINGS_MODULE = test_utils.test_settings -addopts = --cov openedx_events --cov tests --cov-report term-missing --cov-report xml +django_settings_module = test_utils.test_settings +addopts = --cov openedx_events --cov-report term-missing --cov-report xml norecursedirs = .* docs requirements site-packages [testenv] -deps = - django32: Django>=3.2,<4.0 - django42: Django>=4.2,<4.3 +deps = -r{toxinidir}/requirements/test.txt -commands = - python manage.py check - pytest {posargs} +commands = + pytest openedx_events tests [testenv:docs] -setenv = - DJANGO_SETTINGS_MODULE = test_utils.test_settings +setenv = PYTHONPATH = {toxinidir} # Adding the option here instead of as a default in the docs Makefile because that Makefile is generated by shpinx. SPHINXOPTS = -W -allowlist_externals = +allowlist_externals = make rm -deps = + twine +deps = -r{toxinidir}/requirements/doc.txt -commands = +commands = doc8 --ignore-path docs/_build README.rst docs rm -f docs/openedx_events.rst rm -f docs/modules.rst @@ -65,17 +44,20 @@ commands = twine check dist/* [testenv:quality] -allowlist_externals = +allowlist_externals = make rm touch -deps = +deps = -r{toxinidir}/requirements/quality.txt -commands = - touch tests/__init__.py - pylint openedx_events tests test_utils manage.py setup.py - rm tests/__init__.py - pycodestyle openedx_events tests manage.py setup.py - pydocstyle openedx_events tests manage.py setup.py - isort --check-only --diff tests test_utils openedx_events manage.py setup.py - make selfcheck +commands = + make quality + +[testenv:pii_check] +setenv = + DJANGO_SETTINGS_MODULE = test_utils.test_settings +deps = + -r{toxinidir}/requirements/test.txt +commands = + code_annotations django_find_annotations --config_file .pii_annotations.yml --lint --report --coverage + From fcc5a4c0861a1d85ea5e98078ca01921f1ecece6 Mon Sep 17 00:00:00 2001 From: Maria Grimaldi Date: Thu, 28 Mar 2024 15:34:43 -0400 Subject: [PATCH 02/30] refactor: remove extra blank spaces --- tox.ini | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/tox.ini b/tox.ini index b94cc537..73bf1132 100644 --- a/tox.ini +++ b/tox.ini @@ -18,23 +18,23 @@ addopts = --cov openedx_events --cov-report term-missing --cov-report xml norecursedirs = .* docs requirements site-packages [testenv] -deps = +deps = -r{toxinidir}/requirements/test.txt -commands = +commands = pytest openedx_events tests [testenv:docs] -setenv = +setenv = PYTHONPATH = {toxinidir} # Adding the option here instead of as a default in the docs Makefile because that Makefile is generated by shpinx. SPHINXOPTS = -W -allowlist_externals = +allowlist_externals = make rm twine -deps = +deps = -r{toxinidir}/requirements/doc.txt -commands = +commands = doc8 --ignore-path docs/_build README.rst docs rm -f docs/openedx_events.rst rm -f docs/modules.rst @@ -44,20 +44,20 @@ commands = twine check dist/* [testenv:quality] -allowlist_externals = +allowlist_externals = make rm touch -deps = +deps = -r{toxinidir}/requirements/quality.txt -commands = +commands = make quality [testenv:pii_check] -setenv = +setenv = DJANGO_SETTINGS_MODULE = test_utils.test_settings -deps = +deps = -r{toxinidir}/requirements/test.txt -commands = +commands = code_annotations django_find_annotations --config_file .pii_annotations.yml --lint --report --coverage From d56053af0f09477958f314035295469f1d8a5082 Mon Sep 17 00:00:00 2001 From: Maria Grimaldi Date: Thu, 28 Mar 2024 15:35:50 -0400 Subject: [PATCH 03/30] refactor: use python 3.11 instead of python 3.12 --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 768eec2d..0d076554 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,7 +17,7 @@ jobs: os: [ubuntu-20.04] python-version: - '3.8' - - '3.12' + - '3.11' toxenv: - "py38" - "quality" From fce1c6c7881d02b05d539d089005b7cb96d00597 Mon Sep 17 00:00:00 2001 From: Maria Grimaldi Date: Thu, 28 Mar 2024 16:04:00 -0400 Subject: [PATCH 04/30] refactor: use environment with same django version --- .github/workflows/ci.yml | 2 +- tox.ini | 19 +++++-------------- 2 files changed, 6 insertions(+), 15 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0d076554..932d4c98 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,9 +20,9 @@ jobs: - '3.11' toxenv: - "py38" + - "py311" - "quality" - "docs" - - django42 steps: - uses: actions/checkout@v4 diff --git a/tox.ini b/tox.ini index 73bf1132..3f13a4ea 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py{38, 312}, quality, docs, pii_check +envlist = py{38, 311}-django42, quality, docs [doc8] ignore = D001 @@ -18,10 +18,12 @@ addopts = --cov openedx_events --cov-report term-missing --cov-report xml norecursedirs = .* docs requirements site-packages [testenv] +deps = + django42: Django>=4.2,<4.3 deps = -r{toxinidir}/requirements/test.txt commands = - pytest openedx_events tests + pytest {posargs} [testenv:docs] setenv = @@ -31,7 +33,6 @@ setenv = allowlist_externals = make rm - twine deps = -r{toxinidir}/requirements/doc.txt commands = @@ -40,8 +41,7 @@ commands = rm -f docs/modules.rst make -e -C docs clean make -e -C docs html - python -m build --wheel - twine check dist/* + python setup.py check --restructuredtext --strict [testenv:quality] allowlist_externals = @@ -52,12 +52,3 @@ deps = -r{toxinidir}/requirements/quality.txt commands = make quality - -[testenv:pii_check] -setenv = - DJANGO_SETTINGS_MODULE = test_utils.test_settings -deps = - -r{toxinidir}/requirements/test.txt -commands = - code_annotations django_find_annotations --config_file .pii_annotations.yml --lint --report --coverage - From 8380a55afce9d3e7d3d144212c2209575d4be497 Mon Sep 17 00:00:00 2001 From: Maria Grimaldi Date: Thu, 28 Mar 2024 16:07:26 -0400 Subject: [PATCH 05/30] fix: remove duplicated deps key from file --- tox.ini | 1 - 1 file changed, 1 deletion(-) diff --git a/tox.ini b/tox.ini index 3f13a4ea..e231b6c6 100644 --- a/tox.ini +++ b/tox.ini @@ -20,7 +20,6 @@ norecursedirs = .* docs requirements site-packages [testenv] deps = django42: Django>=4.2,<4.3 -deps = -r{toxinidir}/requirements/test.txt commands = pytest {posargs} From dec9239352b2dedfe5df1df171fa16555b3ee1b7 Mon Sep 17 00:00:00 2001 From: Maria Grimaldi Date: Thu, 28 Mar 2024 16:13:54 -0400 Subject: [PATCH 06/30] fix: manage python versions in ci workflow --- .github/workflows/ci.yml | 5 ++--- tox.ini | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 932d4c98..78251d48 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,14 +19,13 @@ jobs: - '3.8' - '3.11' toxenv: - - "py38" - - "py311" + - "django42" - "quality" - "docs" steps: - uses: actions/checkout@v4 - - name: setup python + - name: Setup python uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} diff --git a/tox.ini b/tox.ini index e231b6c6..ee534a5f 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py{38, 311}-django42, quality, docs +envlist = django42, quality, docs [doc8] ignore = D001 From b81903d0f96dfb94ed06867a520e6a9214381438 Mon Sep 17 00:00:00 2001 From: Maria Grimaldi Date: Wed, 10 Apr 2024 21:39:34 -0400 Subject: [PATCH 07/30] fix: add constraint for backports-zoneinfo < python 3.9 --- requirements/base.txt | 14 ++++++++------ requirements/ci.txt | 2 +- requirements/constraints.txt | 4 ++++ requirements/dev.txt | 27 ++++++++++++++++----------- requirements/doc.txt | 23 +++++++++++++---------- requirements/pip-tools.txt | 2 +- requirements/quality.txt | 21 ++++++++++++--------- requirements/test.txt | 11 ++++++----- 8 files changed, 61 insertions(+), 43 deletions(-) diff --git a/requirements/base.txt b/requirements/base.txt index c9b7abfe..6e35e604 100644 --- a/requirements/base.txt +++ b/requirements/base.txt @@ -8,8 +8,10 @@ asgiref==3.8.1 # via django attrs==23.2.0 # via -r requirements/base.in -backports-zoneinfo==0.2.1 - # via django +backports-zoneinfo==0.2.1 ; python_version < "3.9" + # via + # -c requirements/constraints.txt + # django cffi==1.16.0 # via pynacl click==8.1.7 @@ -25,19 +27,19 @@ django-crum==0.7.9 # via edx-django-utils django-waffle==4.1.0 # via edx-django-utils -edx-django-utils==5.11.0 +edx-django-utils==5.12.0 # via -r requirements/base.in edx-opaque-keys[django]==2.5.1 # via -r requirements/base.in fastavro==1.9.4 # via -r requirements/base.in -newrelic==9.7.1 +newrelic==9.8.0 # via edx-django-utils pbr==6.0.0 # via stevedore psutil==5.9.8 # via edx-django-utils -pycparser==2.21 +pycparser==2.22 # via cffi pymongo==3.13.0 # via edx-opaque-keys @@ -49,7 +51,7 @@ stevedore==5.2.0 # via # edx-django-utils # edx-opaque-keys -typing-extensions==4.10.0 +typing-extensions==4.11.0 # via # asgiref # edx-opaque-keys diff --git a/requirements/ci.txt b/requirements/ci.txt index c9dd7491..641296fb 100644 --- a/requirements/ci.txt +++ b/requirements/ci.txt @@ -12,7 +12,7 @@ colorama==0.4.6 # via tox distlib==0.3.8 # via virtualenv -filelock==3.13.1 +filelock==3.13.4 # via # tox # virtualenv diff --git a/requirements/constraints.txt b/requirements/constraints.txt index 09c2c45e..493d4012 100644 --- a/requirements/constraints.txt +++ b/requirements/constraints.txt @@ -15,3 +15,7 @@ # This should be removed once the issue is fixed with a new astroid release or with a test_generate_avro_schemas.py # module refactor. astroid<3.0.0 + + +# Temporary to Support the python 3.11 Upgrade +backports.zoneinfo;python_version<"3.9" # Newer versions have zoneinfo available in the standard library diff --git a/requirements/dev.txt b/requirements/dev.txt index c5f8b544..50519892 100644 --- a/requirements/dev.txt +++ b/requirements/dev.txt @@ -16,11 +16,16 @@ astroid==2.15.8 # pylint-celery attrs==23.2.0 # via -r requirements/quality.txt -backports-zoneinfo==0.2.1 +backports-tarfile==1.0.0 # via # -r requirements/quality.txt + # jaraco-context +backports-zoneinfo==0.2.1 ; python_version < "3.9" + # via + # -c requirements/constraints.txt + # -r requirements/quality.txt # django -build==1.1.1 +build==1.2.1 # via # -r requirements/pip-tools.txt # pip-tools @@ -106,7 +111,7 @@ docutils==0.20.1 # via # -r requirements/quality.txt # readme-renderer -edx-django-utils==5.11.0 +edx-django-utils==5.12.0 # via -r requirements/quality.txt edx-lint==5.3.6 # via -r requirements/quality.txt @@ -118,7 +123,7 @@ exceptiongroup==1.2.0 # pytest fastavro==1.9.4 # via -r requirements/quality.txt -filelock==3.13.1 +filelock==3.13.4 # via # -r requirements/ci.txt # tox @@ -147,11 +152,11 @@ isort==5.13.2 # via # -r requirements/quality.txt # pylint -jaraco-classes==3.3.1 +jaraco-classes==3.4.0 # via # -r requirements/quality.txt # keyring -jaraco-context==4.3.0 +jaraco-context==5.3.0 # via # -r requirements/quality.txt # keyring @@ -169,7 +174,7 @@ jinja2==3.1.3 # -r requirements/quality.txt # code-annotations # diff-cover -keyring==25.0.0 +keyring==25.1.0 # via # -r requirements/quality.txt # twine @@ -198,11 +203,11 @@ more-itertools==10.2.0 # -r requirements/quality.txt # jaraco-classes # jaraco-functools -newrelic==9.7.1 +newrelic==9.8.0 # via # -r requirements/quality.txt # edx-django-utils -nh3==0.2.15 +nh3==0.2.17 # via # -r requirements/quality.txt # readme-renderer @@ -245,7 +250,7 @@ psutil==5.9.8 # edx-django-utils pycodestyle==2.11.1 # via -r requirements/quality.txt -pycparser==2.21 +pycparser==2.22 # via # -r requirements/quality.txt # cffi @@ -379,7 +384,7 @@ tox==4.14.2 # via -r requirements/ci.txt twine==5.0.0 # via -r requirements/quality.txt -typing-extensions==4.10.0 +typing-extensions==4.11.0 # via # -r requirements/quality.txt # asgiref diff --git a/requirements/doc.txt b/requirements/doc.txt index d442b3c6..06a3a454 100644 --- a/requirements/doc.txt +++ b/requirements/doc.txt @@ -18,13 +18,16 @@ babel==2.14.0 # via # pydata-sphinx-theme # sphinx -backports-zoneinfo==0.2.1 +backports-tarfile==1.0.0 + # via jaraco-context +backports-zoneinfo==0.2.1 ; python_version < "3.9" # via + # -c requirements/constraints.txt # -r requirements/test.txt # django beautifulsoup4==4.12.3 # via pydata-sphinx-theme -build==1.1.1 +build==1.2.1 # via -r requirements/doc.in certifi==2024.2.2 # via requests @@ -76,7 +79,7 @@ docutils==0.19 # readme-renderer # restructuredtext-lint # sphinx -edx-django-utils==5.11.0 +edx-django-utils==5.12.0 # via -r requirements/test.txt edx-opaque-keys[django]==2.5.1 # via -r requirements/test.txt @@ -103,9 +106,9 @@ iniconfig==2.0.0 # via # -r requirements/test.txt # pytest -jaraco-classes==3.3.1 +jaraco-classes==3.4.0 # via keyring -jaraco-context==4.3.0 +jaraco-context==5.3.0 # via keyring jaraco-functools==4.0.0 # via keyring @@ -118,7 +121,7 @@ jinja2==3.1.3 # -r requirements/test.txt # code-annotations # sphinx -keyring==25.0.0 +keyring==25.1.0 # via twine livereload==2.6.3 # via sphinx-autobuild @@ -134,11 +137,11 @@ more-itertools==10.2.0 # via # jaraco-classes # jaraco-functools -newrelic==9.7.1 +newrelic==9.8.0 # via # -r requirements/test.txt # edx-django-utils -nh3==0.2.15 +nh3==0.2.17 # via readme-renderer packaging==24.0 # via @@ -161,7 +164,7 @@ psutil==5.9.8 # via # -r requirements/test.txt # edx-django-utils -pycparser==2.21 +pycparser==2.22 # via # -r requirements/test.txt # cffi @@ -284,7 +287,7 @@ tornado==6.4 # via livereload twine==5.0.0 # via -r requirements/doc.in -typing-extensions==4.10.0 +typing-extensions==4.11.0 # via # -r requirements/test.txt # asgiref diff --git a/requirements/pip-tools.txt b/requirements/pip-tools.txt index 50451b3c..8ea29a86 100644 --- a/requirements/pip-tools.txt +++ b/requirements/pip-tools.txt @@ -4,7 +4,7 @@ # # make upgrade # -build==1.1.1 +build==1.2.1 # via pip-tools click==8.1.7 # via pip-tools diff --git a/requirements/quality.txt b/requirements/quality.txt index 6e3a3f9d..3080054f 100644 --- a/requirements/quality.txt +++ b/requirements/quality.txt @@ -15,8 +15,11 @@ astroid==2.15.8 # pylint-celery attrs==23.2.0 # via -r requirements/test.txt -backports-zoneinfo==0.2.1 +backports-tarfile==1.0.0 + # via jaraco-context +backports-zoneinfo==0.2.1 ; python_version < "3.9" # via + # -c requirements/constraints.txt # -r requirements/test.txt # django certifi==2024.2.2 @@ -68,7 +71,7 @@ django-waffle==4.1.0 # edx-django-utils docutils==0.20.1 # via readme-renderer -edx-django-utils==5.11.0 +edx-django-utils==5.12.0 # via -r requirements/test.txt edx-lint==5.3.6 # via -r requirements/quality.in @@ -97,9 +100,9 @@ isort==5.13.2 # via # -r requirements/quality.in # pylint -jaraco-classes==3.3.1 +jaraco-classes==3.4.0 # via keyring -jaraco-context==4.3.0 +jaraco-context==5.3.0 # via keyring jaraco-functools==4.0.0 # via keyring @@ -111,7 +114,7 @@ jinja2==3.1.3 # via # -r requirements/test.txt # code-annotations -keyring==25.0.0 +keyring==25.1.0 # via twine lazy-object-proxy==1.10.0 # via astroid @@ -129,11 +132,11 @@ more-itertools==10.2.0 # via # jaraco-classes # jaraco-functools -newrelic==9.7.1 +newrelic==9.8.0 # via # -r requirements/test.txt # edx-django-utils -nh3==0.2.15 +nh3==0.2.17 # via readme-renderer packaging==24.0 # via @@ -157,7 +160,7 @@ psutil==5.9.8 # edx-django-utils pycodestyle==2.11.1 # via -r requirements/quality.in -pycparser==2.21 +pycparser==2.22 # via # -r requirements/test.txt # cffi @@ -248,7 +251,7 @@ tomlkit==0.12.4 # via pylint twine==5.0.0 # via -r requirements/quality.in -typing-extensions==4.10.0 +typing-extensions==4.11.0 # via # -r requirements/test.txt # asgiref diff --git a/requirements/test.txt b/requirements/test.txt index b9352b31..52f4b9bc 100644 --- a/requirements/test.txt +++ b/requirements/test.txt @@ -10,8 +10,9 @@ asgiref==3.8.1 # django attrs==23.2.0 # via -r requirements/base.txt -backports-zoneinfo==0.2.1 +backports-zoneinfo==0.2.1 ; python_version < "3.9" # via + # -c requirements/constraints.txt # -r requirements/base.txt # django cffi==1.16.0 @@ -43,7 +44,7 @@ django-waffle==4.1.0 # via # -r requirements/base.txt # edx-django-utils -edx-django-utils==5.11.0 +edx-django-utils==5.12.0 # via -r requirements/base.txt edx-opaque-keys[django]==2.5.1 # via -r requirements/base.txt @@ -57,7 +58,7 @@ jinja2==3.1.3 # via code-annotations markupsafe==2.1.5 # via jinja2 -newrelic==9.7.1 +newrelic==9.8.0 # via # -r requirements/base.txt # edx-django-utils @@ -73,7 +74,7 @@ psutil==5.9.8 # via # -r requirements/base.txt # edx-django-utils -pycparser==2.21 +pycparser==2.22 # via # -r requirements/base.txt # cffi @@ -113,7 +114,7 @@ tomli==2.0.1 # via # coverage # pytest -typing-extensions==4.10.0 +typing-extensions==4.11.0 # via # -r requirements/base.txt # asgiref From 87e5c2336eebac208a3ad9b3e5c11c6a62c459d1 Mon Sep 17 00:00:00 2001 From: Maria Grimaldi Date: Wed, 10 Apr 2024 21:43:40 -0400 Subject: [PATCH 08/30] fix: add correct name for django settings module variable --- tox.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index ee534a5f..ea750c72 100644 --- a/tox.ini +++ b/tox.ini @@ -13,7 +13,7 @@ max-doc-length = 120 ignore = D101,D200,D203,D212,D215,D404,D405,D406,D407,D408,D409,D410,D411,D412,D413,D414 [pytest] -django_settings_module = test_utils.test_settings +DJANGO_SETTINGS_MODULE = test_utils.test_settings addopts = --cov openedx_events --cov-report term-missing --cov-report xml norecursedirs = .* docs requirements site-packages From a3ed3e1c2bec7305df746fba24972432766607f4 Mon Sep 17 00:00:00 2001 From: Maria Grimaldi Date: Wed, 10 Apr 2024 21:53:03 -0400 Subject: [PATCH 09/30] refactor: run bad args for callable test for python3.8/3.11 --- openedx_events/event_bus/tests/test_loader.py | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/openedx_events/event_bus/tests/test_loader.py b/openedx_events/event_bus/tests/test_loader.py index 720f3d7c..fae2c9f8 100644 --- a/openedx_events/event_bus/tests/test_loader.py +++ b/openedx_events/event_bus/tests/test_loader.py @@ -3,6 +3,8 @@ """ import copy +import sys +import pytest import warnings from contextlib import contextmanager from unittest import TestCase @@ -83,8 +85,9 @@ def test_missing_attribute(self): ) assert loaded == {'def': 'ault'} + @pytest.mark.skipif(sys.version_info < (3, 8), reason="requires Python 3.8+") @override_settings(EB_LOAD_PATH='builtins.dict') - def test_bad_args_for_callable(self): + def test_bad_args_for_callable_python38(self): with assert_warnings([ "Failed to load from setting EB_LOAD_PATH: " "TypeError('type object argument after * must be an iterable, not int'); " @@ -96,6 +99,20 @@ def test_bad_args_for_callable(self): ) assert loaded == {'def': 'ault'} + @pytest.mark.skipif(sys.version_info < (3, 11), reason="requires Python 3.11+") + @override_settings(EB_LOAD_PATH='builtins.dict') + def test_bad_args_for_callable_python311(self): + with assert_warnings([ + "Failed to load from setting EB_LOAD_PATH: " + "TypeError('dict() argument after * must be an iterable, not int'); " + "component will be inactive" + ]): + loaded = _try_load( + setting_name="EB_LOAD_PATH", args=(1), kwargs={'2': 3}, + expected_class=dict, default={'def': 'ault'}, + ) + assert loaded == {'def': 'ault'} + class TestProducer(TestCase): From 1a293a6d943d3b87288ef9fcc981f9b6c0a0e1b5 Mon Sep 17 00:00:00 2001 From: Maria Grimaldi Date: Wed, 10 Apr 2024 21:58:48 -0400 Subject: [PATCH 10/30] fix: use minor attribute instead of version tuple --- openedx_events/event_bus/tests/test_loader.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openedx_events/event_bus/tests/test_loader.py b/openedx_events/event_bus/tests/test_loader.py index fae2c9f8..d1abb493 100644 --- a/openedx_events/event_bus/tests/test_loader.py +++ b/openedx_events/event_bus/tests/test_loader.py @@ -85,7 +85,7 @@ def test_missing_attribute(self): ) assert loaded == {'def': 'ault'} - @pytest.mark.skipif(sys.version_info < (3, 8), reason="requires Python 3.8+") + @pytest.mark.skipif(sys.version_info.minor == 8, reason="requires Python 3.8+") @override_settings(EB_LOAD_PATH='builtins.dict') def test_bad_args_for_callable_python38(self): with assert_warnings([ @@ -99,7 +99,7 @@ def test_bad_args_for_callable_python38(self): ) assert loaded == {'def': 'ault'} - @pytest.mark.skipif(sys.version_info < (3, 11), reason="requires Python 3.11+") + @pytest.mark.skipif(sys.version_info.minor == 11, reason="requires Python 3.11+") @override_settings(EB_LOAD_PATH='builtins.dict') def test_bad_args_for_callable_python311(self): with assert_warnings([ From 51c150b02bf86c22531e6005ade0c8c14cf806dc Mon Sep 17 00:00:00 2001 From: Maria Grimaldi Date: Wed, 10 Apr 2024 22:00:51 -0400 Subject: [PATCH 11/30] fix: temporarily remove failing tests for python 3.11 --- openedx_events/event_bus/tests/test_loader.py | 28 ------------------- 1 file changed, 28 deletions(-) diff --git a/openedx_events/event_bus/tests/test_loader.py b/openedx_events/event_bus/tests/test_loader.py index d1abb493..e741acb1 100644 --- a/openedx_events/event_bus/tests/test_loader.py +++ b/openedx_events/event_bus/tests/test_loader.py @@ -85,34 +85,6 @@ def test_missing_attribute(self): ) assert loaded == {'def': 'ault'} - @pytest.mark.skipif(sys.version_info.minor == 8, reason="requires Python 3.8+") - @override_settings(EB_LOAD_PATH='builtins.dict') - def test_bad_args_for_callable_python38(self): - with assert_warnings([ - "Failed to load from setting EB_LOAD_PATH: " - "TypeError('type object argument after * must be an iterable, not int'); " - "component will be inactive" - ]): - loaded = _try_load( - setting_name="EB_LOAD_PATH", args=(1), kwargs={'2': 3}, - expected_class=dict, default={'def': 'ault'}, - ) - assert loaded == {'def': 'ault'} - - @pytest.mark.skipif(sys.version_info.minor == 11, reason="requires Python 3.11+") - @override_settings(EB_LOAD_PATH='builtins.dict') - def test_bad_args_for_callable_python311(self): - with assert_warnings([ - "Failed to load from setting EB_LOAD_PATH: " - "TypeError('dict() argument after * must be an iterable, not int'); " - "component will be inactive" - ]): - loaded = _try_load( - setting_name="EB_LOAD_PATH", args=(1), kwargs={'2': 3}, - expected_class=dict, default={'def': 'ault'}, - ) - assert loaded == {'def': 'ault'} - class TestProducer(TestCase): From 699e0da8f697c39b59db9407cf3c7b5f80315e1f Mon Sep 17 00:00:00 2001 From: Maria Grimaldi Date: Wed, 10 Apr 2024 22:10:35 -0400 Subject: [PATCH 12/30] refactor: manage python versions in CI workflow and tox.ini file --- .github/workflows/ci.yml | 9 ++------- tox.ini | 6 ++++-- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 78251d48..39d26602 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,13 +15,8 @@ jobs: strategy: matrix: os: [ubuntu-20.04] - python-version: - - '3.8' - - '3.11' - toxenv: - - "django42" - - "quality" - - "docs" + python-version: ['3.8', '3.11', '3.12'] + toxenv: ["django42", "quality", "docs"] steps: - uses: actions/checkout@v4 diff --git a/tox.ini b/tox.ini index ea750c72..ed826b22 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = django42, quality, docs +envlist = py{38, 311, 312}-django{42}, quality, docs [doc8] ignore = D001 @@ -26,6 +26,7 @@ commands = [testenv:docs] setenv = + DJANGO_SETTINGS_MODULE = test_utils.test_settings PYTHONPATH = {toxinidir} # Adding the option here instead of as a default in the docs Makefile because that Makefile is generated by shpinx. SPHINXOPTS = -W @@ -40,7 +41,8 @@ commands = rm -f docs/modules.rst make -e -C docs clean make -e -C docs html - python setup.py check --restructuredtext --strict + python -m build --wheel + twine check dist/* [testenv:quality] allowlist_externals = From 14e015a8274822edf43d468e450a4e02bfdbe869 Mon Sep 17 00:00:00 2001 From: Maria Grimaldi Date: Wed, 10 Apr 2024 22:17:15 -0400 Subject: [PATCH 13/30] refactor: modify tests so they pass in newer versions --- openedx_events/tests/test_producer_config.py | 14 ++++++-------- openedx_events/tests/test_tooling.py | 6 ++++-- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/openedx_events/tests/test_producer_config.py b/openedx_events/tests/test_producer_config.py index 1b89e07e..c2a3b855 100644 --- a/openedx_events/tests/test_producer_config.py +++ b/openedx_events/tests/test_producer_config.py @@ -42,18 +42,16 @@ def test_enabled_disabled_events(self, mock_producer): XBLOCK_PUBLISHED.send_event(xblock_info=self.xblock_info) mock_send.send.assert_called() mock_send.send.call_count = 2 + expected_call_args = [ + {'topic': 'enabled_topic_a', 'event_key_field': 'xblock_info.usage_key'}, + {'topic': 'enabled_topic_b', 'event_key_field': 'xblock_info.usage_key'} + ] # check that call_args_list only consists of enabled topics. call_args = mock_send.send.call_args_list[0][1] - self.assertDictContainsSubset( - {'topic': 'enabled_topic_a', 'event_key_field': 'xblock_info.usage_key'}, - call_args - ) + self.assertEqual(call_args, call_args | expected_call_args[0]) call_args = mock_send.send.call_args_list[1][1] - self.assertDictContainsSubset( - {'topic': 'enabled_topic_b', 'event_key_field': 'xblock_info.usage_key'}, - call_args - ) + self.assertEqual(call_args, call_args | expected_call_args[1]) @patch("openedx_events.apps.logger") @patch('openedx_events.apps.get_producer') diff --git a/openedx_events/tests/test_tooling.py b/openedx_events/tests/test_tooling.py index da480d3d..061aa4e0 100644 --- a/openedx_events/tests/test_tooling.py +++ b/openedx_events/tests/test_tooling.py @@ -111,8 +111,9 @@ def test_generate_signal_metadata(self, datetime_mock, socket_mock, events_packa } metadata = self.public_signal.generate_signal_metadata() + metadata_as_dict = attr.asdict(metadata) - self.assertDictContainsSubset(expected_metadata, attr.asdict(metadata)) + self.assertEqual(metadata_as_dict, expected_metadata | metadata_as_dict) self.assertIsInstance(metadata.id, UUID) @override_settings(SERVICE_VARIANT="lms") @@ -138,8 +139,9 @@ def test_generate_signal_metadata_with_valid_time(self, socket_mock, events_pack } metadata = self.public_signal.generate_signal_metadata(time=expected_time) + metadata_as_dict = attr.asdict(metadata) - self.assertDictContainsSubset(expected_metadata, attr.asdict(metadata)) + self.assertEqual(metadata_as_dict, expected_metadata | metadata_as_dict) self.assertIsInstance(metadata.id, UUID) @ddt.data( From 04dcd8f333255fd631f27bab0d2079d192f06e7c Mon Sep 17 00:00:00 2001 From: Maria Grimaldi Date: Wed, 10 Apr 2024 22:22:31 -0400 Subject: [PATCH 14/30] refactor: use operators valid for all python versions --- openedx_events/tests/test_producer_config.py | 4 ++-- openedx_events/tests/test_tooling.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/openedx_events/tests/test_producer_config.py b/openedx_events/tests/test_producer_config.py index c2a3b855..51bb5358 100644 --- a/openedx_events/tests/test_producer_config.py +++ b/openedx_events/tests/test_producer_config.py @@ -49,9 +49,9 @@ def test_enabled_disabled_events(self, mock_producer): # check that call_args_list only consists of enabled topics. call_args = mock_send.send.call_args_list[0][1] - self.assertEqual(call_args, call_args | expected_call_args[0]) + self.assertEqual(call_args, {**call_args, **expected_call_args[0]}) call_args = mock_send.send.call_args_list[1][1] - self.assertEqual(call_args, call_args | expected_call_args[1]) + self.assertEqual(call_args, {**call_args, **expected_call_args[1]}) @patch("openedx_events.apps.logger") @patch('openedx_events.apps.get_producer') diff --git a/openedx_events/tests/test_tooling.py b/openedx_events/tests/test_tooling.py index 061aa4e0..626cdb9e 100644 --- a/openedx_events/tests/test_tooling.py +++ b/openedx_events/tests/test_tooling.py @@ -113,7 +113,7 @@ def test_generate_signal_metadata(self, datetime_mock, socket_mock, events_packa metadata = self.public_signal.generate_signal_metadata() metadata_as_dict = attr.asdict(metadata) - self.assertEqual(metadata_as_dict, expected_metadata | metadata_as_dict) + self.assertEqual(metadata_as_dict, {**expected_metadata, **metadata_as_dict}) self.assertIsInstance(metadata.id, UUID) @override_settings(SERVICE_VARIANT="lms") @@ -141,7 +141,7 @@ def test_generate_signal_metadata_with_valid_time(self, socket_mock, events_pack metadata = self.public_signal.generate_signal_metadata(time=expected_time) metadata_as_dict = attr.asdict(metadata) - self.assertEqual(metadata_as_dict, expected_metadata | metadata_as_dict) + self.assertEqual(metadata_as_dict, {**expected_metadata, **metadata_as_dict}) self.assertIsInstance(metadata.id, UUID) @ddt.data( From 89439a072586bfcbfb2db5c38845db5b5e4a8bae Mon Sep 17 00:00:00 2001 From: Maria Grimaldi Date: Wed, 10 Apr 2024 22:25:05 -0400 Subject: [PATCH 15/30] refactor!: drop support for python3.12 --- .github/workflows/ci.yml | 2 +- tox.ini | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 39d26602..830fde6d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,7 +15,7 @@ jobs: strategy: matrix: os: [ubuntu-20.04] - python-version: ['3.8', '3.11', '3.12'] + python-version: ['3.8', '3.11'] toxenv: ["django42", "quality", "docs"] steps: diff --git a/tox.ini b/tox.ini index ed826b22..8bf4d7f7 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py{38, 311, 312}-django{42}, quality, docs +envlist = py{38, 311}-django{42}, quality, docs [doc8] ignore = D001 From 9eabe682c3932abc5aab28d510b4166bc7e5e572 Mon Sep 17 00:00:00 2001 From: Maria Grimaldi Date: Wed, 10 Apr 2024 22:27:20 -0400 Subject: [PATCH 16/30] fix: run coverage for django42 tox env --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 830fde6d..92552162 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -37,7 +37,7 @@ jobs: run: tox - name: Run coverage - if: matrix.python-version == '3.8' && matrix.toxenv == 'py38' + if: matrix.python-version == '3.8' && matrix.toxenv == 'django42' uses: codecov/codecov-action@v3 with: flags: unittests From b05803b91d8812fa1c807cd129cdfd7d3906f16e Mon Sep 17 00:00:00 2001 From: Maria Grimaldi Date: Wed, 10 Apr 2024 22:28:41 -0400 Subject: [PATCH 17/30] fix: don't fail for coverage report upload --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 92552162..949098a2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -41,4 +41,4 @@ jobs: uses: codecov/codecov-action@v3 with: flags: unittests - fail_ci_if_error: true + fail_ci_if_error: false From 1b42ffe138d9c9efe866c997d97eaa2ae6d8716d Mon Sep 17 00:00:00 2001 From: Maria Grimaldi Date: Wed, 10 Apr 2024 22:35:51 -0400 Subject: [PATCH 18/30] refactor: run bad args for callable test for python3.8/3.11 --- openedx_events/event_bus/tests/test_loader.py | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/openedx_events/event_bus/tests/test_loader.py b/openedx_events/event_bus/tests/test_loader.py index e741acb1..a4581e2a 100644 --- a/openedx_events/event_bus/tests/test_loader.py +++ b/openedx_events/event_bus/tests/test_loader.py @@ -85,6 +85,35 @@ def test_missing_attribute(self): ) assert loaded == {'def': 'ault'} + @pytest.mark.skipif(sys.version_info > (3, 9), reason="Python 3.8.x required") + @override_settings(EB_LOAD_PATH='builtins.dict') + def test_bad_args_for_callable(self): + with assert_warnings([ + "Failed to load from setting EB_LOAD_PATH: " + "TypeError('type object argument after * must be an iterable, not int'); " + "component will be inactive" + ]): + loaded = _try_load( + setting_name="EB_LOAD_PATH", args=(1), kwargs={'2': 3}, + expected_class=dict, default={'def': 'ault'}, + ) + assert loaded == {'def': 'ault'} + + + @pytest.mark.skipif(sys.version_info < (3, 9), reason="Python 3.11.x required") + @override_settings(EB_LOAD_PATH='builtins.dict') + def test_bad_args_for_callable(self): + with assert_warnings([ + "Failed to load from setting EB_LOAD_PATH: " + "TypeError('dict() argument after * must be an iterable, not int'); " + "component will be inactive" + ]): + loaded = _try_load( + setting_name="EB_LOAD_PATH", args=(1), kwargs={'2': 3}, + expected_class=dict, default={'def': 'ault'}, + ) + assert loaded == {'def': 'ault'} + class TestProducer(TestCase): From 45bf145ee9a43732cfb81a3cc4eb07ff591ef812 Mon Sep 17 00:00:00 2001 From: Maria Grimaldi Date: Wed, 10 Apr 2024 22:40:22 -0400 Subject: [PATCH 19/30] fix: go back to previous quality definition --- tox.ini | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index 8bf4d7f7..23863595 100644 --- a/tox.ini +++ b/tox.ini @@ -52,4 +52,10 @@ allowlist_externals = deps = -r{toxinidir}/requirements/quality.txt commands = - make quality + touch tests/__init__.py + pylint openedx_events tests test_utils manage.py setup.py + rm tests/__init__.py + pycodestyle openedx_events tests manage.py setup.py + pydocstyle openedx_events tests manage.py setup.py + isort --check-only --diff tests test_utils openedx_events manage.py setup.py + make selfcheck From abb16b105b6c459ac6d8d864c56aaa03a2b16d29 Mon Sep 17 00:00:00 2001 From: Maria Grimaldi Date: Wed, 10 Apr 2024 22:42:37 -0400 Subject: [PATCH 20/30] fix: remove extra blank line --- openedx_events/event_bus/tests/test_loader.py | 1 - 1 file changed, 1 deletion(-) diff --git a/openedx_events/event_bus/tests/test_loader.py b/openedx_events/event_bus/tests/test_loader.py index a4581e2a..84a9a4b1 100644 --- a/openedx_events/event_bus/tests/test_loader.py +++ b/openedx_events/event_bus/tests/test_loader.py @@ -99,7 +99,6 @@ def test_bad_args_for_callable(self): ) assert loaded == {'def': 'ault'} - @pytest.mark.skipif(sys.version_info < (3, 9), reason="Python 3.11.x required") @override_settings(EB_LOAD_PATH='builtins.dict') def test_bad_args_for_callable(self): From 21aadb31dcc37431142b8b5e765cc085cc31491d Mon Sep 17 00:00:00 2001 From: Maria Grimaldi Date: Wed, 10 Apr 2024 22:44:41 -0400 Subject: [PATCH 21/30] fix: add missing period for docstring --- openedx_events/content_authoring/data.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openedx_events/content_authoring/data.py b/openedx_events/content_authoring/data.py index e76559bf..1483ddbc 100644 --- a/openedx_events/content_authoring/data.py +++ b/openedx_events/content_authoring/data.py @@ -185,7 +185,7 @@ class LibraryBlockData: @attr.s(frozen=True) class ContentObjectData: """ - Data about changed content object + Data about changed content object. Arguments: object_id (str): identifier of the Content object. This represents the id of the course or library block From b1402b5d53b818fd612d600354fda45c2ee63c0c Mon Sep 17 00:00:00 2001 From: Maria Grimaldi Date: Wed, 10 Apr 2024 22:46:54 -0400 Subject: [PATCH 22/30] fix: run isort in test module --- openedx_events/event_bus/tests/test_loader.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openedx_events/event_bus/tests/test_loader.py b/openedx_events/event_bus/tests/test_loader.py index 84a9a4b1..271b8e17 100644 --- a/openedx_events/event_bus/tests/test_loader.py +++ b/openedx_events/event_bus/tests/test_loader.py @@ -4,11 +4,11 @@ import copy import sys -import pytest import warnings from contextlib import contextmanager from unittest import TestCase +import pytest from django.test import override_settings from openedx_events.data import EventsMetadata From f953534c6a6b36b14e8b573d81d1b6b6fc85d2f5 Mon Sep 17 00:00:00 2001 From: Maria Grimaldi Date: Thu, 11 Apr 2024 08:51:25 -0400 Subject: [PATCH 23/30] fix: add again pydocstyle docs --- requirements/constraints.txt | 1 - tox.ini | 16 ++++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/requirements/constraints.txt b/requirements/constraints.txt index 493d4012..7bcb44c8 100644 --- a/requirements/constraints.txt +++ b/requirements/constraints.txt @@ -16,6 +16,5 @@ # module refactor. astroid<3.0.0 - # Temporary to Support the python 3.11 Upgrade backports.zoneinfo;python_version<"3.9" # Newer versions have zoneinfo available in the standard library diff --git a/tox.ini b/tox.ini index 23863595..04e6274e 100644 --- a/tox.ini +++ b/tox.ini @@ -10,6 +10,22 @@ max-line-length = 120 max-doc-length = 120 [pydocstyle] +; D101 = Missing docstring in public class +; D200 = One-line docstring should fit on one line with quotes +; D203 = 1 blank line required before class docstring +; D212 = Multi-line docstring summary should start at the first line +; D215 = Section underline is over-indented (numpy style) +; D404 = First word of the docstring should not be This (numpy style) +; D405 = Section name should be properly capitalized (numpy style) +; D406 = Section name should end with a newline (numpy style) +; D407 = Missing dashed underline after section (numpy style) +; D408 = Section underline should be in the line following the section's name (numpy style) +; D409 = Section underline should match the length of its name (numpy style) +; D410 = Missing blank line after section (numpy style) +; D411 = Missing blank line before section (numpy style) +; D412 = No blank lines allowed between a section header and its content (numpy style) +; D413 = Missing blank line after last section (numpy style) +; D414 = Section has no content (numpy style) ignore = D101,D200,D203,D212,D215,D404,D405,D406,D407,D408,D409,D410,D411,D412,D413,D414 [pytest] From e8ec5ac3c8cf07e69e70eedc4556074dc3592cb1 Mon Sep 17 00:00:00 2001 From: Maria Grimaldi Date: Thu, 11 Apr 2024 09:54:50 -0400 Subject: [PATCH 24/30] docs: add inline comment explaining why skip test in different versions --- openedx_events/event_bus/tests/test_loader.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openedx_events/event_bus/tests/test_loader.py b/openedx_events/event_bus/tests/test_loader.py index 271b8e17..417b89c0 100644 --- a/openedx_events/event_bus/tests/test_loader.py +++ b/openedx_events/event_bus/tests/test_loader.py @@ -85,7 +85,7 @@ def test_missing_attribute(self): ) assert loaded == {'def': 'ault'} - @pytest.mark.skipif(sys.version_info > (3, 9), reason="Python 3.8.x required") + @pytest.mark.skipif(sys.version_info > (3, 9), reason="Python 3.8.x required") # Temporary until 3.8 is dropped @override_settings(EB_LOAD_PATH='builtins.dict') def test_bad_args_for_callable(self): with assert_warnings([ @@ -99,7 +99,7 @@ def test_bad_args_for_callable(self): ) assert loaded == {'def': 'ault'} - @pytest.mark.skipif(sys.version_info < (3, 9), reason="Python 3.11.x required") + @pytest.mark.skipif(sys.version_info < (3, 9), reason="Python 3.11.x required") # Temporary until 3.8 is dropped @override_settings(EB_LOAD_PATH='builtins.dict') def test_bad_args_for_callable(self): with assert_warnings([ From d756b3c7bf4b67c682e38a01809d40799730446d Mon Sep 17 00:00:00 2001 From: Maria Grimaldi Date: Thu, 11 Apr 2024 10:09:08 -0400 Subject: [PATCH 25/30] build: drop temp solution for astroid recursion error --- requirements/constraints.txt | 5 ----- requirements/dev.txt | 15 +++------------ requirements/doc.txt | 2 +- requirements/quality.txt | 11 +++-------- 4 files changed, 7 insertions(+), 26 deletions(-) diff --git a/requirements/constraints.txt b/requirements/constraints.txt index 7bcb44c8..1aeb4028 100644 --- a/requirements/constraints.txt +++ b/requirements/constraints.txt @@ -11,10 +11,5 @@ # Common constraints for openedx repos -c https://raw.githubusercontent.com/openedx/edx-lint/master/edx_lint/files/common_constraints.txt -# Temporary solution since this version raises RecursionError for test_generate_avro_schemas.py -# This should be removed once the issue is fixed with a new astroid release or with a test_generate_avro_schemas.py -# module refactor. -astroid<3.0.0 - # Temporary to Support the python 3.11 Upgrade backports.zoneinfo;python_version<"3.9" # Newer versions have zoneinfo available in the standard library diff --git a/requirements/dev.txt b/requirements/dev.txt index 50519892..7407b2e4 100644 --- a/requirements/dev.txt +++ b/requirements/dev.txt @@ -8,9 +8,8 @@ asgiref==3.8.1 # via # -r requirements/quality.txt # django -astroid==2.15.8 +astroid==3.1.0 # via - # -c requirements/constraints.txt # -r requirements/quality.txt # pylint # pylint-celery @@ -128,7 +127,7 @@ filelock==3.13.4 # -r requirements/ci.txt # tox # virtualenv -idna==3.6 +idna==3.7 # via # -r requirements/quality.txt # requests @@ -178,10 +177,6 @@ keyring==25.1.0 # via # -r requirements/quality.txt # twine -lazy-object-proxy==1.10.0 - # via - # -r requirements/quality.txt - # astroid markdown-it-py==3.0.0 # via # -r requirements/quality.txt @@ -262,7 +257,7 @@ pygments==2.17.2 # diff-cover # readme-renderer # rich -pylint==2.17.7 +pylint==3.1.0 # via # -r requirements/quality.txt # edx-lint @@ -405,10 +400,6 @@ wheel==0.43.0 # via # -r requirements/pip-tools.txt # pip-tools -wrapt==1.16.0 - # via - # -r requirements/quality.txt - # astroid zipp==3.18.1 # via # -r requirements/pip-tools.txt diff --git a/requirements/doc.txt b/requirements/doc.txt index 06a3a454..272fc555 100644 --- a/requirements/doc.txt +++ b/requirements/doc.txt @@ -89,7 +89,7 @@ exceptiongroup==1.2.0 # pytest fastavro==1.9.4 # via -r requirements/test.txt -idna==3.6 +idna==3.7 # via requests imagesize==1.4.1 # via sphinx diff --git a/requirements/quality.txt b/requirements/quality.txt index 3080054f..a39403a9 100644 --- a/requirements/quality.txt +++ b/requirements/quality.txt @@ -8,9 +8,8 @@ asgiref==3.8.1 # via # -r requirements/test.txt # django -astroid==2.15.8 +astroid==3.1.0 # via - # -c requirements/constraints.txt # pylint # pylint-celery attrs==23.2.0 @@ -83,7 +82,7 @@ exceptiongroup==1.2.0 # pytest fastavro==1.9.4 # via -r requirements/test.txt -idna==3.6 +idna==3.7 # via requests importlib-metadata==6.11.0 # via @@ -116,8 +115,6 @@ jinja2==3.1.3 # code-annotations keyring==25.1.0 # via twine -lazy-object-proxy==1.10.0 - # via astroid markdown-it-py==3.0.0 # via rich markupsafe==2.1.5 @@ -170,7 +167,7 @@ pygments==2.17.2 # via # readme-renderer # rich -pylint==2.17.7 +pylint==3.1.0 # via # edx-lint # pylint-celery @@ -263,8 +260,6 @@ urllib3==2.2.1 # via # requests # twine -wrapt==1.16.0 - # via astroid zipp==3.18.1 # via # importlib-metadata From cfff93e6a2d711e7b28421e93f2b319363f75c41 Mon Sep 17 00:00:00 2001 From: Maria Grimaldi Date: Thu, 11 Apr 2024 10:10:48 -0400 Subject: [PATCH 26/30] Revert "build: drop temp solution for astroid recursion error" This reverts commit d756b3c7bf4b67c682e38a01809d40799730446d. --- requirements/constraints.txt | 5 +++++ requirements/dev.txt | 15 ++++++++++++--- requirements/doc.txt | 2 +- requirements/quality.txt | 11 ++++++++--- 4 files changed, 26 insertions(+), 7 deletions(-) diff --git a/requirements/constraints.txt b/requirements/constraints.txt index 1aeb4028..7bcb44c8 100644 --- a/requirements/constraints.txt +++ b/requirements/constraints.txt @@ -11,5 +11,10 @@ # Common constraints for openedx repos -c https://raw.githubusercontent.com/openedx/edx-lint/master/edx_lint/files/common_constraints.txt +# Temporary solution since this version raises RecursionError for test_generate_avro_schemas.py +# This should be removed once the issue is fixed with a new astroid release or with a test_generate_avro_schemas.py +# module refactor. +astroid<3.0.0 + # Temporary to Support the python 3.11 Upgrade backports.zoneinfo;python_version<"3.9" # Newer versions have zoneinfo available in the standard library diff --git a/requirements/dev.txt b/requirements/dev.txt index 7407b2e4..50519892 100644 --- a/requirements/dev.txt +++ b/requirements/dev.txt @@ -8,8 +8,9 @@ asgiref==3.8.1 # via # -r requirements/quality.txt # django -astroid==3.1.0 +astroid==2.15.8 # via + # -c requirements/constraints.txt # -r requirements/quality.txt # pylint # pylint-celery @@ -127,7 +128,7 @@ filelock==3.13.4 # -r requirements/ci.txt # tox # virtualenv -idna==3.7 +idna==3.6 # via # -r requirements/quality.txt # requests @@ -177,6 +178,10 @@ keyring==25.1.0 # via # -r requirements/quality.txt # twine +lazy-object-proxy==1.10.0 + # via + # -r requirements/quality.txt + # astroid markdown-it-py==3.0.0 # via # -r requirements/quality.txt @@ -257,7 +262,7 @@ pygments==2.17.2 # diff-cover # readme-renderer # rich -pylint==3.1.0 +pylint==2.17.7 # via # -r requirements/quality.txt # edx-lint @@ -400,6 +405,10 @@ wheel==0.43.0 # via # -r requirements/pip-tools.txt # pip-tools +wrapt==1.16.0 + # via + # -r requirements/quality.txt + # astroid zipp==3.18.1 # via # -r requirements/pip-tools.txt diff --git a/requirements/doc.txt b/requirements/doc.txt index 272fc555..06a3a454 100644 --- a/requirements/doc.txt +++ b/requirements/doc.txt @@ -89,7 +89,7 @@ exceptiongroup==1.2.0 # pytest fastavro==1.9.4 # via -r requirements/test.txt -idna==3.7 +idna==3.6 # via requests imagesize==1.4.1 # via sphinx diff --git a/requirements/quality.txt b/requirements/quality.txt index a39403a9..3080054f 100644 --- a/requirements/quality.txt +++ b/requirements/quality.txt @@ -8,8 +8,9 @@ asgiref==3.8.1 # via # -r requirements/test.txt # django -astroid==3.1.0 +astroid==2.15.8 # via + # -c requirements/constraints.txt # pylint # pylint-celery attrs==23.2.0 @@ -82,7 +83,7 @@ exceptiongroup==1.2.0 # pytest fastavro==1.9.4 # via -r requirements/test.txt -idna==3.7 +idna==3.6 # via requests importlib-metadata==6.11.0 # via @@ -115,6 +116,8 @@ jinja2==3.1.3 # code-annotations keyring==25.1.0 # via twine +lazy-object-proxy==1.10.0 + # via astroid markdown-it-py==3.0.0 # via rich markupsafe==2.1.5 @@ -167,7 +170,7 @@ pygments==2.17.2 # via # readme-renderer # rich -pylint==3.1.0 +pylint==2.17.7 # via # edx-lint # pylint-celery @@ -260,6 +263,8 @@ urllib3==2.2.1 # via # requests # twine +wrapt==1.16.0 + # via astroid zipp==3.18.1 # via # importlib-metadata From e82569fe804407effa4078d6a4f7e73596672642 Mon Sep 17 00:00:00 2001 From: Maria Grimaldi Date: Thu, 11 Apr 2024 11:53:06 -0400 Subject: [PATCH 27/30] refactor: address PR reviews --- CHANGELOG.rst | 7 +++++++ openedx_events/__init__.py | 2 +- tests/test_openedx_events.py | 12 ------------ 3 files changed, 8 insertions(+), 13 deletions(-) delete mode 100644 tests/test_openedx_events.py diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 5ad7aad6..a1762b32 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -13,6 +13,13 @@ Change Log Unreleased ---------- + +[9.8.0] - 2024-04-11 + +Added +~~~~~ +* Added support for Python 3.11 + [9.7.0] - 2024-04-04 -------------------- Added diff --git a/openedx_events/__init__.py b/openedx_events/__init__.py index 9d5edda1..1b77b947 100644 --- a/openedx_events/__init__.py +++ b/openedx_events/__init__.py @@ -5,4 +5,4 @@ more information about the project. """ -__version__ = "9.7.0" +__version__ = "9.8.0" diff --git a/tests/test_openedx_events.py b/tests/test_openedx_events.py deleted file mode 100644 index 414734f3..00000000 --- a/tests/test_openedx_events.py +++ /dev/null @@ -1,12 +0,0 @@ -""" -Tests for openedx_events.py. -""" - - -class TestEvents: - """ - Tests of openedx events. - """ - - def test_something(self): - """TODO: Write real test cases.""" From 33b824846d4ba560611b5e51145a6792670d4e41 Mon Sep 17 00:00:00 2001 From: Maria Grimaldi Date: Thu, 11 Apr 2024 11:55:45 -0400 Subject: [PATCH 28/30] fix: remove tests folder from tests commands --- tox.ini | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/tox.ini b/tox.ini index 04e6274e..bc5f87df 100644 --- a/tox.ini +++ b/tox.ini @@ -68,9 +68,7 @@ allowlist_externals = deps = -r{toxinidir}/requirements/quality.txt commands = - touch tests/__init__.py - pylint openedx_events tests test_utils manage.py setup.py - rm tests/__init__.py + pylint openedx_events test_utils manage.py setup.py pycodestyle openedx_events tests manage.py setup.py pydocstyle openedx_events tests manage.py setup.py isort --check-only --diff tests test_utils openedx_events manage.py setup.py From 8a0a6ee059b414644f9d6e941d625aef8c3bef89 Mon Sep 17 00:00:00 2001 From: Maria Grimaldi Date: Thu, 11 Apr 2024 11:58:54 -0400 Subject: [PATCH 29/30] refactor: put check back for the time being --- tox.ini | 1 + 1 file changed, 1 insertion(+) diff --git a/tox.ini b/tox.ini index bc5f87df..10d8ce81 100644 --- a/tox.ini +++ b/tox.ini @@ -38,6 +38,7 @@ deps = django42: Django>=4.2,<4.3 -r{toxinidir}/requirements/test.txt commands = + python manage.py check pytest {posargs} [testenv:docs] From c419544eee866020265561ef146b726917647317 Mon Sep 17 00:00:00 2001 From: Maria Grimaldi Date: Thu, 11 Apr 2024 12:00:00 -0400 Subject: [PATCH 30/30] fix: remove tests folder from tests commands --- tox.ini | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tox.ini b/tox.ini index 10d8ce81..6fb74812 100644 --- a/tox.ini +++ b/tox.ini @@ -70,7 +70,7 @@ deps = -r{toxinidir}/requirements/quality.txt commands = pylint openedx_events test_utils manage.py setup.py - pycodestyle openedx_events tests manage.py setup.py - pydocstyle openedx_events tests manage.py setup.py - isort --check-only --diff tests test_utils openedx_events manage.py setup.py + pycodestyle openedx_events manage.py setup.py + pydocstyle openedx_events manage.py setup.py + isort --check-only --diff test_utils openedx_events manage.py setup.py make selfcheck