Skip to content

Commit 9f20e85

Browse files
Copilotsobolevn
andauthored
Convert pyproject.toml to regular format and remove pyproject-fmt from pre-commit (#2374)
Agent-Logs-Url: https://github.com/dry-python/returns/sessions/6bb8b66e-c7c6-4b5b-94ee-0b53541e0fa1 Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: sobolevn <4660275+sobolevn@users.noreply.github.com>
1 parent 3a21661 commit 9f20e85

File tree

2 files changed

+91
-63
lines changed

2 files changed

+91
-63
lines changed

.pre-commit-config.yaml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,6 @@ repos:
1818
rev: v0.11.0.1
1919
hooks:
2020
- id: shellcheck
21-
- repo: https://github.com/tox-dev/pyproject-fmt
22-
rev: v2.21.1
23-
hooks:
24-
- id: pyproject-fmt
2521
- repo: https://github.com/astral-sh/ruff-pre-commit
2622
rev: v0.15.10
2723
hooks:

pyproject.toml

Lines changed: 91 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,22 @@
11
[build-system]
22
build-backend = "poetry.core.masonry.api"
3-
requires = [ "poetry-core>=2" ]
3+
requires = ["poetry-core>=2"]
44

55
[tool.poetry]
66
name = "returns"
77
version = "0.26.0"
88
description = "Make your functions return something meaningful, typed, and safe!"
99
license = "BSD-3-Clause"
10-
authors = [ "sobolevn <mail@sobolevn.me>" ]
10+
11+
authors = [
12+
"sobolevn <mail@sobolevn.me>",
13+
]
14+
1115
readme = "README.md"
16+
1217
repository = "https://github.com/dry-python/returns"
1318
homepage = "https://returns.readthedocs.io"
19+
1420
keywords = [
1521
"functional programming",
1622
"fp",
@@ -22,6 +28,7 @@ keywords = [
2228
"mypy",
2329
"railway-oriented-programming",
2430
]
31+
2532
classifiers = [
2633
"Development Status :: 4 - Beta",
2734
"Intended Audience :: Developers",
@@ -31,47 +38,68 @@ classifiers = [
3138
"Topic :: Utilities",
3239
"Typing :: Typed",
3340
]
34-
dependencies.python = "^3.10"
35-
dependencies.typing-extensions = ">=4.0,<5.0"
36-
dependencies.pytest = { version = ">=8,<10", optional = true }
37-
dependencies.hypothesis = { version = "^6.151", optional = true }
38-
dependencies.mypy = { version = ">=1.19,<1.21", optional = true }
39-
extras.compatible-mypy = [ "mypy" ]
40-
extras.check-laws = [ "pytest", "hypothesis" ]
41-
group.dev.dependencies.anyio = "^4.3"
42-
group.dev.dependencies.trio = ">=0.30,<0.33"
43-
group.dev.dependencies.attrs = "^25.3"
44-
group.dev.dependencies.httpx = "^0.28"
45-
group.dev.dependencies.wemake-python-styleguide = "^1.3"
46-
group.dev.dependencies.codespell = "^2.2"
47-
group.dev.dependencies.slotscheck = "^0.19"
48-
group.dev.dependencies.ruff = ">=0.12,<0.15"
49-
group.dev.dependencies.pytest-cov = ">=6,<8"
50-
group.dev.dependencies.pytest-randomly = ">=3.12,<5.0"
51-
group.dev.dependencies.pytest-mypy-plugins = "^3.1"
52-
group.dev.dependencies.pytest-subtests = ">=0.14,<0.16"
53-
group.dev.dependencies.pytest-shard = "^0.1"
54-
group.dev.dependencies.covdefaults = "^2.3"
55-
group.docs.optional = true
56-
group.docs.dependencies.sphinx = "^8.1"
57-
group.docs.dependencies.sphinx-autodoc-typehints = ">=2.3,<4.0"
58-
group.docs.dependencies.sphinxcontrib-mermaid = ">=1,<3"
59-
group.docs.dependencies.furo = ">=2024.5,<2026.0"
60-
group.docs.dependencies.myst-parser = "^4.0"
61-
group.docs.dependencies.tomli = "^2.0"
62-
plugins.hypothesis._ = "returns.contrib.hypothesis._entrypoint:_setup_hook"
63-
plugins.pytest11.returns = "returns.contrib.pytest.plugin"
64-
urls.Funding = "https://github.com/sponsors/dry-python"
41+
42+
[tool.poetry.urls]
43+
Funding = "https://github.com/sponsors/dry-python"
44+
45+
[tool.poetry.plugins.hypothesis]
46+
_ = "returns.contrib.hypothesis._entrypoint:_setup_hook"
47+
48+
[tool.poetry.plugins.pytest11]
49+
returns = "returns.contrib.pytest.plugin"
50+
51+
[tool.poetry.dependencies]
52+
python = "^3.10"
53+
typing-extensions = ">=4.0,<5.0"
54+
pytest = {version = ">=8,<10", optional = true}
55+
hypothesis = {version = "^6.151", optional = true}
56+
mypy = {version = ">=1.19,<1.21", optional = true}
57+
58+
[tool.poetry.extras]
59+
compatible-mypy = ["mypy"]
60+
check-laws = ["pytest", "hypothesis"]
61+
62+
[tool.poetry.group.dev.dependencies]
63+
anyio = "^4.3"
64+
trio = ">=0.30,<0.33"
65+
attrs = "^25.3"
66+
httpx = "^0.28"
67+
wemake-python-styleguide = "^1.3"
68+
codespell = "^2.2"
69+
slotscheck = "^0.19"
70+
ruff = ">=0.12,<0.15"
71+
pytest-cov = ">=6,<8"
72+
pytest-randomly = ">=3.12,<5.0"
73+
pytest-mypy-plugins = "^3.1"
74+
pytest-subtests = ">=0.14,<0.16"
75+
pytest-shard = "^0.1"
76+
covdefaults = "^2.3"
77+
78+
[tool.poetry.group.docs]
79+
optional = true
80+
81+
[tool.poetry.group.docs.dependencies]
82+
sphinx = "^8.1"
83+
sphinx-autodoc-typehints = ">=2.3,<4.0"
84+
sphinxcontrib-mermaid = ">=1,<3"
85+
furo = ">=2024.5,<2026.0"
86+
myst-parser = "^4.0"
87+
tomli = "^2.0"
88+
6589

6690
[tool.ruff]
6791
# Ruff config: https://docs.astral.sh/ruff/settings
68-
target-version = "py310"
69-
line-length = 80
7092
preview = true
7193
fix = true
72-
format.quote-style = "single"
73-
format.docstring-code-format = false
74-
lint.select = [
94+
target-version = "py310"
95+
line-length = 80
96+
97+
[tool.ruff.format]
98+
quote-style = "single"
99+
docstring-code-format = false
100+
101+
[tool.ruff.lint]
102+
select = [
75103
"A", # flake8-builtins
76104
"B", # flake8-bugbear
77105
"C4", # flake8-comprehensions
@@ -112,7 +140,7 @@ lint.select = [
112140
"W", # pycodestyle
113141
"YTT", # flake8-2020
114142
]
115-
lint.ignore = [
143+
ignore = [
116144
"A005", # allow to shadow stdlib and builtin module names
117145
"COM812", # trailing comma, conflicts with `ruff format`
118146
# Different doc rules that we don't really care about:
@@ -131,39 +159,43 @@ lint.ignore = [
131159
"PLR6301", # do not require classmethod / staticmethod when self not used
132160
"TRY003", # long exception messages from `tryceratops`
133161
]
134-
lint.per-file-ignores."*.pyi" = [ "D103" ]
135-
lint.per-file-ignores."returns/context/__init__.py" = [ "F401", "PLC0414" ]
136-
lint.per-file-ignores."returns/contrib/mypy/*.py" = [ "S101" ]
137-
lint.per-file-ignores."returns/contrib/mypy/_typeops/visitor.py" = [ "S101" ]
138-
lint.per-file-ignores."returns/contrib/pytest/__init__.py" = [ "F401", "PLC0414" ]
139-
lint.per-file-ignores."returns/interfaces/*.py" = [ "S101" ]
140-
lint.per-file-ignores."returns/methods/__init__.py" = [ "F401", "PLC0414" ]
141-
lint.per-file-ignores."returns/pipeline.py" = [ "F401", "PLC0414" ]
142-
lint.per-file-ignores."returns/pointfree/__init__.py" = [ "F401", "PLC0414" ]
143-
lint.per-file-ignores."returns/primitives/asserts.py" = [ "S101" ]
144-
lint.per-file-ignores."tests/*.py" = [
162+
external = ["WPS"]
163+
164+
# Plugin configs:
165+
flake8-quotes.inline-quotes = "single"
166+
mccabe.max-complexity = 6
167+
pep8-naming.staticmethod-decorators = ["law_definition", "staticmethod"]
168+
pydocstyle.convention = "google"
169+
170+
[tool.ruff.lint.per-file-ignores]
171+
"*.pyi" = ["D103"]
172+
"returns/context/__init__.py" = ["F401", "PLC0414"]
173+
"returns/contrib/mypy/*.py" = ["S101"]
174+
"returns/contrib/mypy/_typeops/visitor.py" = ["S101"]
175+
"returns/contrib/pytest/__init__.py" = ["F401", "PLC0414"]
176+
"returns/interfaces/*.py" = ["S101"]
177+
"returns/methods/__init__.py" = ["F401", "PLC0414"]
178+
"returns/pipeline.py" = ["F401", "PLC0414"]
179+
"returns/pointfree/__init__.py" = ["F401", "PLC0414"]
180+
"returns/primitives/asserts.py" = ["S101"]
181+
"tests/*.py" = [
145182
"RUF029", # allow async functions to not use `await`
146183
"S101", # asserts
147184
"S105", # hardcoded passwords
148185
"S404", # subprocess calls are for tests
149186
"S603", # do not require `shell=True`
150187
"S607", # partial executable paths
151188
]
152-
lint.per-file-ignores."tests/test_examples/*" = [ "D102" ]
153-
lint.per-file-ignores."tests/test_examples/test_maybe/test_maybe_pattern_matching.py" = [
189+
"tests/test_examples/*" = ["D102"]
190+
"tests/test_examples/test_maybe/test_maybe_pattern_matching.py" = [
154191
"D101",
155192
"D103",
156193
"F811",
157194
]
158-
lint.per-file-ignores."tests/test_examples/test_result/test_result_pattern_matching.py" = [
195+
"tests/test_examples/test_result/test_result_pattern_matching.py" = [
159196
"D103",
160197
]
161-
lint.per-file-ignores."tests/test_pattern_matching.py" = [ "S101" ]
162-
lint.external = [ "WPS" ]
163-
lint.flake8-quotes.inline-quotes = "single"
164-
lint.mccabe.max-complexity = 6
165-
lint.pep8-naming.staticmethod-decorators = [ "law_definition", "staticmethod" ]
166-
lint.pydocstyle.convention = "google"
198+
"tests/test_pattern_matching.py" = ["S101"]
167199

168200
[tool.slotscheck]
169201
strict-imports = true

0 commit comments

Comments
 (0)