diff options
author | CoprDistGit <infra@openeuler.org> | 2023-06-20 07:59:25 +0000 |
---|---|---|
committer | CoprDistGit <infra@openeuler.org> | 2023-06-20 07:59:25 +0000 |
commit | c4d788874182e8d65657e2252e8b4bfd9a524b65 (patch) | |
tree | 5da626699660c11c9995027e2ad0260fc21fb52e | |
parent | 63e5549092dee1ec957633ae15a1af4a3bfc0e94 (diff) |
automatic import of python-annotypesopeneuler20.03
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | python-annotypes.spec | 165 | ||||
-rw-r--r-- | sources | 1 |
3 files changed, 167 insertions, 0 deletions
@@ -0,0 +1 @@ +/annotypes-0.21.tar.gz diff --git a/python-annotypes.spec b/python-annotypes.spec new file mode 100644 index 0000000..c926c45 --- /dev/null +++ b/python-annotypes.spec @@ -0,0 +1,165 @@ +%global _empty_manifest_terminate_build 0 +Name: python-annotypes +Version: 0.21 +Release: 1 +Summary: Annotating type hints and comments with extra metatdata +License: APACHE +URL: https://github.com/dls-controls/annotypes +Source0: https://mirrors.aliyun.com/pypi/web/packages/16/c5/1113740fa4c1279d34b756002ca0ec8e138f4a360a8fcf78abff88cc19e5/annotypes-0.21.tar.gz +BuildArch: noarch + + +%description +|build_status| |coverage| |pypi_version| +Adding annotations to Python types while still being compatible with mypy_ and PyCharm_ +You can write things like: + from annotypes import Anno, WithCallTypes + with Anno("The exposure time for the camera"): + AExposure = float + with Anno("The full path to the text file to write"): + APath = str + class Simple(WithCallTypes): + def __init__(self, exposure, path="/tmp/file.txt"): + # type: (AExposure, APath) -> None + self.exposure = exposure + self.path = path +or the Python3 alternative: + from annotypes import Anno, WithCallTypes + with Anno("The exposure time for the camera"): + AExposure = float + with Anno("The full path to the text file to write"): + APath = str + class Simple(WithCallTypes): + def __init__(self, exposure: AExposure, path: APath = "/tmp/file.txt"): + self.exposure = exposure + self.path = path +And at runtime see what you should pass to call it and what it will return: + >>> from annotypes.py2_examples.simple import Simple + >>> list(Simple.call_types) + ['exposure', 'path'] + >>> Simple.call_types['exposure'] + Anno(name='AExposure', typ=<type 'float'>, description='The exposure time for the camera') + >>> Simple.return_type + Anno(name='Instance', typ=<class 'annotypes.py2_examples.simple.Simple'>, description='Class instance') +For more examples see the `Python 2 examples`_ or `Python 3 examples`_. + +%package -n python3-annotypes +Summary: Annotating type hints and comments with extra metatdata +Provides: python-annotypes +BuildRequires: python3-devel +BuildRequires: python3-setuptools +BuildRequires: python3-pip +%description -n python3-annotypes +|build_status| |coverage| |pypi_version| +Adding annotations to Python types while still being compatible with mypy_ and PyCharm_ +You can write things like: + from annotypes import Anno, WithCallTypes + with Anno("The exposure time for the camera"): + AExposure = float + with Anno("The full path to the text file to write"): + APath = str + class Simple(WithCallTypes): + def __init__(self, exposure, path="/tmp/file.txt"): + # type: (AExposure, APath) -> None + self.exposure = exposure + self.path = path +or the Python3 alternative: + from annotypes import Anno, WithCallTypes + with Anno("The exposure time for the camera"): + AExposure = float + with Anno("The full path to the text file to write"): + APath = str + class Simple(WithCallTypes): + def __init__(self, exposure: AExposure, path: APath = "/tmp/file.txt"): + self.exposure = exposure + self.path = path +And at runtime see what you should pass to call it and what it will return: + >>> from annotypes.py2_examples.simple import Simple + >>> list(Simple.call_types) + ['exposure', 'path'] + >>> Simple.call_types['exposure'] + Anno(name='AExposure', typ=<type 'float'>, description='The exposure time for the camera') + >>> Simple.return_type + Anno(name='Instance', typ=<class 'annotypes.py2_examples.simple.Simple'>, description='Class instance') +For more examples see the `Python 2 examples`_ or `Python 3 examples`_. + +%package help +Summary: Development documents and examples for annotypes +Provides: python3-annotypes-doc +%description help +|build_status| |coverage| |pypi_version| +Adding annotations to Python types while still being compatible with mypy_ and PyCharm_ +You can write things like: + from annotypes import Anno, WithCallTypes + with Anno("The exposure time for the camera"): + AExposure = float + with Anno("The full path to the text file to write"): + APath = str + class Simple(WithCallTypes): + def __init__(self, exposure, path="/tmp/file.txt"): + # type: (AExposure, APath) -> None + self.exposure = exposure + self.path = path +or the Python3 alternative: + from annotypes import Anno, WithCallTypes + with Anno("The exposure time for the camera"): + AExposure = float + with Anno("The full path to the text file to write"): + APath = str + class Simple(WithCallTypes): + def __init__(self, exposure: AExposure, path: APath = "/tmp/file.txt"): + self.exposure = exposure + self.path = path +And at runtime see what you should pass to call it and what it will return: + >>> from annotypes.py2_examples.simple import Simple + >>> list(Simple.call_types) + ['exposure', 'path'] + >>> Simple.call_types['exposure'] + Anno(name='AExposure', typ=<type 'float'>, description='The exposure time for the camera') + >>> Simple.return_type + Anno(name='Instance', typ=<class 'annotypes.py2_examples.simple.Simple'>, description='Class instance') +For more examples see the `Python 2 examples`_ or `Python 3 examples`_. + +%prep +%autosetup -n annotypes-0.21 + +%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-annotypes -f filelist.lst +%dir %{python3_sitelib}/* + +%files help -f doclist.lst +%{_docdir}/* + +%changelog +* Tue Jun 20 2023 Python_Bot <Python_Bot@openeuler.org> - 0.21-1 +- Package Spec generated @@ -0,0 +1 @@ +497b6853fcc2e218f719dcc824c6e351 annotypes-0.21.tar.gz |