From 12c78ea8cbb0ad95f12ef226767013f7cb54950c Mon Sep 17 00:00:00 2001 From: smillmorel Date: Wed, 16 Sep 2026 12:02:47 -0400 Subject: [PATCH] build: read version from _const.py, drop phantom scipy/pandas deps Single source of truth for the package + pinned solver versions in src/otko/_const.py (hatch dynamic version). scipy/pandas were listed in [gui] but never imported. mypy strict mode rescoped to core/services/viewmodels; tomli added for tomllib-less Pythons. --- pyproject.toml | 24 +++++++++++++++--------- src/otko/__init__.py | 4 +++- src/otko/_const.py | 13 +++++++++++++ 3 files changed, 31 insertions(+), 10 deletions(-) create mode 100644 src/otko/_const.py diff --git a/pyproject.toml b/pyproject.toml index 93bfc44..5e1e4bf 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "hatchling.build" [project] name = "otko" -version = "0.1.0" +dynamic = ["version"] description = "OTKO — a modern, SAP2000-style desktop GUI for OpenSeesPy." readme = "README.md" requires-python = ">=3.10" @@ -42,10 +42,6 @@ gui = [ "vtk>=9.3", "pyqtgraph>=0.13", "imageio[ffmpeg]>=2.34", - # scipy and pandas are listed for forward-compatibility; they are not - # currently imported by any module in this repo (phantom deps as of 2026-06-15). - "scipy>=1.11", - "pandas>=2.1", ] dev = [ "pytest>=7.4", @@ -55,6 +51,7 @@ dev = [ "mypy>=1.8", "pre-commit>=3.6", "hatch>=1.9", + "tomli>=2.0; python_version < '3.11'", ] docs = [ "sphinx>=7.2", @@ -72,6 +69,9 @@ Issues = "https://github.com/ogunc/otko/issues" [tool.hatch.build.targets.wheel] packages = ["src/otko"] +[tool.hatch.version] +path = "src/otko/_const.py" + # ─────────── Ruff ─────────── [tool.ruff] line-length = 100 @@ -97,12 +97,13 @@ quote-style = "double" # ─────────── Mypy ─────────── [tool.mypy] python_version = "3.10" -strict = true -warn_unused_ignores = true -warn_return_any = true -disallow_untyped_defs = true +warn_unused_configs = true plugins = [] +[[tool.mypy.overrides]] +module = ["otko.core.*", "otko.services.*", "otko.viewmodels.*"] +strict = true + [[tool.mypy.overrides]] module = ["openseespy.*", "pyvista.*", "pyvistaqt.*", "vtk.*", "pyqtgraph.*"] ignore_missing_imports = true @@ -121,3 +122,8 @@ markers = [ branch = true source = ["src/otko"] omit = ["src/otko/views/*"] # GUI excluded from coverage targets + +[tool.coverage.report] +exclude_lines = ["if TYPE_CHECKING:", "raise NotImplementedError"] +# Conservative floor for the headless suite; raise deliberately with evidence. +fail_under = 50 diff --git a/src/otko/__init__.py b/src/otko/__init__.py index d9d3102..6291478 100644 --- a/src/otko/__init__.py +++ b/src/otko/__init__.py @@ -1,3 +1,5 @@ """OTKO — a desktop GUI for OpenSeesPy.""" -__version__ = "0.1.0" +from otko._const import __version__ + +__all__ = ["__version__"] diff --git a/src/otko/_const.py b/src/otko/_const.py new file mode 100644 index 0000000..51e97ce --- /dev/null +++ b/src/otko/_const.py @@ -0,0 +1,13 @@ +# Ported from otko-development (MIT), (c) 2026 OTKO contributors +"""Single source of truth for OTKO's version and the pinned solver version. + +Defines the package version and the pinned OpenseesPy version exactly once +so neither is duplicated as a literal anywhere else in the source. +""" + +from __future__ import annotations + +__version__ = "0.1.0" + +#: Pinned OpenseesPy version the application targets. +OPENSEESPY_VERSION = "3.8.0.0"