-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
161 lines (143 loc) · 3.95 KB
/
pyproject.toml
File metadata and controls
161 lines (143 loc) · 3.95 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
158
159
160
161
[project]
name = "go-patch-it"
dynamic = ["version"]
description = "A tool to automatically find and apply patch version upgrades for Go modules and npm/yarn packages"
readme = "README.md"
requires-python = ">=3.8"
license = {text = "MIT"}
authors = [
{name = "William Grochocinski"}
]
keywords = ["go", "golang", "modules", "npm", "yarn", "package", "version", "upgrade", "patch"]
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.8",
"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",
"Programming Language :: Python :: 3.14",
"Topic :: Software Development :: Build Tools",
"Topic :: Software Development :: Libraries :: Python Modules",
]
[project.scripts]
go-patch-it = "go_patch_it.cli:main"
[build-system]
requires = ["hatchling==1.27.0"]
build-backend = "hatchling.build"
[tool.hatch.version]
path = "VERSION"
pattern = "^(?P<version>.*)$"
[tool.ruff]
# Target Python version
target-version = "py38"
line-length = 100
indent-width = 4
# Exclude common directories
exclude = [
".git",
".venv",
"__pycache__",
".mypy_cache",
".ruff_cache",
"build",
"dist",
"*.egg-info",
"vendor",
"node_modules",
]
[tool.ruff.lint]
# Enable rule sets
select = [
"E", # pycodestyle errors
"W", # pycodestyle warnings
"F", # pyflakes
"I", # isort
"N", # pep8-naming
"UP", # pyupgrade
"B", # flake8-bugbear
"C4", # flake8-comprehensions
"SIM", # flake8-simplify
"ARG", # flake8-unused-arguments
"PIE", # flake8-pie
"T20", # flake8-print
"PT", # flake8-pytest-style
"RET", # flake8-return
"RUF", # Ruff-specific rules
]
# Ignore specific rules
ignore = [
"E501", # Line too long (handled by formatter)
"ARG001", # Unused function argument (some functions need signature compatibility)
"RET504", # Unnecessary assignment before return (sometimes clearer)
]
# Allow autofix for all enabled rules
fixable = ["ALL"]
unfixable = []
# Allow unused variables when underscore-prefixed
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
[tool.ruff.lint.isort]
known-first-party = ["go_patch_it"]
[tool.ruff.lint.per-file-ignores]
# Allow print statements in scripts
"*.py" = ["T201"]
# Tests can have longer lines and more complex logic
"tests/*.py" = [
"E501",
"E402", # Module level import not at top (intentional for dynamic imports in tests)
"PLR2004", # Magic value used in comparison
"S101", # Use of assert detected
]
[tool.ruff.format]
# Use double quotes (Black-compatible)
quote-style = "double"
# Use spaces for indentation
indent-style = "space"
# Don't skip magic trailing comma
skip-magic-trailing-comma = false
# Auto-detect line endings
line-ending = "auto"
[tool.ty]
# Type checker configuration (Astral)
[tool.ty.analysis]
# Respect type: ignore comments
respect-type-ignore-comments = true
[tool.ty.src]
# Exclude test files from type checking
exclude = ["tests/**"]
[tool.ty.rules]
# Configure rule severity (ignore, warn, or error)
# Most rules default to error, but you can customize specific ones if needed
[tool.pytest.ini_options]
testpaths = ["tests"]
python_files = ["test_*.py"]
python_classes = ["Test*"]
python_functions = ["test_*"]
addopts = [
"-v",
"--strict-markers",
"--strict-config",
"--tb=short",
"--cov=.",
"--cov-report=term-missing",
"--cov-report=html",
]
[dependency-groups]
dev = [
# Testing
"pytest>=7.0.0",
"pytest-mock>=3.10.0",
"pytest-cov>=4.0.0",
# Linting and formatting
"ruff==0.14.14",
# Type checking
"ty==0.0.13",
# Pre-commit hooks
"pre-commit>=3.0.0",
# Building
"build==1.2.2.post1",
]