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
|
[build-system]
requires = [
"hatchling",
"hatch-build-scripts",
"hatch-requirements-txt",
"hatch-sphinx",
"hatch-vcs",
"pyside6",
"sasdata",
"sasmodels",
]
build-backend = "hatchling.build"
[project]
name = "sasview"
dynamic = [
"version",
"dependencies",
"optional-dependencies",
]
description = "SasView application"
readme = "README.md"
requires-python = ">=3.11"
license = { text = "BSD-3-Clause" }
authors = [
{name = "SasView Team", email = "developers@sasview.org"},
]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Programming Language :: Python",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: BSD License",
]
keywords = [
"small-angle",
"scattering",
"data analysis",
"neutron",
"X-ray",
]
[project.urls]
Homepage = "http://sasview.org"
Documentation = "https://www.sasview.org/docs/"
Repository = "https://github.com/SasView/sasview/"
Issues = "https://github.com/SasView/sasview/issues"
Changelog = "https://github.com/SasView/sasview/releases"
[project.scripts]
sasview = "sas.cli:main"
[project.entry-points.pyinstaller40]
hook-dirs = "sas.__pyinstaller:get_hook_dirs"
[tool.hatch.metadata]
allow-direct-references = true
[tool.hatch.metadata.hooks.requirements_txt]
files = [ "build_tools/requirements.txt" ]
[tool.hatch.metadata.hooks.requirements_txt.optional-dependencies]
test = [ "build_tools/requirements-test.txt" ]
dev = [ "build_tools/requirements-dev.txt" ]
[tool.hatch.version]
source = "vcs"
[tool.hatch.build.hooks.vcs]
version-file = "src/sas/system/_version.py"
[tool.hatch.build.targets.sdist]
include = [
"build_tools",
"build/lib/doc/build",
"docs/sphinx-docs/source",
"docs/sphinx-docs/*.py",
"src",
"test",
]
exclude = [
"docs/sphinx-docs/source-temp",
"downloads",
]
ignore-vcs = true
[tool.hatch.build.targets.wheel]
sources = ["src"]
packages = ["src/sas"]
include = [
]
exclude = [
"**/media/**",
"*.ui",
"*.bat",
"*.sh",
]
artifacts = [
"**/UI/*py",
]
[tool.hatch.build.targets.wheel.force-include]
"build/doc/html/" = "sas/docs"
"docs/sphinx-docs/source-temp/" = "sas/docs-source"
"src/sas/sasview/media/" = "sas/sasview/media"
[[tool.hatch.build.targets.wheel.hooks.build-scripts.scripts]]
# Perform Qt UI conversion steps (uic, rcc etc)
commands = [
"python3 src/sas/qtgui/convertUI.py",
]
# out_dir = "GUI-output"
artifacts = [
# "**/UI/*py",
]
[[tool.hatch.build.targets.wheel.hooks.sphinx.tools]]
tool = "custom"
doc_dir = "docs/sphinx-docs"
out_dir = "tmp"
commands = [
# sphinx commands work within the "doc_dir" directory
"{python} extract-module-resource.py sasmodels docs-source tmp/sasmodels/docs",
"{python} extract-module-resource.py sasdata docs-source tmp/sasdata/docs",
"{python} extract-module-resource.py sasdata example_data ../../src/sas/example_data/",
]
[[tool.hatch.build.targets.wheel.hooks.sphinx.tools]]
tool = "custom"
doc_dir = "docs/sphinx-docs"
out_dir = "source-temp"
environment = { PYTHONPATH = "../../src" }
commands = [
"{python} collect_sphinx_sources.py",
]
[[tool.hatch.build.targets.wheel.hooks.sphinx.tools]]
tool = "apidoc"
doc_dir = "docs/sphinx-docs"
source = "../../src"
out_dir = "source-temp/dev/sasview-api"
depth = 8
private = false
separate = false
header = "SasView"
exclude = [
"*/UnitTesting/*",
"sas/webfit*",
"sas/qtgui/Perspectives/ParticleEditor/calculations*",
"sas/qtgui/Perspectives/ParticleEditor/Plots*",
"sas/qtgui/Utilities/WhatsNew/messages*",
"sas/sascalc/calculator/ausaxs*",
]
[[tool.hatch.build.targets.wheel.hooks.sphinx.tools]]
tool = "build"
format = "html"
doc_dir = "docs/sphinx-docs/source-temp"
out_dir = "../../../build/doc/html"
warnings = false
keep_going = true
sphinx_opts = "-d ../../../build/doc/html/doctrees"
environment = { PYTHONPATH = "../../../src" }
[tool.pytest.ini_options]
minversion = "6.0"
python_files = [
"u*py",
"*Test*py",
]
python_classes = [
"*Test",
"Test*",
]
qt_api = "pyside6"
addopts = [
"--ignore", "test/utest_sasview.py",
"-v",
"-rsx",
]
log_level = "DEBUG"
filterwarnings = [
]
testpaths = [
"src",
"tests",
]
pythonpath = "src"
norecursedirs = [
"test/sasrealspace",
"test/calculatorview",
]
[tool.ruff]
line-length = 120
[tool.ruff.lint]
# The ruff rules are available at: https://docs.astral.sh/ruff/rules/
select = ["E", # pycodestyle errors
"F", # pyflakes
"I", # isort
"UP", # pyupgrade
"W", # pycodestyle warnings
"SIM118", # Use `key in dict` instead of `key in dict.keys()`
"SIM300"] # Yoda condition detected
ignore = ["E501", # line too long (leave to formatter)
"UP008", # Use `super()` instead of `super(__class__, self)`
"UP031"] # Use format specifiers instead of percent format
[tool.ruff.lint.isort.sections]
# Group all SasData and SasModels imports into a separate section.
"sas" = ["sasdata", "sasmodels"]
[tool.ruff.lint.isort]
section-order = ["future", "standard-library", "third-party", "sas", "first-party", "local-folder"]
|