Skip to content

Commit

Permalink
chore: Updates to support Python up to 3.12
Browse files Browse the repository at this point in the history
  • Loading branch information
bmtcril committed Feb 15, 2024
1 parent 215f898 commit 8c8590a
Show file tree
Hide file tree
Showing 14 changed files with 28 additions and 57 deletions.
5 changes: 2 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,15 @@ on:
branches:
- '**'


jobs:
run_tests:
name: tests
runs-on: ${{ matrix.os }}
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
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
~~~~~~~~~~~~~~~~~~

Expand Down
2 changes: 1 addition & 1 deletion edx_lint/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
1 change: 1 addition & 0 deletions edx_lint/pylint/annotations_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
1 change: 1 addition & 0 deletions edx_lint/write.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import os.path

import pkg_resources

from six.moves import cStringIO
from six.moves import configparser

Expand Down
1 change: 1 addition & 0 deletions requirements/base.in
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ click-log
pylint
pylint-django
pylint-celery
setuptools
six
11 changes: 4 additions & 7 deletions requirements/base.txt
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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
6 changes: 1 addition & 5 deletions requirements/ci.txt
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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
Expand Down
13 changes: 1 addition & 12 deletions requirements/dev.txt
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
11 changes: 1 addition & 10 deletions requirements/pip-tools.txt
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion requirements/pip.txt
Original file line number Diff line number Diff line change
@@ -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
Expand Down
16 changes: 1 addition & 15 deletions requirements/test.txt
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down
8 changes: 6 additions & 2 deletions test/plugins/pylint_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,12 @@ def test_invalid_python():
message = messages.pop()
# Pylint 1.x says the source is <string>, Pylint 2.x says <unknown>
message = message.replace("<string>", "XXX").replace("<unknown>", "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.
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tox]
envlist = py38, coverage, pylint
envlist = py{38,39,310,311,312}, coverage, pylint

[testenv]
deps =
Expand Down

0 comments on commit 8c8590a

Please sign in to comment.