From b53e761d1cedb80b7dfdd53c6a00c9c5b96476dc Mon Sep 17 00:00:00 2001 From: Jamie Date: Mon, 3 Jun 2024 09:30:30 +0100 Subject: [PATCH] Consolidate datatypes submodule Datatypes, Responses, Enums --- src/speedruncompy/datatypes/__init__.py | 4 +++- src/speedruncompy/datatypes/defs.py | 11 +---------- src/speedruncompy/{ => datatypes}/enums.py | 0 src/speedruncompy/{ => datatypes}/responses.py | 5 ++++- 4 files changed, 8 insertions(+), 12 deletions(-) rename src/speedruncompy/{ => datatypes}/enums.py (100%) rename src/speedruncompy/{ => datatypes}/responses.py (99%) diff --git a/src/speedruncompy/datatypes/__init__.py b/src/speedruncompy/datatypes/__init__.py index 816f228..3a2e288 100644 --- a/src/speedruncompy/datatypes/__init__.py +++ b/src/speedruncompy/datatypes/__init__.py @@ -6,5 +6,7 @@ Missing attributes remain available through both objectlike and dictlike interfaces, so you can treat them as normal (albeit without type hinting).""" +from ._impl import LenientDatatype, Datatype # noqa + from .defs import * # noqa -from ._impl import LenientDatatype, Datatype, LenientDatatype # noqa +from . import responses, enums, _impl # noqa diff --git a/src/speedruncompy/datatypes/defs.py b/src/speedruncompy/datatypes/defs.py index 30c1347..576cd2c 100644 --- a/src/speedruncompy/datatypes/defs.py +++ b/src/speedruncompy/datatypes/defs.py @@ -1,14 +1,5 @@ -""" -Useful datatypes in both a dictlike and objectlike interface, to facilitate type hinting. - -Note that the attribute hints may not be exhaustive; -while I endeavour to keep these up to date, updates to the v2 API are unannounced and may be missed. - -Missing attributes should remain available through both objectlike and dictlike interfaces, -so you can treat them as normal (albeit without type hinting). -""" from ._impl import Datatype, OptField -from ..enums import * +from .enums import * class StaticAsset(Datatype): diff --git a/src/speedruncompy/enums.py b/src/speedruncompy/datatypes/enums.py similarity index 100% rename from src/speedruncompy/enums.py rename to src/speedruncompy/datatypes/enums.py diff --git a/src/speedruncompy/responses.py b/src/speedruncompy/datatypes/responses.py similarity index 99% rename from src/speedruncompy/responses.py rename to src/speedruncompy/datatypes/responses.py index 60f9823..17a4abc 100644 --- a/src/speedruncompy/responses.py +++ b/src/speedruncompy/datatypes/responses.py @@ -1,7 +1,10 @@ from types import NoneType -from .datatypes import * from typing import Any +from ._impl import Datatype +from .defs import * + + class r_Empty(Datatype): """No Content"""