Skip to content

Commit 1f66093

Browse files
committed
Switch to pyproject.toml
1 parent f888fd8 commit 1f66093

File tree

7 files changed

+131
-34
lines changed

7 files changed

+131
-34
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.

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.8"
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"

setup.py

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

tox.ini

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,12 @@ commands = isort --check-only --diff .
4141
[testenv:black]
4242
extras = tests
4343
skipsdist = True
44-
commands = black --check timeline_logger docs tests setup.py
44+
commands = black --check timeline_logger docs tests
45+
46+
[testenv:flake8]
47+
extras = tests
48+
skipsdist = True
49+
commands = flake8 .
4550

4651
[testenv:docs]
4752
basepython=python

0 commit comments

Comments
 (0)