Repository navigation
Expand file tree
/
Copy pathpyproject.toml
More file actions
171 lines (150 loc) · 5.26 KB
/
Copy pathpyproject.toml
File metadata and controls
171 lines (150 loc) · 5.26 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
162
163
164
165
166
167
168
169
170
171
# https://packaging.python.org/en/latest/tutorials/packaging-projects/#creating-pyproject-toml
[project]
name = "bitbully"
version = "0.0.79"
description = "A fast Connect-4 Solver for Python & C++"
authors = [
{ name = "Markus Thill" }
]
maintainers = [
{ name = "Markus Thill" }
]
readme = "README.md"
requires-python = ">=3.10"
license = { file = "LICENSE" }
keywords = ["connect-4", "solver", "perfect-playing", "opening book", "tree-search"]
classifiers = [
"Programming Language :: Python :: 3",
"Programming Language :: C++",
"Programming Language :: Python :: Implementation :: CPython",
]
dependencies = [
"bitbully-databases" # in future, keep the version aligned with this project version
]
[project.urls]
Homepage = "https://github.com/MarkusThill/BitBully"
Issues = "https://github.com/MarkusThill/BitBully/issues"
[project.optional-dependencies]
# Specify optional dependency groups
dev = [
"commitizen", # Required for versioning
"pre-commit", # For managing Git hooks (optional)
"build",
"twine",
"readme_renderer[md]",
"keyrings.alt",
"pre-commit",
"pydoclint",
"mkdocs",
"mkdocstrings[python]",
"mkdocs-material",
"pyrefly",
"pytest",
"pytest-cov",
"ruff"
]
gui = [
"matplotlib",
"ipywidgets",
"ipympl"
]
ci = [
"pytest", # For testing
"ruff", # For linting
]
[build-system]
# TODO: is scikit-build really required???
requires = ["build", "setuptools>=42", "wheel", "cibuildwheel", "cmake>=3.15", "scikit-build", "pybind11"]
build-backend = "setuptools.build_meta"
[tool.setuptools]
package-dir = { "" = "src" }
include-package-data = true # Include additional non-Python files (e.g., libraries)
[tool.setuptools.package-data]
"bitbully" = ["assets/*", "bitbully_core.pyi"]
# bitbully = [
# "*.so",
# "*.dll"
# "libs/windows/*.dll",
# "libs/macos/*.dylib",
#]
# https://cibuildwheel.pypa.io/en/stable/options/#build-skip
[tool.cibuildwheel]
build = "cp310-* cp311-* cp312-* cp313-* cp314-* pp310-* pp311-*"
enable = ["pypy", "pypy-eol"] # <-- required in cibuildwheel 3.x
# build = "cp311-*" # TODO: Change back to above setting
skip = "*win32*" # 14.09.2025: removed "cp38-macosx_arm64*"
environment = "MACOSX_DEPLOYMENT_TARGET=10.15"
# ----------------------------------------------------------------------------------------------------
# on ubuntu runners, the latest numpy version is built from scratch, taking a lot of time (14.09.2025)
# However, the versions should be updated from time to time.
# ----------------------------------------------------------------------------------------------------
test-requires = ["pytest"] # windows GitHub runners have problems with the following: "numpy<2.3.0"
test-command = "pytest -v -ra {project}/tests"
[tool.setuptools.packages.find]
where = ["src"] # list of folders that contain the packages (["."] by default)
include = ["bitbully*"] # package names should match these glob patterns (["*"] by default)
exclude = ["bitbully.tests*"] # exclude packages matching these glob patterns (empty by default)
namespaces = false # to disable scanning PEP 420 namespaces (true by default)
[tool.commitizen]
name = "cz_conventional_commits"
version_scheme = "semver"
version = "0.0.79" # Current version managed by Commitizen
version_files = ["pyproject.toml", "src/version.h", "version.txt", "src/bitbully/__init__.py", "setup.py", "Doxyfile"] # if cz can directly bump it
pre_bump_hooks = "./scripts/update_version.sh"
tag_format = "v$version" # Tag format (e.g., v1.0.0)
changelog_file = "CHANGELOG.md" # File to store changelog (if needed)
update_changelog_on_bump = true
[tool.pydoclint]
style = "google"
exclude = '\.git'
allow-init-docstring = true
[tool.ruff]
target-version = "py310"
line-length = 120
include = ["pyproject.toml", "src/**/*.py", "scripts/**/*.py", "tests/**/*.py"]
exclude = ["thirdParty/", "*.pyi"]
[tool.ruff.format]
docstring-code-format = true
# docstring-code-line-length = 88
[tool.ruff.lint]
preview = true
external = [
"DOC", # pydoclint
]
select = [
"A",
"ANN", # Enforce type hints
"C", # Flags overly complex functions
"D", # Encourages proper documentation
"DOC", # Pydocstyle (docs best practices)
"E", # Enforces basic style (e.g., indentation, line breaks)
"F", # Detects undefined variables, imports, syntax errors
"G", # flake8-logging
"FURB", # Encourages f-strings (for Python 3.6+)
"I", # Ensures proper import sorting
"N", # Enforces consistent function/class naming
"NPY", # Best practices for NumPy usage (if applicable)
"PD", # pandas vet
"PERF",
"PIE", # Flags unnecessary lambda expressions, etc.
"PT", # Best practices for testing (if using pytest)
"PTH", # Encourages pathlib over os.path
"PGH", # pygrep
"PYI", # PyPI
"Q", # quotes
"RET", # Detects unnecessary return statements & refactors returns
"RUF", # General Ruff improvements
"UP", # Encourages modern Python syntax
"SIM", # Flags redundant expressions & improves readability
"W", # Enforces basic style (e.g., indentation, line breaks)
]
[tool.ruff.lint.pydocstyle]
convention = "google"
[tool.pyrefly]
project-includes = ["src/bitbully"]
project-excludes = [
"**/thirdParty/**/*",
"**/*.pyi",
]
python-version = "3.10.0"
ignore-missing-imports = ["*"]