Skip to content

Commit 5448f8c

Browse files
Merge pull request #27 from maykinmedia/312
Add support for Python `3.12`, update metadata
2 parents 63f6566 + f600c89 commit 5448f8c

File tree

14 files changed

+181
-175
lines changed

14 files changed

+181
-175
lines changed

.bumpversion.cfg

Lines changed: 0 additions & 6 deletions
This file was deleted.

.coveragerc

Lines changed: 0 additions & 20 deletions
This file was deleted.

.flake8

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[flake8]
2+
max-line-length=88
3+
ignore=E501

.github/workflows/ci.yml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ jobs:
1616
runs-on: ubuntu-latest
1717
strategy:
1818
matrix:
19-
python: ['3.8', '3.9', '3.10', '3.11']
20-
django: ['3.2', '4.1', '4.2']
19+
python: ['3.10', '3.11', '3.12']
20+
django: ['3.2', '4.2']
2121
exclude:
22-
- python: '3.11'
22+
- python: ['3.11', '3.12']
2323
django: '3.2'
2424

2525
services:
@@ -35,8 +35,8 @@ jobs:
3535
name: Run the test suite (Python ${{ matrix.python }}, Django ${{ matrix.django }})
3636

3737
steps:
38-
- uses: actions/checkout@v2
39-
- uses: actions/setup-python@v2
38+
- uses: actions/checkout@v4
39+
- uses: actions/setup-python@v5
4040
with:
4141
python-version: ${{ matrix.python }}
4242

@@ -54,7 +54,7 @@ jobs:
5454
PGHOST: localhost
5555

5656
- name: Publish coverage report
57-
uses: codecov/codecov-action@v1
57+
uses: codecov/codecov-action@v3
5858

5959
publish:
6060
name: Publish package to PyPI
@@ -64,18 +64,18 @@ jobs:
6464
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
6565

6666
steps:
67-
- uses: actions/checkout@v2
68-
- uses: actions/setup-python@v2
67+
- uses: actions/checkout@v4
68+
- uses: actions/setup-python@v5
6969
with:
70-
python-version: '3.8'
70+
python-version: '3.10'
7171

7272
- name: Build sdist and wheel
7373
run: |
74-
pip install pip setuptools wheel --upgrade
75-
python setup.py sdist bdist_wheel
74+
pip install build --upgrade
75+
python -m build
7676
7777
- name: Publish a Python distribution to PyPI
78-
uses: pypa/gh-action-pypi-publish@v1.4.1
78+
uses: pypa/gh-action-pypi-publish@release/v1
7979
with:
8080
user: __token__
8181
password: ${{ secrets.PYPI_TOKEN }}

.github/workflows/code_quality.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ on:
77
- master
88
- develop
99
tags:
10+
- '*'
1011
paths:
1112
- "**.py"
1213
pull_request:
@@ -20,10 +21,10 @@ jobs:
2021
runs-on: ubuntu-latest
2122
strategy:
2223
matrix:
23-
toxenv: [isort, black, docs]
24+
toxenv: [isort, black, flake8, docs]
2425
steps:
25-
- uses: actions/checkout@v2
26-
- uses: actions/setup-python@v2
26+
- uses: actions/checkout@v4
27+
- uses: actions/setup-python@v5
2728
with:
2829
python-version: "3.11"
2930
- name: Install dependencies

.readthedocs.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# .readthedocs.yaml
2+
# Read the Docs configuration file
3+
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
4+
5+
version: 2
6+
7+
build:
8+
os: ubuntu-22.04
9+
tools:
10+
python: "3.10"
11+
12+
sphinx:
13+
configuration: docs/conf.py
14+
15+
python:
16+
install:
17+
- method: pip
18+
path: .
19+
extra_requirements:
20+
- docs

demo/manage.py

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,10 @@
77
try:
88
from django.core.management import execute_from_command_line
99
except ImportError:
10-
# The above import may fail for some other reason. Ensure that the
11-
# issue is really that Django is missing to avoid masking other
12-
# exceptions on Python 2.
13-
try:
14-
import django
15-
except ImportError:
16-
raise ImportError(
17-
"Couldn't import Django. Are you sure it's installed and "
18-
"available on your PYTHONPATH environment variable? Did you "
19-
"forget to activate a virtual environment?"
20-
)
21-
raise
10+
raise ImportError(
11+
"Couldn't import Django. Are you sure it's installed and "
12+
"available on your PYTHONPATH environment variable? Did you "
13+
"forget to activate a virtual environment?"
14+
)
15+
2216
execute_from_command_line(sys.argv)

