Skip to content

Commit daa2a41

Browse files
committed
Bump supported Python versions to be 3.8 to 3.13. Add test.yml GitHub workflow.
1 parent f2fbe4c commit daa2a41

File tree

4 files changed

+87
-39
lines changed

4 files changed

+87
-39
lines changed

.github/workflows/test.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Tests
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
strategy:
13+
matrix:
14+
python-version: ['3.8', '3.10', '3.12', '3.13']
15+
16+
steps:
17+
- uses: actions/checkout@v3
18+
19+
- name: Set up Python ${{ matrix.python-version }}
20+
uses: actions/setup-python@v4
21+
with:
22+
python-version: ${{ matrix.python-version }}
23+
24+
- name: Install dependencies
25+
run: |
26+
python -m pip install --upgrade pip
27+
pip install tox tox-gh-actions
28+
29+
- name: Test with tox
30+
run: tox
31+
env:
32+
TOXENV: ${{ matrix.python-version }}
33+
34+
quality:
35+
runs-on: ubuntu-latest
36+
steps:
37+
- uses: actions/checkout@v3
38+
39+
- name: Set up Python
40+
uses: actions/setup-python@v4
41+
with:
42+
python-version: '3.12'
43+
44+
- name: Install dependencies
45+
run: |
46+
python -m pip install --upgrade pip
47+
pip install tox
48+
49+
- name: Run quality checks
50+
run: tox -e quality

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ It receives the reports from the browser and does any/all of the following with
2121

2222
### Supported Django Versions
2323

24-
Supports Python 3.5 to 3.10 and Django 2.2 to 5.x (latest).
24+
Supports Python 3.8 to 3.12 and Django 3.2 to 5.x (latest).
2525

26-
Python 2.7 support is available in version 1.4 and/or the `python2.7-support` branch.
26+
The last version to support Python 2.7 was release 1.4 (or see the `python2.7-support` branch).
2727

2828

2929
### How Do I Use This Thing?

setup.py

Lines changed: 27 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -3,49 +3,50 @@
33
import os
44

55
PACKAGES = find_packages()
6-
REQUIREMENTS = ['django >=2.2,<5.3']
7-
TEST_REQUIREMENTS = ['coverage']
6+
REQUIREMENTS = ["django >=3.2,<5.3"]
7+
TEST_REQUIREMENTS = ["coverage"]
88
EXTRAS_REQUIRE = {
9-
'quality': ['isort', 'flake8'],
10-
'test': TEST_REQUIREMENTS,
9+
"quality": ["isort", "flake8"],
10+
"test": TEST_REQUIREMENTS,
1111
}
12-
CLASSIFIERS = ['License :: OSI Approved :: MIT License',
13-
'Framework :: Django',
14-
'Programming Language :: Python',
15-
'Programming Language :: Python :: 3',
16-
'Programming Language :: Python :: 3 :: Only',
17-
'Programming Language :: Python :: 3.4',
18-
'Programming Language :: Python :: 3.5',
19-
'Programming Language :: Python :: 3.6',
20-
'Programming Language :: Python :: 3.7',
21-
'Programming Language :: Python :: 3.8',
22-
'Programming Language :: Python :: 3.9',
23-
'Programming Language :: Python :: 3.10',
24-
'Programming Language :: Python :: 3.11']
12+
CLASSIFIERS = [
13+
"License :: OSI Approved :: MIT License",
14+
"Framework :: Django",
15+
"Programming Language :: Python",
16+
"Programming Language :: Python :: 3",
17+
"Programming Language :: Python :: 3 :: Only",
18+
"Programming Language :: Python :: 3.4",
19+
"Programming Language :: Python :: 3.5",
20+
"Programming Language :: Python :: 3.6",
21+
"Programming Language :: Python :: 3.7",
22+
"Programming Language :: Python :: 3.8",
23+
"Programming Language :: Python :: 3.9",
24+
"Programming Language :: Python :: 3.10",
25+
"Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12",
26+
]
2527

2628

2729
DESCRIPTION = (
28-
"A Django app for handling reports from web browsers of violations of your website's "
29-
"HTTP Content Security Policy."
30+
"A Django app for handling reports from web browsers of violations of your website's HTTP Content Security Policy."
3031
)
3132
LONG_DESCRIPTION = open(os.path.join(os.path.dirname(__file__), "README.md")).read()
3233

3334
setup(
34-
name='django-csp-reports',
35+
name="django-csp-reports",
3536
version="{{VERSION_PLACEHOLDER}}",
3637
description=DESCRIPTION,
3738
long_description=LONG_DESCRIPTION,
3839
long_description_content_type="text/markdown",
39-
author='Adam Alton',
40-
author_email='adamalton@gmail.com',
41-
url='https://github.com/adamalton/django-csp-reports',
40+
author="Adam Alton",
41+
author_email="adamalton@gmail.com",
42+
url="https://github.com/adamalton/django-csp-reports",
4243
packages=PACKAGES,
4344
include_package_data=True,
44-
python_requires='>=3.4',
45+
python_requires=">=3.4",
4546
install_requires=REQUIREMENTS,
4647
tests_require=TEST_REQUIREMENTS,
4748
extras_require=EXTRAS_REQUIRE,
48-
test_suite='runtests.runtests',
49-
keywords=['django', 'csp', 'content security policy'],
49+
test_suite="runtests.runtests",
50+
keywords=["django", "csp", "content security policy"],
5051
classifiers=CLASSIFIERS,
5152
)

tox.ini

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,22 @@
11
[tox]
22
envlist =
33
quality
4-
py35-{22}
5-
py36-{22,30}
6-
py37-{22,30}
7-
py38-{22,30,40}
8-
py39-{30,40}
9-
py310-{30,40,50}
4+
py38-{32,42}
5+
py310-{42,50}
6+
py312-{42,50}
7+
py313-{50}
108

119
# tox-travis block: mark quality as part of the python3.10 build
1210
[travis]
1311
python =
14-
3.10: py310, quality
12+
3.12: py312, quality
1513

1614
# Generic specification for all unspecific environments
1715
[testenv]
1816
deps =
1917
codecov
20-
22: django >= 2.2.8, < 2.3
21-
30: django >= 3.0.5, <4.0
22-
40: django >= 4.0, <5.0
18+
32: django >= 3.2.25, <4.0
19+
42: django >= 4.2.23, <5.0
2320
50: django >= 5.0, <5.3
2421
extras = test
2522
passenv = CI TRAVIS TRAVIS_*
@@ -31,7 +28,7 @@ commands =
3128
# Specific environments
3229
[testenv:quality]
3330
whitelist_externals = make
34-
basepython = python3.10
31+
basepython = python3.12
3532
extras = quality
3633
commands =
3734
make check-isort

0 commit comments

Comments
 (0)