Skip to content

Commit a238eb8

Browse files
committed
Switch to pyproject.toml, add support for Python 3.12
Actually run tests in CI Update actions versions Update gitignore
1 parent 121eda2 commit a238eb8

File tree

12 files changed

+213
-126
lines changed

12 files changed

+213
-126
lines changed

.coveragerc

-11
This file was deleted.

.github/workflows/ci.yml

+14-15
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,17 @@ jobs:
1515
runs-on: ubuntu-latest
1616
strategy:
1717
matrix:
18-
python: ['3.8', '3.9', '3.10', '3.11']
19-
django: ['3.2', '4.1', '4.2']
18+
python: ["3.8", "3.9", "3.10", "3.11", "3.12"]
19+
django: ["3.2", "4.2"]
2020
exclude:
21-
- python: '3.11'
22-
django: '3.2'
21+
- python: "3.11"
22+
django: "3.2"
23+
- python: "3.12"
24+
django: "3.2"
2325

2426
steps:
25-
- uses: actions/checkout@v3
26-
- uses: actions/setup-python@v4
27+
- uses: actions/checkout@v4
28+
- uses: actions/setup-python@v5
2729
with:
2830
python-version: ${{ matrix.python }}
2931

@@ -48,18 +50,15 @@ jobs:
4850
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
4951

5052
steps:
51-
- uses: actions/checkout@v3
52-
- uses: actions/setup-python@v4
53+
- uses: actions/checkout@v4
54+
- uses: actions/setup-python@v5
5355
with:
54-
python-version: '3.10'
56+
python-version: "3.10"
5557

56-
- name: Build sdist and wheel
58+
- name: Build wheel
5759
run: |
58-
pip install pip setuptools wheel --upgrade
59-
python setup.py sdist bdist_wheel
60+
pip install build --upgrade
61+
python -m build
6062
6163
- name: Publish a Python distribution to PyPI
6264
uses: pypa/gh-action-pypi-publish@release/v1
63-
with:
64-
user: __token__
65-
password: ${{ secrets.PYPI_TOKEN }}

.github/workflows/code-quality.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@ jobs:
2323
toxenv:
2424
- isort
2525
steps:
26-
- uses: actions/checkout@v3
27-
- uses: actions/setup-python@v4
26+
- uses: actions/checkout@v4
27+
- uses: actions/setup-python@v5
2828
with:
29-
python-version: '3.10'
29+
python-version: "3.10"
3030
- name: Install dependencies
3131
run: pip install tox
3232
- run: tox
3333
env:
34-
TOXENV: ${{ matrix.toxenv }}
34+
TOXENV: ${{ matrix.toxenv }}

.gitignore

+104-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,106 @@
1-
*.log
1+
# Byte-compiled / optimized / DLL files
2+
__pycache__/
3+
*.py[cod]
4+
*$py.class
5+
6+
# C extensions
7+
*.so
8+
9+
# Distribution / packaging
10+
.Python
11+
build/
12+
develop-eggs/
13+
dist/
14+
downloads/
15+
eggs/
16+
.eggs/
17+
lib/
18+
lib64/
19+
parts/
20+
sdist/
21+
var/
22+
wheels/
23+
*.egg-info/
24+
.installed.cfg
25+
*.egg
26+
MANIFEST
27+
28+
# PyInstaller
29+
# Usually these files are written by a python script from a template
30+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
31+
*.manifest
32+
*.spec
33+
34+
# Installer logs
35+
pip-log.txt
36+
pip-delete-this-directory.txt
37+
38+
# Unit test / coverage reports
39+
htmlcov/
40+
.tox/
41+
.coverage
42+
.coverage.*
43+
.cache
44+
nosetests.xml
45+
coverage.xml
46+
*.cover
47+
.hypothesis/
48+
.pytest_cache/
49+
reports/
50+
51+
# Translations
52+
# *.mo -> we want to package these along
253
*.pot
3-
*.pyc
54+
55+
# Django stuff:
56+
*.log
457
local_settings.py
5-
.tox
6-
.coverage
58+
db.sqlite3
59+
testapp/log_outgoing_requests.db
60+
61+
# Flask stuff:
62+
instance/
63+
.webassets-cache
64+
65+
# Scrapy stuff:
66+
.scrapy
67+
68+
# Sphinx documentation
69+
docs/_build/
70+
71+
# PyBuilder
72+
target/
73+
74+
# Jupyter Notebook
75+
.ipynb_checkpoints
76+
77+
# pyenv
78+
.python-version
79+
80+
# celery beat schedule file
81+
celerybeat-schedule
82+
83+
# SageMath parsed files
84+
*.sage.py
85+
86+
# Environments
87+
.env
88+
.venv
89+
env/
90+
venv/
91+
ENV/
92+
env.bak/
93+
venv.bak/
94+
95+
# Spyder project settings
96+
.spyderproject
97+
.spyproject
98+
99+
# Rope project settings
100+
.ropeproject
101+
102+
# mkdocs documentation
103+
/site
104+
105+
# mypy
106+
.mypy_cache/

