-
Notifications
You must be signed in to change notification settings - Fork 10
/
pyproject.toml
182 lines (148 loc) · 5.77 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
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
################################################################################
## Project Configuration
################################################################################
[project]
name = "pypacter"
description = "A simple Python project for testing Python proficiency."
dynamic = ["version"]
authors = [{ name = "JP-Ellis", email = "[email protected]" }]
maintainers = [{ name = "JP-Ellis", email = "[email protected]" }]
readme = "README.md"
license = { file = "LICENSE" }
keywords = ["pactflow", "pypacter"]
classifiers = [
"Development Status :: 3 - Alpha",
"Intended Audience :: Developers",
"License :: Other/Proprietary License",
"Natural Language :: English",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: Implementation :: CPython",
"Topic :: Software Development :: Code Generators",
]
requires-python = ">=3.13"
dependencies = ["langchain_openai~=0.2.9", "langchain~=0.3.7", "pyyaml~=6.0"]
[project.urls]
Documentation = "https://github.com/pactflow/pactflow-python-coding-test"
Issues = "https://github.com/pactflow/pactflow-python-coding-test/issues"
Source = "https://github.com/pactflow/pactflow-python-coding-test"
[project.optional-dependencies]
devel-test = ["pytest", "pytest-cov", "coverage[toml]"]
devel-types = ["mypy==1.13.0", "pydantic~=2.9", "types-pyyaml", "types-pygments"]
devel = [
"pypacter[devel-test,devel-types]",
"pypacter-api[devel]",
"ruff==0.8.0",
"ipykernel",
]
################################################################################
## Build System Configuration
################################################################################
[build-system]
requires = ["hatchling", "hatch-vcs"]
build-backend = "hatchling.build"
[tool.hatch.version]
source = "vcs"
[tool.hatch.build.hooks.vcs]
version-file = "src/pypacter/__version__.py"
[tool.hatch.envs.default]
installer = "uv"
features = ["devel"]
# This is require to get around an incompatibility between hatch and uv
# See: https://github.com/pypa/hatch/issues/1639
pre-install-commands = ["uv pip install .[devel]"]
[tool.hatch.envs.default.scripts]
lint = "ruff check --output-format full --show-fixes {args} src tests"
typecheck = "mypy . {args}"
format = "ruff format . {args}"
test = "pytest tests/ {args}"
test-all = "pytest tests/ pypacter-api/tests/ {args}"
all = ["format", "lint", "typecheck", "test"]
[tool.hatch.envs.test]
installer = "uv"
features = ["devel"]
# This is require to get around an incompatibility between hatch and uv
# See: https://github.com/pypa/hatch/issues/1639
pre-install-commands = ["uv pip install .[devel-test]"]
################################################################################
## UV Configuration
################################################################################
[tool.uv.workspace]
members = ["pypacter-api"]
[tool.uv.sources]
pypacter = { workspace = true }
pypacter-api = { workspace = true }
################################################################################
## Ruff Configuration
################################################################################
[tool.ruff]
[tool.ruff.lint]
select = ["ALL"]
ignore = [
"A001", # Forbid assigning built-ins
"A002", # Forbid shadowing built-ins
"D200", # Require single line docstrings to be on one line.
"D203", # Require blank line before class docstring
"D212", # Multi-line docstring summary must start at the first line
"FIX002", # Forbid TODO in comments
"RUF200", # Validate pyproject.toml (handled by Hatch)
"TD002", # Assign someone to 'TODO' comments
# The following are disabled for compatibility with the formatter
"COM812", # enforce trailing commas
"ISC001", # require imports to be sorted
]
[tool.ruff.lint.isort]
known-first-party = ["pypacter", "pypacter_api"]
[tool.ruff.lint.flake8-tidy-imports]
ban-relative-imports = "all"
banned-module-level-imports = [
# Use Pydantic V2 instead
"pydantic.v1",
]
[tool.ruff.lint.flake8-tidy-imports.banned-api]
"pydantic.v1".msg = "Use Pydantic V2 instead"
[tool.ruff.lint.pydocstyle]
convention = "google"
[tool.ruff.format]
preview = true
################################################################################
## PyTest Configuration
################################################################################
[tool.pytest.ini_options]
addopts = [
"--import-mode=importlib",
"--cov-config=pyproject.toml",
"--cov-report=xml",
]
################################################################################
## Mypy Configuration
################################################################################
[tool.mypy]
plugins = "pydantic.mypy"
################################################################################
## Coverage Configuration
################################################################################
[tool.coverage.paths]
pypacter = ["src/pypacter"]
tests = ["tests"]
[tool.coverage.report]
exclude_lines = [
"if __name__ == .__main__.:", # Ignore non-runnable code
"if TYPE_CHECKING:", # Ignore typing
"raise NotImplementedError", # Ignore defensive assertions
"@(abc\\.)?abstractmethod", # Ignore abstract methods
]
################################################################################
## Typos
################################################################################
[tool.typos.default]
extend-ignore-re = ["(?Rm)^.*(#|//)\\s*spellchecker:ignore$"]
################################################################################
## Yamlfix
################################################################################
[tool.yamlfix]
line_length = 100
whitelines = 1
section_whitelines = 1
sequence_style = "block_style"