-
Notifications
You must be signed in to change notification settings - Fork 105
Expand file tree
/
Copy pathpyproject.toml
More file actions
129 lines (114 loc) · 3.57 KB
/
pyproject.toml
File metadata and controls
129 lines (114 loc) · 3.57 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
[build-system]
requires = ["setuptools>=42", "wheel", "setuptools_scm[toml]>=3.4", "pkgconfig>=1.5.1", "lxml>=3.8, !=4.7.0"]
[tool.mypy]
files = ['src']
ignore_missing_imports = false
warn_unused_configs = true
disallow_subclassing_any = true
disallow_any_generics = true
disallow_untyped_calls = true
disallow_untyped_defs = true
disallow_incomplete_defs = true
check_untyped_defs = true
disallow_untyped_decorators = true
disallow_any_unimported = true
strict_optional = true
no_implicit_optional = true
warn_redundant_casts = true
warn_unused_ignores = true
warn_return_any = true
warn_no_return = true
no_implicit_reexport = true
show_error_codes = true
[tool.ruff]
# Maximum line length, same as your original Black + Flake8 config
line-length = 130
# Target Python version (used for autofixes and style rules)
target-version = "py39"
# Directories and files to exclude from linting and formatting
exclude = [
".venv*", # virtual environments
".git", # git directory
"build", # build output
"dist", # distribution packages
"libs", # vendor libraries
".eggs", # setuptools egg folders
".direnv*", # direnv environments
"*_pb2.pyi" # protobuf-generated type stubs
]
[tool.ruff.lint]
# Enable rule categories:
# E = pycodestyle (style issues, like indentation, whitespace, etc.)
# F = pyflakes (unused imports, undefined names)
# I = isort (import sorting)
# B = flake8-bugbear (common bugs & anti-patterns)
# UP = pyupgrade (auto-upgrade syntax for newer Python)
# SIM = flake8-simplify (simplifiable code patterns)
# RUF = Ruff-native rules (extra, performance-optimized checks)
select = ["E", "F", "I", "B", "UP", "SIM", "RUF"]
# TODO: Add more rule categories as needed, e.g.:
# D = pydocstyle (docstring format/style issues)
[tool.ruff.lint.per-file-ignores]
"*.pyi" = [
# Ignore formatting and import errors in stub files
"E301", # expected 1 blank line, found 0
"E302", # expected 2 blank lines, found 1
"E305", # expected 2 blank lines after class or function
"E501", # line too long
"E701", # multiple statements on one line
"F401", # unused import
"F811", # redefinition of unused name
"F822" # undefined name in `__all__`
]
"doc/source/conf.py" = [
"D1" # missing docstring in public module/class/function
]
"doc/source/examples/*.py" = [
"D1", # allow missing docstrings in examples
"E501" # allow long lines in code examples
]
"tests/*.py" = [
"D1" # allow missing docstrings in test files
]
[tool.ruff.format]
# Always use single quotes (e.g., 'text' instead of "text")
quote-style = "single"
# Format code with or without trailing commas
# true = prefer trailing commas where valid
skip-magic-trailing-comma = false
# Enforce Unix-style line endings (LF)
line-ending = "lf"
[tool.cibuildwheel]
build = [
"cp39-*",
"cp310-*",
"cp311-*",
"cp312-*",
"cp313-*"
]
build-verbosity = 1
build-frontend = "build"
skip = [
"pp*", # Skips PyPy builds (pp38-*, pp39-*, etc.)
]
test-command = "pytest -v --color=yes {package}/tests"
before-test = "pip install -r requirements-test.txt"
test-skip = "*-macosx_arm64"
[tool.cibuildwheel.environment]
PYXMLSEC_STATIC_DEPS = "true"
[tool.cibuildwheel.linux]
archs = ["x86_64", "aarch64"]
environment-pass = [
"PYXMLSEC_LIBXML2_VERSION",
"PYXMLSEC_LIBXSLT_VERSION",
"PYXMLSEC_STATIC_DEPS",
"GH_TOKEN"
]
[tool.cibuildwheel.macos]
archs = ["x86_64", "arm64"]
before-all = "brew install perl"
[tool.cibuildwheel.windows]
archs = ["AMD64"]
[[tool.cibuildwheel.overrides]]
select = "*-manylinux*"
before-all = "yum install -y perl-core"