Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Updates to support Python up to 3.12 #398

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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
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,312}, coverage, pylint

[testenv]
deps =
Expand Down