Repository navigation
Expand file tree
/
Copy pathpyproject.toml
More file actions
91 lines (77 loc) · 2.5 KB
/
Copy pathpyproject.toml
File metadata and controls
91 lines (77 loc) · 2.5 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
[build-system]
requires = ["maturin==1.16.0"]
build-backend = "maturin"
[project]
name = "gecode-iris"
description = "Read text instance files with the Iris language"
readme = "README.md"
license = "MIT"
# Keep equal to pyo3's abi3-py3XX feature in Cargo.toml; tests/test_package.py checks.
requires-python = ">=3.10"
dynamic = ["version"]
classifiers = [
"Programming Language :: Python :: 3",
"Programming Language :: Rust",
]
[project.scripts]
# Runs the Rust command line; gecode_iris._cli only forwards the process state.
iris = "gecode_iris._cli:main"
[project.urls]
Homepage = "https://iris.gecode.dev"
Repository = "https://github.com/Gecode/iris"
[dependency-groups]
test = ["pytest>=8"]
# The site build renders the API reference with docs/reference.py.
docs = ["pdoc==16.0.0"]
# Exact versions, so local and CI checks agree; README.md has the commands.
lint = [
"mypy==2.4.1",
"pyright==1.1.414",
"ruff==0.17.3",
"ty==0.0.96",
# typing.assert_type needs Python 3.11; the type tests import it from here.
"typing-extensions==4.16.0",
]
[tool.maturin]
python-source = "python"
module-name = "gecode_iris._native"
locked = true
# A development install leaves bytecode beside the sources.
exclude = ["python/**/__pycache__/**"]
[tool.pytest.ini_options]
testpaths = ["tests"]
addopts = ["--import-mode=importlib"]
[tool.ruff]
target-version = "py310"
line-length = 100
src = ["python", "tests"]
[tool.ruff.per-file-target-version]
# t-string patterns need Python 3.14; conftest.py skips the test before then.
"tests/test_build_tstrings.py" = "py314"
"tests/typecheck/build_tstrings.py" = "py314"
[tool.ruff.lint]
extend-select = ["B", "I", "UP"]
[tool.ty.environment]
python-version = "3.10"
[tool.ty.src]
# The misuse files' errors are intended; pyright and mypy check that they are
# reported. The t-string files need Python 3.14: check them with
# `ty check --python-version 3.14 FILE...`.
exclude = [
"tests/typecheck/data_misuse.py",
"tests/typecheck/build_misuse.py",
"tests/test_build_tstrings.py",
"tests/typecheck/build_tstrings.py",
]
# numpy is optional: the stubs name its array type, and the guide's array
# example imports it. Without numpy the check still passes, and ty treats
# those names as unknown.
[tool.ty.analysis]
allowed-unresolved-imports = ["numpy", "numpy.typing"]
# pyright and mypy check the stubs through tests/typecheck; README.md has the commands.
[tool.pyright]
pythonVersion = "3.10"
typeCheckingMode = "strict"
[tool.mypy]
python_version = "3.10"
strict = true