docs/conf.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@
2020
# import os
2121
# import sys
2222
# sys.path.insert(0, os.path.abspath('.'))
23-
from pkg_resources import get_distribution
23+
from importlib.metadata import version as get_version
2424

25-
FULL_VERSION = get_distribution("django-timeline-logger").version
25+
FULL_VERSION = get_version("django-timeline-logger")
2626

2727
# -- General configuration ------------------------------------------------
2828

@@ -53,7 +53,7 @@
5353

5454
# General information about the project.
5555
project = "Django Timeline Logger"
56-
copyright = "2016-2018, Maykin Media"
56+
copyright = "2016, Maykin Media"
5757
author = "Maykin Media"
5858

5959
# The version info for the project you're documenting, acts as replacement for

docs/contributing.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ To run the tests in your (virtual) environment, simple execute
2525

2626
.. code-block:: sh
2727
28-
python setup.py test
28+
pytest
2929
3030
This will run the tests with the current python version and Django version
3131
installed in your virtual environment.

pyproject.toml

Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
[build-system]
2+
requires = ["setuptools>=61.0.0"]
3+
build-backend = "setuptools.build_meta"
4+
5+
[project]
6+
name = "django-timeline-logger"
7+
version = "3.0.0"
8+
description = "Generic event logger for Django models."
9+
authors = [
10+
{name = "Maykin Media", email = "[email protected]"}
11+
]
12+
readme = "README.rst"
13+
license = {file = "LICENSE"}
14+
keywords = ["django", "generic logging"]
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.10",
25+
"Programming Language :: Python :: 3.11",
26+
"Programming Language :: Python :: 3.12",
27+
"Topic :: Software Development :: Libraries :: Python Modules",
28+
]
29+
requires-python = ">=3.10"
30+
dependencies = [
31+
"django>=3.2",
32+
"django-appconf",
33+
]
34+
35+
[project.urls]
36+
Homepage = "https://github.com/maykinmedia/django-timeline-logger"
37+
Documentation = "http://django-timeline-logger.readthedocs.io/en/latest/"
38+
"Bug Tracker" = "https://github.com/maykinmedia/django-timeline-logger/issues"
39+
"Source Code" = "https://github.com/maykinmedia/django-timeline-logger"
40+
Changelog = "https://github.com/maykinmedia/django-timeline-logger/blob/master/docs/changelog.rst"
41+
42+
[project.optional-dependencies]
43+
tests = [
44+
"factory-boy",
45+
"psycopg2",
46+
"pytest",
47+
"pytest-cov",
48+
"pytest-django",
49+
"pytest-pep8",
50+
"pytest-pylint",
51+
"pytest-pythonpath",
52+
"pytest-runner",
53+
"tox",
54+
"black",
55+
"isort",
56+
"flake8",
57+
]
58+
coverage = [
59+
"pytest-cov",
60+
]
61+
docs = [
62+
"sphinx",
63+
"sphinx-rtd-theme",
64+
]
65+
release = [
66+
"bump-my-version",
67+
"twine",
68+
]
69+
70+
[tool.setuptools.packages.find]
71+
include = ["timeline_logger*"]
72+
namespaces = false
73+
74+
[tool.isort]
75+
profile = "black"
76+
combine_as_imports = true
77+
known_django = "django"
78+
known_first_party="timeline_logger"
79+
sections=["FUTURE", "STDLIB", "DJANGO", "THIRDPARTY", "FIRSTPARTY", "LOCALFOLDER"]
80+
81+
[tool.pytest.ini_options]
82+
testpaths = ["tests"]
83+
DJANGO_SETTINGS_MODULE = "tests.settings_pg"
84+
85+
[tool.bumpversion]
86+
current_version = "3.0.0"
87+
files = [
88+
{filename = "pyproject.toml"},
89+
{filename = "README.rst"},
90+
{filename = "docs/changelog.rst"},
91+
]
92+
93+
[tool.coverage.run]
94+
branch = true
95+
source = [
96+
"timeline_logger"
97+
]
98+
omit = [
99+
"demo/*",
100+
"*/migrations/*",
101+
"*/tests/*",
102+
]
103+
104+
[tool.coverage.report]
105+
exclude_also = [
106+
"if (typing\\.)?TYPE_CHECKING:",
107+
"@(typing\\.)?overload",
108+
"class .*\\(.*Protocol.*\\):",
109+
"@(abc\\.)?abstractmethod",
110+
"raise NotImplementedError",
111+
"\\.\\.\\.",
112+
"pass",
113+
]
114+
omit = [
115+
"demo/*",
116+
"*/migrations/*",
117+
"*/tests/*",
118+
]
119+
120+
[tool.coverage.html]
121+
directory = "cover"

0 commit comments

Comments
 (0)