Skip to content

Commit dcfdd17

Browse files
authored
Merge pull request #161 from openedx/bmtcril/django_52
chore: Add support for Django 5.2
2 parents f5f60bc + c9dbd87 commit dcfdd17

File tree

4 files changed

+44
-42
lines changed

4 files changed

+44
-42
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ jobs:
1414
strategy:
1515
matrix:
1616
os: [ubuntu-latest]
17-
python-version: ['3.11', '3.12']
18-
toxenv: [quality, docs, django42]
17+
python-version: ["3.11", "3.12"]
18+
toxenv: [quality, docs, django42, django52]
1919

2020
steps:
2121
- uses: actions/checkout@v4

code_annotations/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
Extensible tools for parsing annotations in codebases.
33
"""
44

5-
__version__ = '2.2.0'
5+
__version__ = "2.3.0"

setup.py

Lines changed: 39 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,10 @@ def get_version(*file_paths):
1616
"""
1717
filename = os.path.join(os.path.dirname(__file__), *file_paths)
1818
version_file = open(filename).read()
19-
version_match = re.search(r"^__version__ = ['\"]([^'\"]*)['\"]",
20-
version_file, re.M)
19+
version_match = re.search(r"^__version__ = ['\"]([^'\"]*)['\"]", version_file, re.M)
2120
if version_match:
2221
return version_match.group(1)
23-
raise RuntimeError('Unable to find version string.')
22+
raise RuntimeError("Unable to find version string.")
2423

2524

2625
def load_requirements(*requirements_paths):
@@ -33,7 +32,8 @@ def load_requirements(*requirements_paths):
3332
requirements = set()
3433
for path in requirements_paths:
3534
requirements.update(
36-
line.split('#')[0].strip() for line in open(path).readlines()
35+
line.split("#")[0].strip()
36+
for line in open(path).readlines()
3737
if is_requirement(line.strip())
3838
)
3939
return list(requirements)
@@ -47,64 +47,65 @@ def is_requirement(line):
4747
bool: True if the line is not blank, a comment, a URL, or an included file
4848
"""
4949
return not (
50-
line == '' or
51-
line.startswith('-r') or
52-
line.startswith('#') or
53-
line.startswith('-e') or
54-
line.startswith('git+') or
55-
line.startswith('-c')
50+
line == ""
51+
or line.startswith("-r")
52+
or line.startswith("#")
53+
or line.startswith("-e")
54+
or line.startswith("git+")
55+
or line.startswith("-c")
5656
)
5757

5858

59-
VERSION = get_version('code_annotations', '__init__.py')
59+
VERSION = get_version("code_annotations", "__init__.py")
6060

61-
if sys.argv[-1] == 'tag':
61+
if sys.argv[-1] == "tag":
6262
print("Tagging the version on github:")
6363
os.system("git tag -a %s -m 'version %s'" % (VERSION, VERSION))
6464
os.system("git push --tags")
6565
sys.exit()
6666

67-
README = open(os.path.join(os.path.dirname(__file__), 'README.rst')).read()
68-
CHANGELOG = open(os.path.join(os.path.dirname(__file__), 'CHANGELOG.rst')).read()
67+
README = open(os.path.join(os.path.dirname(__file__), "README.rst")).read()
68+
CHANGELOG = open(os.path.join(os.path.dirname(__file__), "CHANGELOG.rst")).read()
6969

7070
setup(
71-
name='code-annotations',
71+
name="code-annotations",
7272
version=VERSION,
7373
description="""Extensible tools for parsing annotations in codebases""",
74-
long_description=README + '\n\n' + CHANGELOG,
75-
long_description_content_type='text/x-rst',
76-
author='edX',
77-
author_email='oscm@edx.org',
78-
url='https://github.com/openedx/code-annotations',
74+
long_description=README + "\n\n" + CHANGELOG,
75+
long_description_content_type="text/x-rst",
76+
author="edX",
77+
author_email="oscm@edx.org",
78+
url="https://github.com/openedx/code-annotations",
7979
packages=[
80-
'code_annotations',
80+
"code_annotations",
8181
],
8282
entry_points={
83-
'console_scripts': [
84-
'code_annotations = code_annotations.cli:entry_point',
83+
"console_scripts": [
84+
"code_annotations = code_annotations.cli:entry_point",
8585
],
86-
'annotation_finder.searchers': [
87-
'javascript = code_annotations.extensions.javascript:JavascriptAnnotationExtension',
88-
'python = code_annotations.extensions.python:PythonAnnotationExtension',
86+
"annotation_finder.searchers": [
87+
"javascript = code_annotations.extensions.javascript:JavascriptAnnotationExtension",
88+
"python = code_annotations.extensions.python:PythonAnnotationExtension",
8989
],
9090
},
9191
include_package_data=True,
92-
install_requires=load_requirements('requirements/base.in'),
92+
install_requires=load_requirements("requirements/base.in"),
9393
extras_require={"django": ["Django>=4.2"]},
9494
license="Apache Software License 2.0",
9595
zip_safe=False,
96-
keywords='edx pii code annotations',
96+
keywords="edx pii code annotations",
9797
python_requires=">=3.11",
9898
classifiers=[
99-
'Development Status :: 3 - Alpha',
100-
'Framework :: Django',
101-
'Framework :: Django :: 4.2',
102-
'Intended Audience :: Developers',
103-
'License :: OSI Approved :: Apache Software License',
104-
'Natural Language :: English',
105-
'Programming Language :: Python',
106-
'Programming Language :: Python :: 3',
107-
'Programming Language :: Python :: 3.11',
108-
'Programming Language :: Python :: 3.12',
99+
"Development Status :: 3 - Alpha",
100+
"Framework :: Django",
101+
"Framework :: Django :: 4.2",
102+
"Framework :: Django :: 5.2",
103+
"Intended Audience :: Developers",
104+
"License :: OSI Approved :: Apache Software License",
105+
"Natural Language :: English",
106+
"Programming Language :: Python",
107+
"Programming Language :: Python :: 3",
108+
"Programming Language :: Python :: 3.11",
109+
"Programming Language :: Python :: 3.12",
109110
],
110111
)

tox.ini

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[tox]
2-
envlist = py{311,312}-django{42}
2+
envlist = py{311,312}-django{42,52}
33

44
[doc8]
55
ignore = D001
@@ -18,6 +18,7 @@ norecursedirs = .* docs requirements
1818
[testenv]
1919
deps =
2020
django42: Django>=4.2,<4.3
21+
django52: Django>=5.2,<5.3
2122
-r{toxinidir}/requirements/test.txt
2223
commands =
2324
python -Wd -m pytest {posargs}

0 commit comments

Comments
 (0)