-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
212 lines (189 loc) · 5.64 KB
/
pyproject.toml
File metadata and controls
212 lines (189 loc) · 5.64 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
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
[project]
name = "gemmology-crystal-geometry"
version = "2.0.0"
description = "3D crystal geometry engine for crystallographic visualization"
readme = "README.md"
license = { text = "MIT" }
requires-python = ">=3.10"
authors = [
{ name = "Bissbert", email = "fabian@gemmology.dev" }
]
maintainers = [
{ name = "Bissbert", email = "fabian@gemmology.dev" }
]
keywords = [
"crystallography",
"mineralogy",
"gemmology",
"geometry",
"polyhedra",
"crystal",
"visualization",
"3d"
]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Science/Research",
"Intended Audience :: Education",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Topic :: Scientific/Engineering",
"Topic :: Scientific/Engineering :: Chemistry",
"Topic :: Scientific/Engineering :: Visualization",
"Typing :: Typed"
]
dependencies = [
"gemmology-cdl-parser>=2.0.0",
"numpy>=1.20.0",
"scipy>=1.7.0",
]
[project.urls]
Homepage = "https://crystal-geometry.gemmology.dev"
Documentation = "https://crystal-geometry.gemmology.dev/docs"
Repository = "https://github.com/gemmology-dev/crystal-geometry"
Issues = "https://github.com/gemmology-dev/crystal-geometry/issues"
Changelog = "https://github.com/gemmology-dev/crystal-geometry/blob/main/CHANGELOG.md"
[project.optional-dependencies]
dev = [
"pytest>=7.0",
"pytest-cov>=4.0",
"ruff>=0.1.0",
"mypy>=1.0"
]
docs = [
"mkdocs>=1.5",
"mkdocs-material>=9.0",
"mkdocstrings[python]>=0.24"
]
native = [
# Native acceleration is built from source via scikit-build-core
# No runtime dependencies needed (Eigen is header-only)
]
[build-system]
requires = [
"scikit-build-core>=0.5",
"pybind11>=2.11",
]
build-backend = "scikit_build_core.build"
[tool.scikit-build]
# Use editable installs for development
wheel.packages = ["src/crystal_geometry"]
cmake.build-type = "Release"
cmake.minimum-version = "3.15"
build-dir = "build/{wheel_tag}"
# Allow cmake to fail gracefully (pure Python fallback)
strict-config = false
cmake.verbose = false
[tool.scikit-build.cmake.define]
# Default options, can be overridden with CMAKE_ARGS env var
USE_OPENMP = "OFF"
# cibuildwheel configuration for cross-platform wheel building
[tool.cibuildwheel]
# Build for Python 3.10-3.13
build = "cp310-* cp311-* cp312-* cp313-*"
# Skip musllinux (Alpine), PyPy, and 32-bit Linux (i686)
skip = "*-musllinux* pp* *_i686"
# Skip in-container tests (CI runs the full test suite separately).
# Testing inside cibuildwheel fails because scipy needs OpenBLAS in manylinux.
test-skip = "*"
[tool.cibuildwheel.linux]
before-all = "(yum install -y epel-release && yum install -y eigen3-devel openblas-devel) || (apt-get update && apt-get install -y libeigen3-dev libopenblas-dev) || true"
repair-wheel-command = "auditwheel repair -w {dest_dir} {wheel}"
[tool.cibuildwheel.macos]
before-all = "brew install eigen"
repair-wheel-command = "delocate-wheel -w {dest_dir} {wheel}"
[tool.cibuildwheel.windows]
before-all = "choco install eigen -y"
environment = { CMAKE_PREFIX_PATH = "C:\\ProgramData\\chocolatey\\lib\\eigen\\share\\eigen3\\cmake" }
# Fallback to setuptools if scikit-build-core not available
[tool.setuptools]
packages = ["crystal_geometry"]
package-dir = {"" = "src"}
[tool.setuptools.package-data]
crystal_geometry = ["py.typed"]
[tool.ruff]
line-length = 100
target-version = "py310"
exclude = ["benchmarks/"]
[tool.ruff.lint]
select = [
"E", # pycodestyle errors
"W", # pycodestyle warnings
"F", # pyflakes
"I", # isort
"B", # flake8-bugbear
"C4", # flake8-comprehensions
"UP", # pyupgrade
]
ignore = [
"E501", # line too long
"E741", # ambiguous variable name (h, k, l and I are standard crystallographic notation)
]
[tool.ruff.lint.isort]
known-first-party = ["crystal_geometry", "cdl_parser"]
[tool.mypy]
python_version = "3.10"
strict = true
warn_return_any = false # numpy operations often return Any
warn_unused_ignores = true
ignore_missing_imports = true # scipy stubs not always available
disable_error_code = ["type-arg"] # numpy ndarray type parameters
[tool.pytest.ini_options]
testpaths = ["tests"]
addopts = "-v --tb=short"
[tool.coverage.run]
source = ["src/crystal_geometry"]
branch = true
omit = [
"*/tests/*",
"*/__pycache__/*",
]
[tool.coverage.report]
# Target: 80% coverage (current: ~62%)
# Incrementally increase as coverage improves
fail_under = 60
show_missing = true
exclude_lines = [
"pragma: no cover",
"def __repr__",
"raise NotImplementedError",
"if TYPE_CHECKING:",
"if __name__ == .__main__.:",
]
# Semantic Release configuration
[tool.semantic_release]
version_toml = ["pyproject.toml:project.version"]
branch = "main"
upload_to_pypi = false # We use separate pypi-publish workflow
upload_to_release = true
build_command = "pip install build && python -m build"
[tool.semantic_release.commit_parser_options]
allowed_tags = [
"build",
"chore",
"ci",
"docs",
"feat",
"fix",
"perf",
"refactor",
"style",
"test",
]
minor_tags = ["feat"]
patch_tags = ["fix", "perf"]
[tool.semantic_release.changelog]
template_dir = ".github/templates"
changelog_file = "CHANGELOG.md"
[tool.semantic_release.branches.main]
match = "main"
prerelease = false
# Bandit security configuration
[tool.bandit]
exclude_dirs = ["tests", "benchmarks"]
skips = ["B101"] # Skip assert warnings (we use assert in tests)