diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9798706..d398e69 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -7,7 +7,6 @@ on: branches: - '**' - jobs: run_tests: name: tests @@ -15,8 +14,8 @@ jobs: strategy: matrix: os: [ubuntu-20.04] - python-version: ['3.8'] - toxenv: [py38, pylint] + python-version: ['3.12'] + toxenv: [py38, py312, pylint] steps: - uses: actions/checkout@v4 diff --git a/CHANGELOG.rst b/CHANGELOG.rst index a316179..fb589de 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -13,6 +13,12 @@ Change Log Unreleased ~~~~~~~~~~ +5.4.0 - 2024-02-15 +~~~~~~~~~~~~~~~~~~ + +* added support for Python 3.8 - 3.12 + + 5.3.5 - 2023-04-29 ~~~~~~~~~~~~~~~~~~ diff --git a/edx_lint/__init__.py b/edx_lint/__init__.py index ca0d1b3..de8bee6 100644 --- a/edx_lint/__init__.py +++ b/edx_lint/__init__.py @@ -2,4 +2,4 @@ edx_lint standardizes lint configuration and additional plugins for use in Open edX code. """ -__version__ = "5.3.6" +__version__ = "5.4.0" diff --git a/edx_lint/pylint/annotations_check.py b/edx_lint/pylint/annotations_check.py index b787276..42ba776 100644 --- a/edx_lint/pylint/annotations_check.py +++ b/edx_lint/pylint/annotations_check.py @@ -259,6 +259,7 @@ def __init__(self, *args, **kwargs): "code_annotations", os.path.join("contrib", "config", config_filename), ) + config = AnnotationConfig(config_path, verbosity=-1) search = StaticSearch(config) self.config_search.append((config, search)) diff --git a/edx_lint/write.py b/edx_lint/write.py index 4dda380..af0f021 100644 --- a/edx_lint/write.py +++ b/edx_lint/write.py @@ -6,6 +6,7 @@ import os.path import pkg_resources + from six.moves import cStringIO from six.moves import configparser diff --git a/requirements/base.in b/requirements/base.in index 7e6238a..a3d1ea9 100644 --- a/requirements/base.in +++ b/requirements/base.in @@ -6,4 +6,5 @@ click-log pylint pylint-django pylint-celery +setuptools six diff --git a/requirements/base.txt b/requirements/base.txt index 814a181..f639ab3 100644 --- a/requirements/base.txt +++ b/requirements/base.txt @@ -1,5 +1,5 @@ # -# This file is autogenerated by pip-compile with Python 3.8 +# This file is autogenerated by pip-compile with Python 3.12 # by the following command: # # make upgrade @@ -57,11 +57,8 @@ stevedore==5.1.0 # via code-annotations text-unidecode==1.3 # via python-slugify -tomli==2.0.1 - # via pylint tomlkit==0.12.3 # via pylint -typing-extensions==4.9.0 - # via - # astroid - # pylint + +# The following packages are considered to be unsafe in a requirements file: +# setuptools diff --git a/requirements/ci.txt b/requirements/ci.txt index 742e39c..9d19294 100644 --- a/requirements/ci.txt +++ b/requirements/ci.txt @@ -1,5 +1,5 @@ # -# This file is autogenerated by pip-compile with Python 3.8 +# This file is autogenerated by pip-compile with Python 3.12 # by the following command: # # make upgrade @@ -28,10 +28,6 @@ pluggy==1.4.0 # via tox pyproject-api==1.6.1 # via tox -tomli==2.0.1 - # via - # pyproject-api - # tox tox==4.12.1 # via -r requirements/ci.in virtualenv==20.25.0 diff --git a/requirements/dev.txt b/requirements/dev.txt index ad8ce51..34971a1 100644 --- a/requirements/dev.txt +++ b/requirements/dev.txt @@ -1,5 +1,5 @@ # -# This file is autogenerated by pip-compile with Python 3.8 +# This file is autogenerated by pip-compile with Python 3.12 # by the following command: # # make upgrade @@ -98,12 +98,6 @@ text-unidecode==1.3 # via # -r requirements/base.txt # python-slugify -tomli==2.0.1 - # via - # -r requirements/base.txt - # pylint - # pyproject-api - # tox tomlkit==0.12.3 # via # -r requirements/base.txt @@ -114,10 +108,5 @@ tox==3.28.0 # tox-battery tox-battery==0.6.2 # via -r requirements/dev.in -typing-extensions==4.9.0 - # via - # -r requirements/base.txt - # astroid - # pylint virtualenv==20.25.0 # via tox diff --git a/requirements/pip-tools.txt b/requirements/pip-tools.txt index 0e88226..b4998f8 100644 --- a/requirements/pip-tools.txt +++ b/requirements/pip-tools.txt @@ -1,5 +1,5 @@ # -# This file is autogenerated by pip-compile with Python 3.8 +# This file is autogenerated by pip-compile with Python 3.12 # by the following command: # # make upgrade @@ -8,23 +8,14 @@ build==1.0.3 # via pip-tools click==8.1.7 # via pip-tools -importlib-metadata==7.0.1 - # via build packaging==23.2 # via build pip-tools==7.3.0 # via -r requirements/pip-tools.in pyproject-hooks==1.0.0 # via build -tomli==2.0.1 - # via - # build - # pip-tools - # pyproject-hooks wheel==0.42.0 # via pip-tools -zipp==3.17.0 - # via importlib-metadata # The following packages are considered to be unsafe in a requirements file: # pip diff --git a/requirements/pip.txt b/requirements/pip.txt index 71954cc..4cfa72f 100644 --- a/requirements/pip.txt +++ b/requirements/pip.txt @@ -1,5 +1,5 @@ # -# This file is autogenerated by pip-compile with Python 3.8 +# This file is autogenerated by pip-compile with Python 3.12 # by the following command: # # make upgrade diff --git a/requirements/test.txt b/requirements/test.txt index d376bf3..f9b887c 100644 --- a/requirements/test.txt +++ b/requirements/test.txt @@ -1,5 +1,5 @@ # -# This file is autogenerated by pip-compile with Python 3.8 +# This file is autogenerated by pip-compile with Python 3.12 # by the following command: # # make upgrade @@ -36,8 +36,6 @@ django==3.2.24 # via # -c requirements/../edx_lint/files/common_constraints.txt # -r requirements/test.in -exceptiongroup==1.2.0 - # via pytest filelock==3.13.1 # via # -r requirements/dev.txt @@ -125,12 +123,6 @@ text-unidecode==1.3 # via # -r requirements/dev.txt # python-slugify -tomli==2.0.1 - # via - # -r requirements/dev.txt - # pylint - # pytest - # tox tomlkit==0.12.3 # via # -r requirements/dev.txt @@ -141,12 +133,6 @@ tox==3.28.0 # tox-battery tox-battery==0.6.2 # via -r requirements/dev.txt -typing-extensions==4.9.0 - # via - # -r requirements/dev.txt - # asgiref - # astroid - # pylint virtualenv==20.25.0 # via # -r requirements/dev.txt diff --git a/test/plugins/pylint_test.py b/test/plugins/pylint_test.py index a6c3342..450f10b 100644 --- a/test/plugins/pylint_test.py +++ b/test/plugins/pylint_test.py @@ -123,8 +123,12 @@ def test_invalid_python(): message = messages.pop() # Pylint 1.x says the source is , Pylint 2.x says message = message.replace("", "XXX").replace("", "XXX") - assert message == "1:syntax-error:Parsing failed: 'invalid syntax (XXX, line 1)'" - + assert message in ( + # Pre python 3.12 this error is returned + "1:syntax-error:Parsing failed: 'invalid syntax (XXX, line 1)'", + # Pythong 3.12+ this is the error + "1:syntax-error:Parsing failed: 'unterminated string literal (detected at line 1) (XXX, line 1)'", + ) # I would have tested that the msgids must be valid, but pylint doesn't seem # to mind being told to enable non-existent msgids. diff --git a/tox.ini b/tox.ini index 0c70e9e..027edc8 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py38, coverage, pylint +envlist = py{38,39,310,311,312}, coverage, pylint [testenv] deps =