diff options
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | python-pytypes.spec | 124 | ||||
-rw-r--r-- | sources | 1 |
3 files changed, 126 insertions, 0 deletions
@@ -0,0 +1 @@ +/pytypes-1.0b10.tar.gz diff --git a/python-pytypes.spec b/python-pytypes.spec new file mode 100644 index 0000000..9f31d1a --- /dev/null +++ b/python-pytypes.spec @@ -0,0 +1,124 @@ +%global _empty_manifest_terminate_build 0 +Name: python-pytypes +Version: 1.0b10 +Release: 1 +Summary: Typing toolbox for Python 3 _and_ 2. +License: Apache-2.0 +URL: https://github.com/Stewori/pytypes +Source0: https://mirrors.nju.edu.cn/pypi/web/packages/0c/cf/ed8169e562bb33049fcc5aac113ba51c88d3295391b9a2328f6402b32146/pytypes-1.0b10.tar.gz +BuildArch: noarch + +Requires: python3-typing + +%description +pytypes is a typing toolbox w.r.t. `PEP +484 <https://www.python.org/dev/peps/pep-0484/>`__ (PEP +`526 <https://www.python.org/dev/peps/pep-0526/>`__ on the road map, +later also `544 <https://www.python.org/dev/peps/pep-0544/>`__ if it +gets accepted). +Its main features are currently +- ``@typechecked`` decorator for runtime typechecking with support for `stubfiles <https://www.python.org/dev/peps/pep-0484/#stub-files>`__ and `type comments <https://www.python.org/dev/peps/pep-0484/#suggested-syntax-for-python-2-7-and-straddling-code>`__ +- ``@override`` decorator that asserts existence of a type-compatible parent method +- ``@annotations`` decorator to turn type info from stubfiles or from type comments into ``__annotations__`` +- ``@typelogged`` decorator observes function and method calls at runtime and generates stubfiles from acquired type info +- service functions to apply these decorators module wide or even globally, i.e. runtime wide +- typechecking can alternatively be done in decorator-free manner (friendlier for debuggers) +- all the above decorators work smoothly with OOP, i.e. with methods, static methods, class methods and properties, even if classes are nested +- converter for stubfiles to Python 2.7 compliant form +- lots of utility functions regarding types, e.g. a Python 2.7 compliant and actually functional implementation of ``get_type_hints`` +- full Python 2.7 support for all these features +An additional future goal will be integration with the Java typing system when running on Jython. Along with this, some generator utilities to produce type-safe Java bindings for Python frameworks are planned. +In wider sense, PEP 484-style type annotations can be used to build type safe interfaces to allow also other programming languages to call into Python code (kind of reverse FFI). In this sense the project name refers to 'ctypes', which provides Python-bindings of C. + +%package -n python3-pytypes +Summary: Typing toolbox for Python 3 _and_ 2. +Provides: python-pytypes +BuildRequires: python3-devel +BuildRequires: python3-setuptools +BuildRequires: python3-pip +%description -n python3-pytypes +pytypes is a typing toolbox w.r.t. `PEP +484 <https://www.python.org/dev/peps/pep-0484/>`__ (PEP +`526 <https://www.python.org/dev/peps/pep-0526/>`__ on the road map, +later also `544 <https://www.python.org/dev/peps/pep-0544/>`__ if it +gets accepted). +Its main features are currently +- ``@typechecked`` decorator for runtime typechecking with support for `stubfiles <https://www.python.org/dev/peps/pep-0484/#stub-files>`__ and `type comments <https://www.python.org/dev/peps/pep-0484/#suggested-syntax-for-python-2-7-and-straddling-code>`__ +- ``@override`` decorator that asserts existence of a type-compatible parent method +- ``@annotations`` decorator to turn type info from stubfiles or from type comments into ``__annotations__`` +- ``@typelogged`` decorator observes function and method calls at runtime and generates stubfiles from acquired type info +- service functions to apply these decorators module wide or even globally, i.e. runtime wide +- typechecking can alternatively be done in decorator-free manner (friendlier for debuggers) +- all the above decorators work smoothly with OOP, i.e. with methods, static methods, class methods and properties, even if classes are nested +- converter for stubfiles to Python 2.7 compliant form +- lots of utility functions regarding types, e.g. a Python 2.7 compliant and actually functional implementation of ``get_type_hints`` +- full Python 2.7 support for all these features +An additional future goal will be integration with the Java typing system when running on Jython. Along with this, some generator utilities to produce type-safe Java bindings for Python frameworks are planned. +In wider sense, PEP 484-style type annotations can be used to build type safe interfaces to allow also other programming languages to call into Python code (kind of reverse FFI). In this sense the project name refers to 'ctypes', which provides Python-bindings of C. + +%package help +Summary: Development documents and examples for pytypes +Provides: python3-pytypes-doc +%description help +pytypes is a typing toolbox w.r.t. `PEP +484 <https://www.python.org/dev/peps/pep-0484/>`__ (PEP +`526 <https://www.python.org/dev/peps/pep-0526/>`__ on the road map, +later also `544 <https://www.python.org/dev/peps/pep-0544/>`__ if it +gets accepted). +Its main features are currently +- ``@typechecked`` decorator for runtime typechecking with support for `stubfiles <https://www.python.org/dev/peps/pep-0484/#stub-files>`__ and `type comments <https://www.python.org/dev/peps/pep-0484/#suggested-syntax-for-python-2-7-and-straddling-code>`__ +- ``@override`` decorator that asserts existence of a type-compatible parent method +- ``@annotations`` decorator to turn type info from stubfiles or from type comments into ``__annotations__`` +- ``@typelogged`` decorator observes function and method calls at runtime and generates stubfiles from acquired type info +- service functions to apply these decorators module wide or even globally, i.e. runtime wide +- typechecking can alternatively be done in decorator-free manner (friendlier for debuggers) +- all the above decorators work smoothly with OOP, i.e. with methods, static methods, class methods and properties, even if classes are nested +- converter for stubfiles to Python 2.7 compliant form +- lots of utility functions regarding types, e.g. a Python 2.7 compliant and actually functional implementation of ``get_type_hints`` +- full Python 2.7 support for all these features +An additional future goal will be integration with the Java typing system when running on Jython. Along with this, some generator utilities to produce type-safe Java bindings for Python frameworks are planned. +In wider sense, PEP 484-style type annotations can be used to build type safe interfaces to allow also other programming languages to call into Python code (kind of reverse FFI). In this sense the project name refers to 'ctypes', which provides Python-bindings of C. + +%prep +%autosetup -n pytypes-1.0b10 + +%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-pytypes -f filelist.lst +%dir %{python3_sitelib}/* + +%files help -f doclist.lst +%{_docdir}/* + +%changelog +* Wed Apr 12 2023 Python_Bot <Python_Bot@openeuler.org> - 1.0b10-1 +- Package Spec generated @@ -0,0 +1 @@ +1d2d29f58de5e1a0e8fcc290ae9bd07e pytypes-1.0b10.tar.gz |