Repository navigation
Expand file tree
/
Copy pathpyproject.toml
More file actions
157 lines (142 loc) · 4.67 KB
/
Copy pathpyproject.toml
File metadata and controls
157 lines (142 loc) · 4.67 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
[build-system]
requires = ["setuptools>=77"] # >=77 for PEP 639 SPDX `license`/`license-files`
build-backend = "setuptools.build_meta"
[project]
name = "django-tokenforge"
dynamic = ["version"]
description = "Stateless Bearer token authentication for Django REST Framework — HMAC-SHA256 access tokens, rotating refresh tokens with replay detection, and cross-subdomain exchange tokens."
readme = "README.md"
license = "MIT"
license-files = ["LICENSE"]
authors = [
{ name = "Oluwatosin Amokeodo", email = "oluwatosin.amokeodo@gmail.com"}
]
keywords = [
"django",
"djangorestframework",
"authentication",
"jwt",
"token",
"bearer",
"refresh-token",
"oauth",
"sso",
"hmac",
]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Environment :: Web Environment",
"Framework :: Django",
"Framework :: Django :: 4.2",
"Framework :: Django :: 5.0",
"Framework :: Django :: 5.1",
"Framework :: Django :: 5.2",
"Intended Audience :: Developers",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Topic :: Internet :: WWW/HTTP",
"Topic :: Security",
"Topic :: Software Development :: Libraries :: Python Modules",
]
requires-python = ">=3.10"
dependencies = [
"Django>=4.2",
"djangorestframework>=3.14",
]
[project.optional-dependencies]
redis = [
"redis>=4.0",
]
dev = [
"pytest>=8.0",
"pytest-django>=4.8",
"pytest-cov>=5.0",
"ruff>=0.4",
"mypy>=1.10",
"django-stubs>=5.0",
"djangorestframework-stubs>=3.15",
"fakeredis>=2.23",
"factory-boy>=3.3",
]
[project.urls]
Homepage = "https://github.com/Threx-code/tokenforge"
Documentation = "https://github.com/Threx-code/tokenforge#readme"
Repository = "https://github.com/Threx-code/tokenforge.git"
"Bug Tracker" = "https://github.com/Threx-code/tokenforge/issues"
Changelog = "https://github.com/Threx-code/tokenforge/blob/main/CHANGELOG.md"
[tool.setuptools.dynamic]
# Single source of truth for the version: tokenforge/__init__.py __version__.
version = { attr = "tokenforge.__version__" }
[tool.setuptools.packages.find]
where = ["."]
include = ["tokenforge*"]
exclude = ["tests*", "docs*"]
[tool.setuptools.package-data]
"tokenforge" = ["py.typed"]
# ── Ruff (linting + formatting) ───────────────────────────────────────────────
[tool.ruff]
target-version = "py310"
line-length = 100
[tool.ruff.lint]
select = [
"E", # pycodestyle errors
"W", # pycodestyle warnings
"F", # pyflakes
"I", # isort
"B", # flake8-bugbear
"C4", # flake8-comprehensions
"UP", # pyupgrade
"SIM", # flake8-simplify
"TCH", # flake8-type-checking
]
ignore = [
"E501", # line-too-long (handled by formatter)
"B008", # do not perform function calls in default arguments
]
[tool.ruff.lint.isort]
known-first-party = ["tokenforge"]
# ── Pytest ────────────────────────────────────────────────────────────────────
[tool.pytest.ini_options]
DJANGO_SETTINGS_MODULE = "tests.settings"
python_files = ["test_*.py", "*_test.py"]
python_classes = ["Test*"]
python_functions = ["test_*"]
addopts = [
"--strict-markers",
"--tb=short",
"-ra",
]
markers = [
"slow: marks tests as slow (deselect with '-m \"not slow\"')",
"integration: marks tests that require external services (Redis, PostgreSQL)",
]
# ── Coverage ──────────────────────────────────────────────────────────────────
[tool.coverage.run]
source = ["tokenforge"]
omit = [
"tokenforge/migrations/*",
"tokenforge/tests/*",
]
[tool.coverage.report]
show_missing = true
skip_covered = false
fail_under = 85
# ── Mypy ──────────────────────────────────────────────────────────────────────
[tool.mypy]
python_version = "3.10"
strict = true
ignore_missing_imports = true
plugins = [
"mypy_django_plugin.main",
"mypy_drf_plugin.main",
]
[[tool.mypy.overrides]]
module = "tokenforge.migrations.*"
ignore_errors = true
[tool.django-stubs]
django_settings_module = "tests.settings"