.travis.yml

-40
This file was deleted.

django_regex_redirects.egg-info/PKG-INFO

-9
This file was deleted.

django_regex_redirects.egg-info/SOURCES.txt

-19
This file was deleted.

django_regex_redirects.egg-info/dependency_links.txt

-1
This file was deleted.

django_regex_redirects.egg-info/top_level.txt

-1
This file was deleted.

pyproject.toml

+85
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
[build-system]
2+
requires = ["setuptools>=61.0.0"]
3+
build-backend = "setuptools.build_meta"
4+
5+
[project]
6+
name = "django-regex-redirects"
7+
version = "0.4.0"
8+
description = "Django redirects, with regular expressions"
9+
authors = [
10+
{name = "Alex de Landgraaf", email = "[email protected]"}
11+
]
12+
readme = "README.md"
13+
license = {file = "LICENSE"}
14+
keywords = ["Django", "regex"]
15+
classifiers = [
16+
"Development Status :: 5 - Production/Stable",
17+
"Framework :: Django",
18+
"Framework :: Django :: 3.2",
19+
"Framework :: Django :: 4.2",
20+
"Intended Audience :: Developers",
21+
"Operating System :: Unix",
22+
"Operating System :: MacOS",
23+
"Operating System :: Microsoft :: Windows",
24+
"Programming Language :: Python :: 3.8",
25+
"Programming Language :: Python :: 3.9",
26+
"Programming Language :: Python :: 3.10",
27+
"Programming Language :: Python :: 3.11",
28+
"Programming Language :: Python :: 3.12",
29+
"Topic :: Software Development :: Libraries :: Python Modules",
30+
]
31+
requires-python = ">=3.8"
32+
dependencies = [
33+
"django>=3.2",
34+
]
35+
36+
[project.urls]
37+
Homepage = "https://github.com/maykinmedia/django-regex-redirects"
38+
"Bug Tracker" = "https://github.com/maykinmedia/django-regex-redirects/issues"
39+
"Source Code" = "https://github.com/maykinmedia/django-regex-redirects"
40+
41+
[project.optional-dependencies]
42+
tests = [
43+
"tox",
44+
"isort",
45+
"black",
46+
"flake8",
47+
]
48+
49+
[tool.setuptools.packages.find]
50+
include = ["regex_redirects*"]
51+
namespaces = false
52+
53+
[tool.isort]
54+
profile = "black"
55+
combine_as_imports = true
56+
known_django = "django"
57+
known_first_party="regex_redirects"
58+
sections=["FUTURE", "STDLIB", "DJANGO", "THIRDPARTY", "FIRSTPARTY", "LOCALFOLDER"]
59+
skip = ["env", ".tox", ".history"]
60+
61+
[tool.coverage.run]
62+
branch = true
63+
source = [
64+
"regex_redirects"
65+
]
66+
omit = [
67+
"regex_redirects/migrations/*",
68+
]
69+
70+
[tool.coverage.report]
71+
exclude_also = [
72+
"if (typing\\.)?TYPE_CHECKING:",
73+
"@(typing\\.)?overload",
74+
"class .*\\(.*Protocol.*\\):",
75+
"@(abc\\.)?abstractmethod",
76+
"raise NotImplementedError",
77+
"\\.\\.\\.",
78+
"pass",
79+
]
80+
omit = [
81+
"regex_redirects/migrations/*",
82+
]
83+
84+
[tool.coverage.html]
85+
directory = "cover"

setup.py

-16
This file was deleted.

0 commit comments

Comments
 (0)