-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathpyproject.toml
More file actions
283 lines (247 loc) · 9.11 KB
/
pyproject.toml
File metadata and controls
283 lines (247 loc) · 9.11 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
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
#######################################################
################ Build configurations ###############
#######################################################
[build-system]
requires = [
# "setuptools-scm >= 6.4.2", # For versioning
# "setuptools >= 61.2.0", # Minimum version for pyproject.toml support
"hatchling",
"uv >= 0.7.20", # Current version as of 2025-July
]
# build-backend = "setuptools.build_meta"
build-backend = "hatchling.build" # using hatchling which provides better support for excluding files than setuptools
[project]
# Project information
name = "pyNexafs"
version = "0.2.0"
description = "A package for processing and analysing NEXAFS data."
readme = "README.rst"
license = {file = "LICENSE"}
keywords = ["NEXAFS", "XANES", "Near", "Edge", "X-ray", "Absorption", "Fine", "Structure", "Spectroscopy", "Optical Data", "XAS", "Synchrotron"]
authors = [
{name = "Matthew Gebert", email="mattheuu.gebert@gmail.com"},
]
maintainers = [
{name = "Matthew Gebert", email="mattheuu.gebert@gmail.com"},
]
# Project compatibility:
requires-python = ">=3.11"
dependencies = [
"numpy",
"scipy",
"xdrlib3", # function bindings for reading binary data from mda files
]
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3",
]
[project.urls]
# Website, documentation and other continuous integration URLS.
code = "https://github.com/xraysoftmat/pyNexafs"
documentation = "https://pyNexafs.readthedocs.io/en/latest/"
[project.scripts]
# Command line entry points.
[project.gui-scripts]
# GUI entry points for the command line
pyNexafs = "pyNexafs.__main__:main"
pyNexafs_tr = "kkcalc2.__main__:main_with_traceback"
[dependency-groups]
# Dependency groups for optional dependencies. Requires pip >= 25.1
all = [
{include-group = "dev"}
]
dev = [
{include-group = "gui"}, # Include GUI dependencies in dev
{include-group = "docs"}, # Include documentation dependencies in dev
"pre-commit",
"pytest",
"python-semantic-release",
"commitizen",
"commitlint",
"periodictable >= 2.0.2", # Due to changes in neutron element as zeroth element.
"numpydoc",
"ruff",
"pyinstaller", # For creating standalone executables of the GUI
]
docs = [
"sphinx",
"sphinx_pyproject", # to include conf.py information in pyproject.toml
"sphinx-copybutton", # Add a copybutton to code blocks
"intersphinx-registry", # to reference other projects in sphinx
# "sphinx-rtd-theme",
"pydata-sphinx-theme",
"myst-parser", # For parsing md files in sphinx
"numpydoc",
# "sphinx-autoapi", # Automatically generate API documentation instead of using autodoc/autosummary extensions.
"matplotlib",
]
gui = [
"matplotlib",
"pandas",
"pyqt6",
"pyyaml",
]
# [tool.setuptools.packages.find]
# exclude = ["docs*", "tests*"]
[tool.hatch.build]
directory = "./dist"
targets.sdist.include = [
"pyNexafs/**",
]
targets.sdist.exclude = [
"pyNexafs/utils/decorators.py", # Exclude decorators from distribution
"docs/**",
"tests/**",
]
#######################################################
############# Pre-commit configurations #############
#######################################################
## Linting
# Ruff
[tool.ruff] # Same as Black formatting.
line-length = 88
indent-width = 4
[tool.ruff.format] # Same as Black formatting.
quote-style = "double"
indent-style = "space"
skip-magic-trailing-comma = false
line-ending = "auto"
# NumpyDoc
[tool.numpydoc_validation]
checks = [
"all", # report on all checks, except the below
"EX01",
"SA01",
"ES01",
"GL08", # TODO: ignore docstring check until numpydoc 1.9.0 is released (where constructors are supported).
"PR02", # TODO: ignore parameter check until numpydoc 1.9.0 is released (where properties setter methods are supported).
]
exclude = [
'^tests*$',
]
exclude_files = [
'^pyNexafs/gui/*',
]
override_SS05 = [
"^Process",
"^Nexafs",
"^Xanes",
"^Xas",
"",
]
## Semantic Versioning / Conventional Commits
# Commitizen
[tool.commitizen]
name = "cz_conventional_commits"
version_files = ["pyproject.toml:project.version"]
[tool.commitizen.customize]
message_length_limit = 72
max_line_length = 72 # one of these to be supported? https://github.com/commitizen-tools/commitizen/issues/1571
types = [
{type = "fix", bump = "patch", section = "A bug fixes. Correlates with PATCH in SemVer."},
{type = "feat", bump = "minor", section = "A new feature. Correlates with MINOR in SemVer."},
{type = "perf", bump = "patch", section = "A code change that improves performance."},
{type = "docs", bump = "patch", section = "Documentation only changes."},
{type = "style", bump = "patch", section = "Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)."},
{type = "refactor", bump = "patch", section = "A code change that neither fixes a bug nor adds a feature."},
{type = "test", bump = "patch", section = "Adding missing tests or correcting existing tests."},
{type = "build", bump = "patch", section = "Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm)."},
{type = "ci", bump = "patch", section = "Changes to CI configuration files and scripts (example scopes: GitLabCI)."},
{type = "chore", bump = "patch", section = "Additional chores that don't modify src or test files."},
{type = "wip", bump = "", section = "Work in progress, partial commits but not ready for review."},
]
# version_provider = "pep621" #equivalent to version_files description
# # Commitlint - not supported in pyproject.toml yet.
# [tool.commitlint]
# extends = ["@commitlint/config-conventional"]
# Python-Sem-Ver
[tool.semantic_release.branches.main]
match = "(main|master)"
prerelease_token = "rc"
prerelease = false
[tool.semantic_release]
version_toml = ["pyproject.toml:project.version"]
# build_command = "python -m build --sdist --wheel ."
commit_parser = "conventional"
build_command = "pip install uv && uv build --sdist --wheel . --out-dir dist"
commit_message = """
chore(release): Release `core@{version}` [skip ci]
Automatically generated by python-semantic-release
"""
allow_zero_version = true
[tool.semantic_release.branches.beta]
# Matches branches with the prefixes 'feat/', 'fix/', or 'perf/'.
match = "^(feat|fix|perf)/.+"
prerelease = true
prerelease_token = "beta"
[tool.semantic_release.changelog.default_templates]
changelog_file = "docs/CHANGELOG.rst"
output_format = "rst" # or "md" for Markdown format
[tool.semantic_release.changelog]
# Recommended patterns for conventional commits parser that is scope aware
exclude_commit_patterns = [
'''chore(?:\([^)]*?\))?: .+''',
'''ci(?:\([^)]*?\))?: .+''',
'''refactor(?:\([^)]*?\))?: .+''',
'''style(?:\([^)]*?\))?: .+''',
'''test(?:\([^)]*?\))?: .+''',
'''build\((?!deps\): .+)''',
'''Initial [Cc]ommit.*''',
'''wip(?:\([^)]*?\))?: .+''',
]
[tool.semantic_release.commit_parser_options]
minor_tags = ["feat"]
patch_tags = ["fix", "perf"]
# other_allowed_tags = ["build", "chore", "ci", "docs", "style", "refactor", "test"]
# allowed_tags = ["feat", "fix", "perf", "build", "chore", "ci", "docs", "style", "refactor", "test"]
# default_bump_level = 0
parse_squash_commits = true
ignore_merge_commits = true
#######################################################
############# Sphinx Doc configurations #############
#######################################################
[tool.sphinx-pyproject]
html_theme = "pydata_sphinx_theme"
[tool.sphinx-pyproject.html_theme_options]
# ...
navbar_start = ["navbar-logo"]
navbar_center = ["navbar-nav"]
navbar_end = ["theme-switcher", "navbar-icon-links"]
navbar_persistent = ["search-button"]
navbar_align = "content"
show_nav_level = 2
navigation_depth = 4
# ...
secondary_sidebar_items = ["page-toc", "edit-this-page", "sourcelink"]
# ...
article_footer_items = []
#...
footer_start = ["copyright", "sphinx-version"]
footer_end = ["theme-version"]
#...
show_prev_next = true
# Array item:
[[tool.sphinx-pyproject.html_theme_options.icon_links]]
name = "GitHub"
url = "https://github.com/xraysoftmat/pyNexafs"
icon = "fab fa-github-square"
type = "fontawesome"
[tool.sphinx-pyproject.html_sidebars]
"**" = ["sidebar-nav-bs", "sidebar-ethical-ads"]
[tool.sphinx-pyproject.html_context]
default_mode = "light"
default_dark_mode = false
default_language = "en"
default_version = "latest"
display_github = true
github_user = "xraysoftmat"
github_repo = "pyNexafs"
github_version = "main"
doc_path = "docs"
# Esbonio Sphinx extension for VS Code integration - https://docs.esbon.io
[tool.esbonio.sphinx]
# buildCommand = ["sphinx-build", "-M", "dirhtml", "./docs", "./docs/_build"]
buildCommand = ["sphinx-build", "-M", "html", "./docs", "./docs/_build"] # sphinx-build -M html ./docs ./docs/_build
pythonCommand = ["${venv:pyNexafs}"]