-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathpyproject.toml
More file actions
174 lines (165 loc) · 7.73 KB
/
pyproject.toml
File metadata and controls
174 lines (165 loc) · 7.73 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
[build-system]
requires = ["meson-python>=0.17", "Cython>=3.0", "numpy>=1.25", "scipy>=1.9"]
build-backend = "mesonpy"
[project]
name = "wlsqm"
dynamic = ["version"]
description = "Fast and accurate weighted least squares meshless interpolator for Python"
readme = "README.md"
license = "BSD-2-Clause"
requires-python = ">=3.11"
authors = [
{name = "Juha Jeronen", email = "juha.jeronen@jamk.fi"},
]
keywords = [
"numerical", "interpolation", "differentiation",
"curve-fitting", "least-squares", "meshless",
"numpy", "cython",
]
dependencies = [
"numpy>=1.25",
"scipy>=1.9",
]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Environment :: Console",
"Intended Audience :: Developers",
"Intended Audience :: Science/Research",
"Operating System :: OS Independent",
"Programming Language :: Cython",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"Topic :: Scientific/Engineering",
"Topic :: Scientific/Engineering :: Mathematics",
]
[project.urls]
Homepage = "https://github.com/Technologicat/python-wlsqm"
Repository = "https://github.com/Technologicat/python-wlsqm"
Issues = "https://github.com/Technologicat/python-wlsqm/issues"
Changelog = "https://github.com/Technologicat/python-wlsqm/blob/master/CHANGELOG.md"
[tool.ruff]
line-length = 130
target-version = "py311"
exclude = [
".git",
"__pycache__",
"build",
"dist",
".venv",
"00_stuff",
]
[tool.ruff.lint]
select = ["E", "W", "F", "SIM"]
ignore = [
# pycodestyle
"E203", # whitespace before ':' — needed for slice alignment
"E265", # block comment should start with '# ' — commented-out code, markers
"E301", # expected 1 blank line — blank lines are semantic paragraph breaks
"E302", # expected 2 blank lines before def — same
"E305", # expected 2 blank lines after end — same
"E306", # expected blank line before nested def — same
"E402", # module level import not at top — conditional/deferred imports
"E501", # line too long — advisory, not enforced
"E701", # multiple statements on one line (colon) — fine in numerical code
"E702", # multiple statements on one line (semicolon) — same; visual pairing of related updates
"E731", # lambda assignment — closures are idiomatic in this codebase
"E741", # ambiguous variable name — `I`, `l`, `O` are standard in numerical code (identity matrix, index vector, ...)
# flake8-simplify
"SIM102", # collapsible if — nested ifs often represent distinct semantic guards
# Note: SIM103 (return condition directly) is intentionally NOT ignored here.
# It is enabled as an advisory — CI runs it in a non-failing second pass.
"SIM105", # contextlib.suppress — try/except/pass is more flexible and explicit
"SIM108", # ternary instead of if/else — often less readable, no real gain
"SIM114", # combine if branches — match-casing style; autofix would damage semantics
"SIM117", # combine with statements — nesting shows parent/child relationships
"SIM118", # in-dict-keys — explicit .keys() marks the variable as a dictlike
"SIM300", # yoda conditions — natural reading order preferred
"SIM910", # dict.get with None default — explicit None documents programmer intent
]
[tool.ruff.lint.per-file-ignores]
"__init__.py" = ["F401", "F403"] # re-exports via star-import
[tool.cython-lint]
max-line-length = 200
ignore = [
"E114", # indentation is not a multiple of 4 (comment) — comment columns chosen for alignment with code, not tab stops
"E115",
"E116", # unexpected indentation (comment) — same reason
"E117", # over-indented comment — same reason as E114
"E127", # continuation line over-indented for visual indent — visual alignment of multi-line signatures is the project style
"E201",
"E202",
"E221",
"E222", # multiple spaces after operator — column-aligned assignments (e.g. `cdef int x = 1 / cdef int foo = 2`) are the project style
"E231",
"E261", # at least two spaces before inline comment — single-space inline comments are common in numerical code
"E262", # inline comment should start with '# ' — `# more text` is used for column-aligned dimensional-scope annotations in infra.pxd
"E265", # block comment should start with '# ' — commented-out code and section markers
"E301", # expected 1 blank line — semantic spacing
"E302", # expected 2 blank lines before def — 1 blank line is the project style
"E303", # too many blank lines — three-blank-line paragraph separators at major section breaks
"E305", # expected 2 blank lines after class/function definition — mirror of E302, same reason
"E501", # line too long — advisory, not enforced (max-line-length = 200 is already generous for long cdef signatures)
"E741", # ambiguous variable name — `I`, `l`, `O` are standard in numerical code (identity matrix, index vector, ...)
"W293",
"W391",
]
[tool.cibuildwheel]
build = "cp311-* cp312-* cp313-* cp314-*"
skip = "*-win32 *-manylinux_i686 *-musllinux*"
test-requires = ["pytest", "numpy", "scipy"]
test-command = "pytest {project}/tests -v"
# macOS: ship parallel wheels by installing conda-forge's `llvm-openmp`
# via a standalone micromamba in `before-all`. Apple Clang does not bundle
# an OpenMP runtime, and Homebrew's current libomp (22.x) has a minimum
# macOS target of 15.0, so `delocate-wheel` refuses to bundle it (the
# wheel's default cibuildwheel arm64 target is 11.0 and delocate does not
# let a wheel lie about its compatibility). conda-forge's llvm-openmp is
# rebuilt with a conservative deployment target that matches our wheel
# target, so delocate is happy to bundle the .dylib.
#
# This is the same pattern scipy and numpy use on their macOS wheel CI.
#
# A serial-mode macOS build is NOT a usable fallback here despite meson's
# `dependency('openmp', required: false)`, because Cython's `cimport openmp`
# in simple/impl/expert/lapackdrivers unconditionally emits `#include <omp.h>`
# in the generated C. Without libomp headers at build time, Apple Clang
# errors out on the missing omp.h before meson's fallback path can take
# effect. So we need libomp headers at build time regardless.
[tool.cibuildwheel.macos]
before-all = '''
curl -Ls https://micro.mamba.pm/api/micromamba/osx-arm64/latest | tar -xvj -C /tmp bin/micromamba
/tmp/bin/micromamba create -y -p /tmp/libomp-env -c conda-forge llvm-openmp
'''
environment = { CPPFLAGS = "-Xpreprocessor -fopenmp -I/tmp/libomp-env/include", LDFLAGS = "-L/tmp/libomp-env/lib -Wl,-rpath,/tmp/libomp-env/lib -lomp", DYLD_FALLBACK_LIBRARY_PATH = "/tmp/libomp-env/lib", PKG_CONFIG_PATH = "/tmp/libomp-env/lib/pkgconfig" }
[dependency-groups]
dev = [
"pytest>=8.0",
"pip",
"cython-lint",
"Cython>=3.0",
"ruff>=0.14.0",
"flake8",
"autopep8",
"importmagic",
"epc",
"jedi>=0.19.2",
"scipy>=1.9",
"matplotlib",
# examples/wlsqm_example.py uses sympy to symbolically differentiate a
# manufactured solution and check the wlsqm fit against the analytical
# derivatives. Not used by the library itself or by the test suite.
"sympy>=1.14.0",
# Needed in the venv (not just the isolated build env) so meson-python's
# editable loader can rebuild the extension on import after .pyx/.pxd edits.
"meson-python>=0.17",
"meson",
"ninja",
# For local pre-release sanity checks: `python -m build --sdist`
# exercises the same sdist path that CI runs on tag push.
"build",
# For validating .github/workflows/*.yml during local dev (not used at runtime).
"pyyaml>=6.0.3",
]