-
Notifications
You must be signed in to change notification settings - Fork 55
/
Copy pathpyproject.toml
145 lines (126 loc) · 4.28 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
[build-system]
requires = ["setuptools>=61.0", "wheel", "Cython"]
build-backend = "setuptools.build_meta"
[project]
name = "mazelib"
version = "0.9.16"
authors = [{ name="John Stilley" }]
description = "A Python API for creating and solving mazes."
readme = "README.md"
requires-python = ">=3.7.0, <3.14"
dependencies = [
"cython",
"numpy",
]
license = { file="LICENSE" }
classifiers = [
"Development Status :: 4 - Beta",
"Topic :: Software Development :: Libraries :: Python Modules",
"Topic :: Scientific/Engineering :: Mathematics",
"Topic :: Games/Entertainment :: Puzzle Games",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"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",
"Natural Language :: English",
]
[project.urls]
"Homepage" = "https://github.com/john-science/mazelib"
"Bug Tracker" = "https://github.com/john-science/mazelib/issues"
[project.optional-dependencies]
dev = [
"black == 24.10.0",
"ruff == 0.7.4",
"toml == 0.10.2",
"twine == 4.0.2",
]
pytest = [
"pytest",
"pytest-cov",
]
[tool.setuptools.package-data]
myModule = ["mazelib/generate/*.pxd", "mazelib/solve/*.pxd", "mazelib/transmute/*.pxd"]
[tool.distutils.bdist_wheel]
universal = true
[tool.setuptools.dynamic]
readme = {file = ["README.md"]}
#######################################################################
# RUFF CONFIG #
#######################################################################
[tool.ruff]
# This is the exact version of Ruff we use.
required-version = "0.7.4"
# Assume Python 3.13
target-version = "py313"
# Setting line-length to 100 (though blacks default is 88)
line-length = 120
# Exclude a variety of commonly ignored directories.
exclude = [
".bzr",
".direnv",
".eggs",
".git",
".git-rewrite",
".hg",
".mypy_cache",
".nox",
".pants.d",
".pytype",
".ruff_cache",
".svn",
".tox",
".venv",
"__pycache__",
"__pypackages__",
"_build",
"buck-out",
"build",
"dist",
"node_modules",
"venv",
]
[tool.ruff.lint]
# Enable pycodestyle (E) and Pyflakes (F) codes by default.
# D - NumPy docstring rules
# N801 - Class name should use CapWords convention
# SIM - code simplification rules
# TID - tidy imports
select = ["E", "F", "D", "N801", "SIM", "TID"]
# Ruff rules we ignore (for now) because they are not 100% automatable
#
# D100 - Missing docstring in public module
# D101 - Missing docstring in public class
# D102 - Missing docstring in public method
# D103 - Missing docstring in public function
# D106 - Missing docstring in public nested class
# D401 - First line of docstring should be in imperative mood
# D404 - First word of the docstring should not be "This"
# SIM102 - Use a single if statement instead of nested if statements
# SIM105 - Use contextlib.suppress({exception}) instead of try-except-pass
# SIM108 - Use ternary operator {contents} instead of if-else-block
# SIM114 - Combine if branches using logical or operator
# SIM115 - Use context handler for opening files
# SIM117 - Use a single with statement with multiple contexts instead of nested with statements
# Ruff rules we ignore because we don't want them
#
# D105 - we don't need to document well-known magic methods
# D205 - 1 blank line required between summary line and description
# E731 - we can use lambdas however we want
# RUF100 - no unused noqa statements (not consistent enough yet)
# SIM118 - this does not work where we overload the .keys() method
#
ignore = ["D100", "D101", "D102", "D103", "D105", "D106", "D205", "D401", "D404", "E731", "E741", "RUF100", "SIM102", "SIM105", "SIM108", "SIM110", "SIM114", "SIM115", "SIM116", "SIM117", "SIM118"]
[tool.ruff.lint.per-file-ignores]
# D1XX - enforces writing docstrings
# E741 - ambiguous variable name
# N - We have our own naming conventions for unit tests.
# SLF001 - private member access
"*/tests/*" = ["D1", "E741", "N", "SLF001"]
[tool.ruff.lint.flake8-tidy-imports]
ban-relative-imports = "all"
[tool.ruff.lint.pydocstyle]
convention = "numpy"