-
Notifications
You must be signed in to change notification settings - Fork 3
/
pyproject.toml
161 lines (140 loc) · 4.99 KB
/
pyproject.toml
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
158
159
160
161
[build-system]
requires = ["pdm-backend"]
build-backend = "pdm.backend"
[project]
name = "cuid2"
dynamic = ["version"]
authors = [
{name = "Will Gordon", email = "[email protected]"},
]
description = "Next generation GUIDs. Collision-resistant ids optimized for horizontal scaling and performance."
readme = "README.md"
requires-python = ">=3.8"
license = {file = "LICENSE"}
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.8",
"Topic :: Security :: Cryptography",
"Typing :: Typed"
]
keywords = ['crypt', 'security', 'uuid', 'guid', 'cuid', 'cryptography']
[project.urls]
repository = "https://github.com/gordon-code/cuid2/"
[project.scripts]
cuid2 = "cuid2.cli:main"
[tool.pdm.version]
source = "scm"
[tool.pdm.scripts]
# Default to linting the entire src/ directory, but allow overriding with specific files
ruff-check = "ruff check --fix --exit-zero {args:src/ local/tests/}"
ruff-format = "ruff format {args:src/ local/tests/}"
spelling = "codespell {args:src/ local/tests/}"
pylint = "pylint {args:src/ local/tests/}"
safety = "safety {args:check --bare}"
typing = "mypy {args:src/ local/tests/}"
update-pip = "pip install --upgrade pip"
ruff-fix = {composite = ["ruff-check", "ruff-format"]}
lint-full = {composite = ["ruff-fix", "spelling", "pylint", "typing", "safety"]}
tox-full = {composite = ["update-pip", "lint-full"]}
testing = "pytest local/tests"
testing-slow = "pytest local/tests --runslow"
tox = "tox --parallel auto"
[tool.pdm.dev-dependencies]
lint = [
"codespell~=2.2.6", # https://github.com/codespell-project/codespell (latest: 2.2.6)
"pylint~=3.1.0", # https://github.com/pylint-dev/pylint (latest: 3.1.0)
"requests>=2.31.0", # https://github.com/psf/requests (latest: 2.31.0)
"ruff~=0.3.7", # https://github.com/astral-sh/ruff (latest: 0.3.7)
"safety==3.1.0", # https://github.com/pyupio/safety (latest: 3.1.0)
]
test = [
"pytest~=8.1.1", # https://github.com/pytest-dev/pytest (latest: 8.1.1)
"pytest-mock~=3.14.0", # https://github.com/pytest-dev/pytest-mock/ (latest: 3.14.0)
"pytest-sugar~=1.0.0", # https://github.com/Teemu/pytest-sugar (latest: 1.0.0)
]
tox = [
# Version reduced to prevent `packaging` conflict with safety
"tox~=4.14.2", # https://github.com/tox-dev/tox (latest: 4.14.2)
"tox-pdm~=0.7.2", # https://github.com/pdm-project/tox-pdm (latest: 0.7.2)
]
typing = [
"mypy~=1.9.0", # https://github.com/python/mypy (latest: 1.9.0)
]
[tool.tox]
legacy_tox_ini = """
[tox]
min_version = 4
env_list = py3{8,9,10,11,12}, check
work_dir = local/.tox
isolated_build = True
[testenv]
description = run unit tests
groups = test
commands = testing
[testenv:check]
description = run linters and typing
skip_install = true
groups = lint, typing, test
commands = tox-full
"""
[tool.ruff]
line-length = 120
src = ["src"]
target-version = "py38"
cache-dir = "local/.ruff_cache"
force-exclude = true
[tool.ruff.lint]
# https://docs.astral.sh/ruff/rules/
select = [
"F", "E", "W", "C90", "I", "N", "ASYNC",
"TRIO", "S", "BLE", "B", "A", "COM", "C4",
"DTZ", "T10", "EM", "FA", "ISC", "ICN",
"G", "INP", "PIE", "T20", "PT", "Q", "RSE",
"RET", "SLF", "SLOT", "SIM", "INT", "ARG",
"PTH", "PGH", "PL", "TRY", "FLY", "PERF",
"LOG", "RUF",
] # purposely not including "DJ", "YTT", "EXE", "PD", "NPY", "FBT" (boolean checking)
ignore = [
"D100", # Missing docstring in public module
"D101", # Missing docstring in public class
"D102", # Missing docstring in public method
"D104", # Missing docstring in public package
"D205", # Blank line required between summary line and description
"D401", # First line should be in imperative mood
"COM812", "ISC001", # Conflict with formatter
]
# Don't automatically remove `print`
# Stop automatically removing unused imports
unfixable = ["T201", "F401", "F841"]
[tool.ruff.lint.per-file-ignores]
# Ignore `assert` in test files (S101), magic values (PLR2004), and private member accessed (SLF001)
"test_*.py" = ["S101", "PLR2004", "SLF001"]
[tool.ruff.lint.isort]
known-first-party = ["src"]
section-order = ["future", "standard-library", "third-party", "first-party", "local-folder"]
[tool.ruff.lint.pydocstyle]
convention = "numpy"
[tool.pytest.ini_options]
minversion = "8.1"
cache_dir = "local/.pytest_cache"
python_files = "test_*.py"
[tool.pylint.master]
ignore-patterns = "test_.*.py"
[tool.pylint.format]
max-line-length = 120
[tool.pylint.messages_control]
disable = [
"missing-module-docstring",
"missing-class-docstring",
]
[tool.pylint.design]
max-parents = 13
max-args = 10
[tool.pylint.string]
check-quote-consistency = "yes"
[tool.mypy]
cache_dir = "local/.mypy_cache"