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 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319
|
[build-system]
# Minimum requirements for the build system to execute.
# PEP 508 specifications for PEP 518.
requires = [
"setuptools >= 61.0.0",
"setuptools_scm[toml]>=7.0",
"wheel",
]
build-backend="setuptools.build_meta"
[project]
name = "urwid"
description = "A full-featured console (xterm et al.) user interface library"
requires-python = ">=3.7.0"
keywords = ["curses", "ui", "widget", "scroll", "listbox", "user interface", "text layout", "console", "ncurses"]
license={text="LGPL-2.1-only"} # Use SPDX classifier
readme = {file = "README.rst", content-type = "text/x-rst"}
authors=[{name="Ian Ward", email="ian@excess.org"}]
dynamic = ["classifiers", "version", "dependencies"]
[project.urls]
"Homepage" = "https://urwid.org/"
"Documentation" = "https://urwid.org/manual/index.html"
"Repository" = "https://github.com/urwid/urwid"
"Bug Tracker" = "https://github.com/urwid/urwid/issues"
[tool.setuptools]
platforms=["unix-like"]
zip-safe = false
[tool.setuptools.packages.find]
exclude = [
"doc",
"docs",
"examples",
"test",
"tests",
"bin",
".*"
]
namespaces = false
[tool.setuptools.dynamic]
dependencies = {file = ["requirements.txt"]}
classifiers = {file = ["classifiers.txt"]}
[project.optional-dependencies]
curses = ["windows-curses;sys_platform=='win32'"]
glib = ["PyGObject"]
tornado = ["tornado>=5.0"]
trio = ["trio>=0.22.0", "exceptiongroup"]
twisted = ["twisted"]
zmq = ["zmq"]
# for lcd_display
serial = ["pyserial"]
lcd = ["pyserial"]
[tool.distutils.bdist_wheel]
universal = 0
[tool.setuptools_scm]
write_to = "urwid/version.py"
[tool.cibuildwheel]
# Disable building PyPy wheels on all platforms
# Disable musllinux as not popular platform
skip = ["pp*", "*-musllinux_*"]
[tool.isort]
profile = "black"
line_length = 120
[tool.black]
line-length = 120
[tool.pytest.ini_options]
minversion = "6.0"
addopts = "-vvvv --doctest-modules -s --cov=urwid"
doctest_optionflags = ["ELLIPSIS", "IGNORE_EXCEPTION_DETAIL"]
testpaths = ["urwid"]
[tool.coverage.run]
omit = ["tests/*", ".tox/*", "setup.py"]
branch = true
[tool.coverage.report]
exclude_lines = [
# Have to re-enable the standard pragma
"pragma: no cover",
# Don't complain about missing debug-only code:
"def __repr__",
"def __rich_repr__",
# own repr construct magic
"def _repr_words",
"def _repr_attrs",
# Don't complain if tests don't hit defensive assertion code:
"raise NotImplementedError",
# Exclude methods marked as abstract
"@abstractmethod",
"@abc.abstractmethod",
# Exclude import statements
"^from\b",
"^import\b",
# Exclude variable declarations that are executed when file is loaded
"^[a-zA-Z_]+\b\\s=",
# Code for static analysis is never covered:
"if typing.TYPE_CHECKING:",
"@typing.overload",
"@overload",
# Protocols
"@runtime_checkable",
"@typing.runtime_checkable",
"class \\w*\\(Protocol\\):",
"class \\w*\\(typing.Protocol\\):",
# Fallback code with no installed deps is almost impossible to cover properly
"except ImportError:",
# Don't complain if non-runnable code isn't run:
"if __name__ == .__main__.:",
# OS Specific
"if platform.system()",
"if IS_WINDOWS",
"if os.name",
"if sys.platform",
# Manual test code
"class \\w*test:",
"def \\wtest():"
]
[tool.mypy]
show_error_context = true
show_column_numbers = true
show_error_codes = true
pretty = true
[[tool.mypy.overrides]]
module = [
"gi.*",
"trio.*",
"serial.*"
]
ignore_missing_imports = true
[tool.ruff]
line-length = 120
output-format = "full"
target-version = "py37"
extend-exclude = ["tests"]
[tool.ruff.lint]
extend-select = [
"E",
"W", # also pycodestyle warnings
"PYI", # flake8-pyi
"ASYNC", # flake8-async
"FA", # from __future__ import annotations
"SLOT", # flake8-slots
"TCH", # flake8-type-checking
"S", # flake8-bandit
"A", # flake8-builtins
"B", "T10", "EXE", # flake8-bugbear, flake8-debugger, flake8-executable
"ISC", # flake8-implicit-str-concat
"RET", "SIM", "C4", # flake8-return, flake8-simplify, flake8-comprehensions
"ICN", "PGH", # flake8-import-conventions, pygrep-hooks
"Q", # quotes
"FLY", # Flynt
"TRY", "UP", "I", "PL", "PERF", "RUF", # tryceratops, pyupgrade, isort, pylint + perflint, Ruff-specific
]
extend-ignore = [
"PLR6301", "E203",
# refactor rules (too many statements/arguments/branches)
"PLR0904", "PLR0911", "PLR0912", "PLR0913", "PLR0914", "PLR0915", "PLR0917", "PLR2004",
"PLC0415", # We have a lot of imports outside of top-level
"RET504", # Unnecessary variable assignment before return statement
"SIM108", # Use ternary operator,
"TRY003", #long messages prepare outside, ...
]
[tool.ruff.lint.per-file-ignores]
"__init__.py" = ["F401", "SIM105"]
[tool.ruff.lint.isort]
known-third-party = []
[tool.ruff.lint.pydocstyle]
convention = "pep257"
[tool.ruff.lint.pylint]
allow-dunder-method-names = [
"__rich_repr__",
# class generation
"_contents__getitem__",
"_contents__setitem__",
"_contents__delitem__",
]
[tool.pylint]
extension-pkg-whitelist = []
ignore = ["CVS", "_version.py"]
jobs = 0
py-version = "3.7"
load-plugins = [
"pylint.extensions.overlapping_exceptions",
"pylint.extensions.check_elif",
"pylint.extensions.for_any_all",
"pylint.extensions.code_style",
"pylint.extensions.redefined_variable_type",
"pylint.extensions.dict_init_mutate",
"pylint.extensions.typing",
"pylint.extensions.dunder",
]
enable = "all"
disable = [
"locally-disabled",
"file-ignored",
"suppressed-message",
"similarities",
"too-many-ancestors",
"too-few-public-methods",
"too-many-public-methods",
"too-many-return-statements",
"too-many-branches",
"too-many-arguments",
"too-many-locals",
"too-many-statements",
"too-many-instance-attributes",
"too-many-lines",
"too-many-nested-blocks",
"too-many-positional-arguments",
"broad-except",
"broad-exception-raised",
"logging-fstring-interpolation",
"logging-format-interpolation",
"fixme",
"invalid-name",
"import-outside-toplevel",
"cyclic-import",
"missing-docstring",
"use-implicit-booleaness-not-comparison-to-zero",
"unused-argument",
"unused-private-member",
"arguments-differ",
"consider-using-assignment-expr",
"superfluous-parens",
# Magic part
"invalid-overridden-method",
"attribute-defined-outside-init", # old bad practice, fixed step-by-step
"redefined-variable-type", # makes not happy typechecking, but super common
# too complex union
"use-implicit-booleaness-not-comparison-to-string",
# iterable modification during iteration
"consider-using-enumerate",
]
max-line-length = 120
reports = false
[tool.pylint.basic]
good-names = [
"i", "j", "k", "ex", "Run", "_",
"bar", # we draw bars
]
[tool.pylint.classes]
exclude-protected = [
"_asdict",
"_fields",
"_replace",
"_source",
"_make",
"os._exit",
# API
"_original_widget",
"_invalidate",
"_repr_attrs",
"_repr_words",
"_w",
]
[tool.pylint.format]
ignore-long-lines = "^(\\s*(# )?<?https?://\\S+>?)|(.+# type: ignore\\[[\\w\\-\\,]+\\])$"
[tool.pylint.dunder]
good-dunder-names = [
"__rich_repr__",
# class generation
"_contents__getitem__",
"_contents__setitem__",
"_contents__delitem__",
]
[tool.refurb]
python_version = "3.7"
ignore = ["FURB104", "FURB144", "FURB146"]
[[tool.refurb.amend]]
path = "urwid/__init__.py"
ignore = ["FURB107"]
[[tool.refurb.amend]]
path = "urwid/display/__init__.py"
ignore = ["FURB107"]
[[tool.refurb.amend]]
path = "urwid/event_loop/__init__.py"
ignore = ["FURB107"]
|