Skip to content

[Code scan] Align build hook annotations with the advertised Python 3.7/3.8 support #557

Description

@njzjz

This issue was found during a Codex global code scan of the repository.

Baseline commit: e3c5b38

Problem

The project advertises Python 3.7 and 3.8 support, but the Hatch build hook uses dict[str, Any] in a runtime-evaluated annotation. Built-in collection generics require Python 3.9 unless annotations are postponed.

Code references:

dpgui/pyproject.toml

Lines 19 to 35 in e3c5b38

"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Operating System :: POSIX :: Linux",
"Operating System :: MacOS :: MacOS X",
"Operating System :: Microsoft :: Windows",
"License :: OSI Approved :: GNU Lesser General Public License v3 (LGPLv3)",
]
dependencies = [
"dargs>=0.2.6",
"werkzeug",
"waitress",
'importlib_metadata>=1.4; python_version < "3.8"',
]
requires-python = ">=3.7"

def initialize(self, version: str, build_data: dict[str, Any]) -> None:

Relevant snippet:

def initialize(self, version: str, build_data: dict[str, Any]) -> None:

Impact

Source builds on the advertised Python 3.7/3.8 versions can fail when Hatch imports the build hook, before the frontend build step starts.

Suggested fix

Either add from __future__ import annotations, replace the annotation with typing.Dict[str, Any], or drop Python 3.7/3.8 from the supported metadata if they are no longer intended.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status
    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions