-
Notifications
You must be signed in to change notification settings - Fork 0
/
pyproject.toml
108 lines (97 loc) · 2.98 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
[build-system]
requires = ["maturin>=1.0,<2.0"]
build-backend = "maturin"
[project]
name = "pynanoid"
description = "A tiny, secure, URL-friendly, unique string ID generator for Python written in Rust"
authors = [{ name = "Arunanshu Biswas", email = "[email protected]" }]
dependencies = []
requires-python = ">=3.9"
readme = "README.md"
license = { file = "LICENSE" }
classifiers = [
"Intended Audience :: Developers",
"Programming Language :: Rust",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Operating System :: OS Independent",
"License :: OSI Approved :: MIT License",
"Typing :: Typed",
]
# the version is derived from Cargo.toml by maturin
dynamic = ["version"]
[project.urls]
repository = "https://github.com/arunanshub/pynanoid"
"Bug Tracker" = "https://github.com/arunanshub/pynanoid/issues"
[tool.pdm]
distribution = true
[tool.pdm.dev-dependencies]
dev = ["ruff>=0.6.1", "mypy>=1.11.1", "pip>=24.2"]
test = [
"pytest>=8.3.2",
"pytest-cov>=5.0.0",
"pytest-xdist>=3.6.1",
"hypothesis>=6.111.1",
"pytest-sugar>=1.0.0",
"pytest-benchmark[histogram]>=4.0.0",
]
docs = [
"furo>=2024.8.6",
"sphinxext-opengraph>=0.9.1",
"sphinx-copybutton>=0.5.2",
]
[tool.maturin]
features = ["pyo3/extension-module"]
module-name = "pynanoid._pynanoid"
python-source = "src"
strip = true
[tool.ruff]
line-length = 80
target-version = "py39"
[tool.ruff.lint]
extend-select = [
'F', # Pyflakes
'E', # pycodestyle (Error)
'S', # bandit
'I', # isort
'UP', # pyupgrade
'YTT', # flake8-2020
'A', # flake8-builtins
'B', # flake8-bugbear
'T10', # flake8-debugger
'T20', # flake8-print
'C4', # flake8-comprehensions
'C90', # mccabe complexity
'PERF', # performance
'PT', # pytest
'ANN', # annotations
'FA', # future-annotations
'PL', # pylint
'PYI', # python stubs
]
[tool.ruff.lint.extend-per-file-ignores]
"src/**" = [
"PT", # ignore pytest lints in source files
]
"tests/**" = [
"ANN201", # ignore return type annotation in tests
'S', # bandit: assert safe to use in tests/
'PLR2004', # pylint: allow using magic values in tests/
]
# NOTE: we currently use cibuildwheel to build wheels in python. A more
# permanent solution would be to use maturin-action. However that requires
# more setup.
[tool.cibuildwheel]
skip = ["*-musllinux_i686"]
[tool.cibuildwheel.windows]
before-all = "rustup target add i686-pc-windows-msvc"
[tool.cibuildwheel.linux]
before-all = "curl -sSf https://sh.rustup.rs | sh -s -- -y"
environment = { PATH = "$PATH:$HOME/.cargo/bin" }