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
|
# pyproject.toml
[build-system]
requires = ["hatchling", "hatch-vcs"]
build-backend = "hatchling.build"
# https://peps.python.org/pep-0621/
[project]
name = "magicgui"
description = " build GUIs from python types"
keywords = ["gui", "widgets", "type annotations"]
readme = "README.md"
requires-python = ">=3.8"
license = { text = "MIT" }
authors = [{ email = "talley.lambert@gmail.com", name = "Talley Lambert" }]
classifiers = [
"Development Status :: 4 - Beta",
"Environment :: X11 Applications :: Qt",
"Intended Audience :: Developers",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Topic :: Desktop Environment",
"Topic :: Software Development",
"Topic :: Software Development :: User Interfaces",
"Topic :: Software Development :: Widget Sets",
"Topic :: Utilities",
]
dynamic = ["version"]
dependencies = [
"docstring_parser>=0.7",
"psygnal>=0.6.1",
"qtpy>=1.7.0",
"superqt[iconify]>=0.6.1",
"typing_extensions>=4.6",
]
# extras
# https://peps.python.org/pep-0621/#dependencies-optional-dependencies
[project.optional-dependencies]
pyqt5 = ["pyqt5>=5.12.0"]
pyqt6 = ["pyqt6"]
pyside2 = [
"pyside2>=5.14 ; python_version=='3.8'",
"pyside2>=5.15 ; python_version>='3.9'",
]
pyside6 = ["pyside6"]
tqdm = ["tqdm>=4.30.0"]
jupyter = ["ipywidgets>=8.0.0"]
image = ["pillow>=4.0"]
quantity = ["pint>=0.13.0"]
test = [
"pytest",
"pytest-qt",
"pytest-cov",
"pytest-mypy-plugins>=3",
"numpy",
"pandas",
"tqdm>=4.30.0",
"pillow>=4.0",
"pint>=0.13.0",
"matplotlib",
"toolz",
"ipywidgets",
"ipykernel",
"pydantic",
"attrs",
"annotated_types",
]
dev = [
"ruff",
"ipython",
"mypy",
"pdbpp",
"pre-commit",
"pyqt6",
"rich",
]
docs = [
"mkdocs",
"mkdocs-material ~=9.5",
"mkdocstrings ==0.25.1",
"mkdocstrings-python ==1.10.5",
"mkdocs-gen-files ==0.5.0",
"mkdocs-literate-nav ==0.6.1",
"mkdocs-spellcheck[all]",
"mkdocs-gallery ==0.10.1",
"qtgallery ==0.0.2",
# extras for all the widgets
"napari ==0.5.0",
"pyqt6",
"pint",
"matplotlib",
"ipywidgets >=8.0.0",
"ipykernel",
]
[project.urls]
homepage = "https://github.com/pyapp-kit/magicgui"
repository = "https://github.com/pyapp-kit/magicgui"
changelog = "https://github.com/pyapp-kit/magicgui/blob/main/CHANGELOG.md"
issues = "https://github.com/pyapp-kit/magicgui/issues"
documentation = "https://pyapp-kit.github.io/magicgui/"
[tool.hatch.version]
source = "vcs"
[tool.hatch.envs.test]
features = ["test"]
[tool.hatch.envs.test.scripts]
run = "pytest -v --color=yes --cov-config=pyproject.toml --cov --cov-report=xml --cov-report=term-missing"
[[tool.hatch.envs.test.matrix]]
backend = ["pyqt5", "pyside2", "pyqt6", "pyside6"]
[tool.hatch.envs.test.overrides]
# matrix.deps.features = [
# { value = "min-req", if = ["min-req"] },
# ]
matrix.backend.features = [
{ value = "pyqt5", if = [
"pyqt5",
] },
{ value = "pyside2", if = [
"pyside2",
] },
{ value = "pyqt6", if = [
"pyqt6",
] },
{ value = "pyside6", if = [
"pyside6",
] },
]
# https://docs.astral.sh/ruff
[tool.ruff]
line-length = 88
target-version = "py38"
src = ["src", "tests"]
[tool.ruff.lint]
pydocstyle = { convention = "numpy" }
select = [
"E", # style errors
"F", # flakes
"W", # warnings
"D", # pydocstyle
"D417", # Missing argument descriptions in Docstrings
"I", # isort
"UP", # pyupgrade
"C4", # flake8-comprehensions
"B", # flake8-bugbear
"A001", # flake8-builtins
"TCH", # type checking
"TID", # tidy imports
"RUF", # ruff-specific rules
]
ignore = [
"D401", # First line should be in imperative mood
]
[tool.ruff.lint.per-file-ignores]
"tests/*.py" = ["D", "S", "E501"]
"docs/*.py" = ["B"]
"docs/examples/*.py" = ["D", "B", "E501"]
"src/magicgui/widgets/_image/*.py" = ["D"]
# https://docs.astral.sh/ruff/formatter/
[tool.ruff.format]
docstring-code-format = true
# https://docs.pytest.org/en/6.2.x/customize.html
[tool.pytest.ini_options]
minversion = "6.0"
testpaths = ["tests"]
filterwarnings = [
"error",
"ignore:Failed to disconnect::pytestqt",
"ignore::DeprecationWarning:tqdm",
"ignore::DeprecationWarning:docstring_parser",
"ignore:distutils Version classes are deprecated:DeprecationWarning",
]
# https://mypy.readthedocs.io/en/stable/config_file.html
[tool.mypy]
files = "src/**/*.py"
strict = true
disallow_any_generics = false
disallow_subclassing_any = false
show_error_codes = true
pretty = true
[[tool.mypy.overrides]]
module = [
"_pytest.*",
".docs/",
"magicgui.widgets._image.*",
"magicgui.backends.*",
]
ignore_errors = true
[[tool.mypy.overrides]]
module = ["ipywidgets.*", "toolz.*"]
ignore_missing_imports = true
# https://coverage.readthedocs.io/en/6.4/config.html
[tool.coverage.report]
show_missing = true
exclude_lines = [
"pragma: no cover",
"if TYPE_CHECKING:",
"@overload",
"except ImportError",
"except ImportError*",
"raise NotImplementedError()",
"pass",
"\\.\\.\\.",
]
omit = [
"**/magicgui/events.py",
"**/magicgui/widgets/_image/_mpl_image.py",
"**/magicgui/widgets/_bases/*",
"tests/*",
"docs/*",
]
[tool.coverage.run]
source = ["magicgui"]
# https://github.com/mgedmin/check-manifest#configuration
[tool.check-manifest]
ignore = [
".pre-commit-config.yaml",
"tests/**/*",
".github_changelog_generator",
"codecov.yml",
".ruff_cache/**/*",
]
|