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/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.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 2c68104..f912f59 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..5e91e04 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py38, coverage, pylint +envlist = py{38,312}, coverage, pylint [testenv] deps =