summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore1
-rw-r--r--python-instruct.spec182
-rw-r--r--sources1
3 files changed, 184 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
index e69de29..c70cbbb 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1 @@
+/instruct-0.7.2.tar.gz
diff --git a/python-instruct.spec b/python-instruct.spec
new file mode 100644
index 0000000..4359466
--- /dev/null
+++ b/python-instruct.spec
@@ -0,0 +1,182 @@
+%global _empty_manifest_terminate_build 0
+Name: python-instruct
+Version: 0.7.2
+Release: 1
+Summary: please add a summary manually as the author left a blank one
+License: BSD
+URL: https://github.com/autumnjolitz/instruct
+Source0: https://mirrors.nju.edu.cn/pypi/web/packages/05/d8/8799e697052ca9ea2657ce14cc7127f2790d953a4dd2bb0422e851e26854/instruct-0.7.2.tar.gz
+BuildArch: noarch
+
+Requires: python3-Jinja2
+Requires: python3-inflection
+Requires: python3-typing-extensions
+Requires: python3-twine
+Requires: python3-pytest
+Requires: python3-pytest-mock
+Requires: python3-pytest
+Requires: python3-pytest-mock
+
+%description
+A compact, fast object system that can serve as the basis for a DAO model.
+To that end, instruct uses ``__slots__`` to prevent new attribute addition, properties to control types, event listeners and historical changes, and a Jinja2-driven codegen to keep a pure-Python implementation as fast and as light as possible.
+I want to basically have a form of strictly typed objects that behave like C structs but can handle automatically coercing incoming values correctly, have primitive events and have fast ``__iter__``, ``__eq__`` while also allowing for one to override it in the final class (and even call super!)
+This girl asks for a lot but I like taking metaclassing as far as it can go without diving into using macropy. 😉
+Current Capabilities:
+ - Support multiple inheritance, chained fields and ``__slots__`` [Done]
+ - Support type coercions (via ``_coerce__``) [Done]
+ - Strictly-typed ability to define fixed data objects [Done]
+ - Ability to drop all of the above type checks [Done]
+ - Track changes made to the object as well as reset [Done]
+ - Fast ``__iter__`` [Done]
+ - Native support of pickle [Done]/json [Done]
+ - Support List[type] declarations and initializations [Done]
+ - optionally data class annotation-like behavior [Done]
+ - ``_asdict``, ``_astuple``, ``_aslist`` functions like in a NamedTuple [Done]
+ - ``get``, ``keys``, ``values``, ``item`` functions available in the module and in a mixin named ``mapping=True``
+ + This effectively allows access like other packages e.g. ``attrs.keys(item_instance)``
+ - ``bytes``/``bytearray`` are urlsafe base64 encoded by default, can override per field via a class level ``BINARY_JSON_ENCODERS = {key: encoding_function}`` [Done]
+ - Allow ``__coerce__`` to have a tuple of field names to avoid repetition on ``__coerce__`` definitions [Done]
+ - Allow use of ``Literal`` in the type (exact match of a value to a vector of values) [Done]
+ - Allow subtraction of properties like ``(F - {"a", "b"}).keys() == F_without_a_b.keys()`` [Done]
+ + This will allow one to slim down a class to a restricted subtype, like for use in a DAO system to load/hold less data.
+ - Allow subtraction of properties like ``(F - {"a": {"b"}).keys() == F_a_without_b.keys()`` [Done]
+ + This allows for one to remove fields that are unused prior to class initialization.
+ - Allow subtraction of properties via an inclusive list like ``(F & {"a", "b"}).keys() == F_with_only_a_and_b.keys()`` [Done]
+ - Allow subtraction to propagate to embedded Instruct classes like ``(F - {"a.b", "a.c"}).a.keys() == (F_a.keys() - {"b", "c"))`` [Done]
+ + This would really allow for complex trees of properties to be rendered down to thin SQL column selects, thus reducing data load.
+ - Replace references to an embedded class in a ``__coerce__`` function with the subtracted form in case of embedded property subtractions [Done]
+ - Allow use of Annotated i.e. ``field: Annotated[int, NoJSON, NoPickle]`` and have ``to_json`` and ``pickle.dumps(...)`` skip "field" [Done]
+ + Would grant a more powerful interface to controlling code-gen'ed areas via ``cls._annotated_metadata`` (maps field -> what's inside the ``Annotation``)
+Next Goals:
+ - Allow Generics i.e. ``class F(instruct.Base, T): ...`` -> ``F[str](...)``
+ + Would be able to allow specialized subtypes
+ - ``CStruct``-Base class that operates on an ``_cvalue`` cffi struct.
+ - Cython compatibility
+
+%package -n python3-instruct
+Summary: please add a summary manually as the author left a blank one
+Provides: python-instruct
+BuildRequires: python3-devel
+BuildRequires: python3-setuptools
+BuildRequires: python3-pip
+%description -n python3-instruct
+A compact, fast object system that can serve as the basis for a DAO model.
+To that end, instruct uses ``__slots__`` to prevent new attribute addition, properties to control types, event listeners and historical changes, and a Jinja2-driven codegen to keep a pure-Python implementation as fast and as light as possible.
+I want to basically have a form of strictly typed objects that behave like C structs but can handle automatically coercing incoming values correctly, have primitive events and have fast ``__iter__``, ``__eq__`` while also allowing for one to override it in the final class (and even call super!)
+This girl asks for a lot but I like taking metaclassing as far as it can go without diving into using macropy. 😉
+Current Capabilities:
+ - Support multiple inheritance, chained fields and ``__slots__`` [Done]
+ - Support type coercions (via ``_coerce__``) [Done]
+ - Strictly-typed ability to define fixed data objects [Done]
+ - Ability to drop all of the above type checks [Done]
+ - Track changes made to the object as well as reset [Done]
+ - Fast ``__iter__`` [Done]
+ - Native support of pickle [Done]/json [Done]
+ - Support List[type] declarations and initializations [Done]
+ - optionally data class annotation-like behavior [Done]
+ - ``_asdict``, ``_astuple``, ``_aslist`` functions like in a NamedTuple [Done]
+ - ``get``, ``keys``, ``values``, ``item`` functions available in the module and in a mixin named ``mapping=True``
+ + This effectively allows access like other packages e.g. ``attrs.keys(item_instance)``
+ - ``bytes``/``bytearray`` are urlsafe base64 encoded by default, can override per field via a class level ``BINARY_JSON_ENCODERS = {key: encoding_function}`` [Done]
+ - Allow ``__coerce__`` to have a tuple of field names to avoid repetition on ``__coerce__`` definitions [Done]
+ - Allow use of ``Literal`` in the type (exact match of a value to a vector of values) [Done]
+ - Allow subtraction of properties like ``(F - {"a", "b"}).keys() == F_without_a_b.keys()`` [Done]
+ + This will allow one to slim down a class to a restricted subtype, like for use in a DAO system to load/hold less data.
+ - Allow subtraction of properties like ``(F - {"a": {"b"}).keys() == F_a_without_b.keys()`` [Done]
+ + This allows for one to remove fields that are unused prior to class initialization.
+ - Allow subtraction of properties via an inclusive list like ``(F & {"a", "b"}).keys() == F_with_only_a_and_b.keys()`` [Done]
+ - Allow subtraction to propagate to embedded Instruct classes like ``(F - {"a.b", "a.c"}).a.keys() == (F_a.keys() - {"b", "c"))`` [Done]
+ + This would really allow for complex trees of properties to be rendered down to thin SQL column selects, thus reducing data load.
+ - Replace references to an embedded class in a ``__coerce__`` function with the subtracted form in case of embedded property subtractions [Done]
+ - Allow use of Annotated i.e. ``field: Annotated[int, NoJSON, NoPickle]`` and have ``to_json`` and ``pickle.dumps(...)`` skip "field" [Done]
+ + Would grant a more powerful interface to controlling code-gen'ed areas via ``cls._annotated_metadata`` (maps field -> what's inside the ``Annotation``)
+Next Goals:
+ - Allow Generics i.e. ``class F(instruct.Base, T): ...`` -> ``F[str](...)``
+ + Would be able to allow specialized subtypes
+ - ``CStruct``-Base class that operates on an ``_cvalue`` cffi struct.
+ - Cython compatibility
+
+%package help
+Summary: Development documents and examples for instruct
+Provides: python3-instruct-doc
+%description help
+A compact, fast object system that can serve as the basis for a DAO model.
+To that end, instruct uses ``__slots__`` to prevent new attribute addition, properties to control types, event listeners and historical changes, and a Jinja2-driven codegen to keep a pure-Python implementation as fast and as light as possible.
+I want to basically have a form of strictly typed objects that behave like C structs but can handle automatically coercing incoming values correctly, have primitive events and have fast ``__iter__``, ``__eq__`` while also allowing for one to override it in the final class (and even call super!)
+This girl asks for a lot but I like taking metaclassing as far as it can go without diving into using macropy. 😉
+Current Capabilities:
+ - Support multiple inheritance, chained fields and ``__slots__`` [Done]
+ - Support type coercions (via ``_coerce__``) [Done]
+ - Strictly-typed ability to define fixed data objects [Done]
+ - Ability to drop all of the above type checks [Done]
+ - Track changes made to the object as well as reset [Done]
+ - Fast ``__iter__`` [Done]
+ - Native support of pickle [Done]/json [Done]
+ - Support List[type] declarations and initializations [Done]
+ - optionally data class annotation-like behavior [Done]
+ - ``_asdict``, ``_astuple``, ``_aslist`` functions like in a NamedTuple [Done]
+ - ``get``, ``keys``, ``values``, ``item`` functions available in the module and in a mixin named ``mapping=True``
+ + This effectively allows access like other packages e.g. ``attrs.keys(item_instance)``
+ - ``bytes``/``bytearray`` are urlsafe base64 encoded by default, can override per field via a class level ``BINARY_JSON_ENCODERS = {key: encoding_function}`` [Done]
+ - Allow ``__coerce__`` to have a tuple of field names to avoid repetition on ``__coerce__`` definitions [Done]
+ - Allow use of ``Literal`` in the type (exact match of a value to a vector of values) [Done]
+ - Allow subtraction of properties like ``(F - {"a", "b"}).keys() == F_without_a_b.keys()`` [Done]
+ + This will allow one to slim down a class to a restricted subtype, like for use in a DAO system to load/hold less data.
+ - Allow subtraction of properties like ``(F - {"a": {"b"}).keys() == F_a_without_b.keys()`` [Done]
+ + This allows for one to remove fields that are unused prior to class initialization.
+ - Allow subtraction of properties via an inclusive list like ``(F & {"a", "b"}).keys() == F_with_only_a_and_b.keys()`` [Done]
+ - Allow subtraction to propagate to embedded Instruct classes like ``(F - {"a.b", "a.c"}).a.keys() == (F_a.keys() - {"b", "c"))`` [Done]
+ + This would really allow for complex trees of properties to be rendered down to thin SQL column selects, thus reducing data load.
+ - Replace references to an embedded class in a ``__coerce__`` function with the subtracted form in case of embedded property subtractions [Done]
+ - Allow use of Annotated i.e. ``field: Annotated[int, NoJSON, NoPickle]`` and have ``to_json`` and ``pickle.dumps(...)`` skip "field" [Done]
+ + Would grant a more powerful interface to controlling code-gen'ed areas via ``cls._annotated_metadata`` (maps field -> what's inside the ``Annotation``)
+Next Goals:
+ - Allow Generics i.e. ``class F(instruct.Base, T): ...`` -> ``F[str](...)``
+ + Would be able to allow specialized subtypes
+ - ``CStruct``-Base class that operates on an ``_cvalue`` cffi struct.
+ - Cython compatibility
+
+%prep
+%autosetup -n instruct-0.7.2
+
+%build
+%py3_build
+
+%install
+%py3_install
+install -d -m755 %{buildroot}/%{_pkgdocdir}
+if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi
+if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi
+if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi
+if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi
+pushd %{buildroot}
+if [ -d usr/lib ]; then
+ find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst
+fi
+if [ -d usr/lib64 ]; then
+ find usr/lib64 -type f -printf "/%h/%f\n" >> filelist.lst
+fi
+if [ -d usr/bin ]; then
+ find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst
+fi
+if [ -d usr/sbin ]; then
+ find usr/sbin -type f -printf "/%h/%f\n" >> filelist.lst
+fi
+touch doclist.lst
+if [ -d usr/share/man ]; then
+ find usr/share/man -type f -printf "/%h/%f.gz\n" >> doclist.lst
+fi
+popd
+mv %{buildroot}/filelist.lst .
+mv %{buildroot}/doclist.lst .
+
+%files -n python3-instruct -f filelist.lst
+%dir %{python3_sitelib}/*
+
+%files help -f doclist.lst
+%{_docdir}/*
+
+%changelog
+* Mon May 29 2023 Python_Bot <Python_Bot@openeuler.org> - 0.7.2-1
+- Package Spec generated
diff --git a/sources b/sources
new file mode 100644
index 0000000..64fff08
--- /dev/null
+++ b/sources
@@ -0,0 +1 @@
+184820a5b1d71622e9ef547eae260e77 instruct-0.7.2.tar.gz