summaryrefslogtreecommitdiff
path: root/python-otherstuf.spec
diff options
context:
space:
mode:
authorCoprDistGit <infra@openeuler.org>2023-05-10 07:27:02 +0000
committerCoprDistGit <infra@openeuler.org>2023-05-10 07:27:02 +0000
commit831bf33b7bf85e8164837ae36188ccd0f647ebaf (patch)
tree9f1a0e05ce02e8ffecdb0bc69589ae9efa8f0dda /python-otherstuf.spec
parent9fa25f55001dc13512f6d91a7fd9b0359a04482a (diff)
automatic import of python-otherstuf
Diffstat (limited to 'python-otherstuf.spec')
-rw-r--r--python-otherstuf.spec150
1 files changed, 150 insertions, 0 deletions
diff --git a/python-otherstuf.spec b/python-otherstuf.spec
new file mode 100644
index 0000000..d059ff8
--- /dev/null
+++ b/python-otherstuf.spec
@@ -0,0 +1,150 @@
+%global _empty_manifest_terminate_build 0
+Name: python-otherstuf
+Version: 1.1.0
+Release: 1
+Summary: Attributes-accessible mappings chainstuf (like ChainMap) & counterstuf (like Counter)
+License: Apache License 2.0
+URL: https://bitbucket.org/jeunice/otherstuf
+Source0: https://mirrors.nju.edu.cn/pypi/web/packages/4f/b5/fe92e1d92610449f001e04dd9bf7dc13b8e99e5ef8859d2da61a99fc8445/otherstuf-1.1.0.tar.gz
+BuildArch: noarch
+
+
+%description
+Use these just like you would ``ChainMap`` and ``Counter``, except that
+you get attribute-style access as well.
+For ``chainstuf``::
+ from otherstuf import chainstuf
+ d1 = dict(this=1, that=2)
+ d2 = dict(roger=99, that=100)
+ # test simple attribute equivalence
+ c = chainstuf(d1, d2)
+ assert c.this == 1
+ assert c.roger == 99
+ c.roger = 'wilco'
+ assert c.roger
+ print "roger", c.roger
+ d1.update(feeling='fancypants!')
+ print "i'm feeling", c.feeling # passed through, since d2 lacks 'feeling'
+Given recent versions (e.g. beyond 0.9.10) of ``stuf``, one could simply use
+``from stuf import chainstuf``. This portion of the ``otherstuf``
+sidecar is now superfluous.
+For ``counterstuf``::
+ from otherstuf import counterstuf
+ c = counterstuf()
+ c.update("this and this is this but that isn't this".split())
+ c.total = sum(c.values())
+ print "everything:", c.total
+ print "'this' mentioned", c.this, "times"
+ print "'bozo' mentioned", c.bozo, "times"
+ print c
+
+%package -n python3-otherstuf
+Summary: Attributes-accessible mappings chainstuf (like ChainMap) & counterstuf (like Counter)
+Provides: python-otherstuf
+BuildRequires: python3-devel
+BuildRequires: python3-setuptools
+BuildRequires: python3-pip
+%description -n python3-otherstuf
+Use these just like you would ``ChainMap`` and ``Counter``, except that
+you get attribute-style access as well.
+For ``chainstuf``::
+ from otherstuf import chainstuf
+ d1 = dict(this=1, that=2)
+ d2 = dict(roger=99, that=100)
+ # test simple attribute equivalence
+ c = chainstuf(d1, d2)
+ assert c.this == 1
+ assert c.roger == 99
+ c.roger = 'wilco'
+ assert c.roger
+ print "roger", c.roger
+ d1.update(feeling='fancypants!')
+ print "i'm feeling", c.feeling # passed through, since d2 lacks 'feeling'
+Given recent versions (e.g. beyond 0.9.10) of ``stuf``, one could simply use
+``from stuf import chainstuf``. This portion of the ``otherstuf``
+sidecar is now superfluous.
+For ``counterstuf``::
+ from otherstuf import counterstuf
+ c = counterstuf()
+ c.update("this and this is this but that isn't this".split())
+ c.total = sum(c.values())
+ print "everything:", c.total
+ print "'this' mentioned", c.this, "times"
+ print "'bozo' mentioned", c.bozo, "times"
+ print c
+
+%package help
+Summary: Development documents and examples for otherstuf
+Provides: python3-otherstuf-doc
+%description help
+Use these just like you would ``ChainMap`` and ``Counter``, except that
+you get attribute-style access as well.
+For ``chainstuf``::
+ from otherstuf import chainstuf
+ d1 = dict(this=1, that=2)
+ d2 = dict(roger=99, that=100)
+ # test simple attribute equivalence
+ c = chainstuf(d1, d2)
+ assert c.this == 1
+ assert c.roger == 99
+ c.roger = 'wilco'
+ assert c.roger
+ print "roger", c.roger
+ d1.update(feeling='fancypants!')
+ print "i'm feeling", c.feeling # passed through, since d2 lacks 'feeling'
+Given recent versions (e.g. beyond 0.9.10) of ``stuf``, one could simply use
+``from stuf import chainstuf``. This portion of the ``otherstuf``
+sidecar is now superfluous.
+For ``counterstuf``::
+ from otherstuf import counterstuf
+ c = counterstuf()
+ c.update("this and this is this but that isn't this".split())
+ c.total = sum(c.values())
+ print "everything:", c.total
+ print "'this' mentioned", c.this, "times"
+ print "'bozo' mentioned", c.bozo, "times"
+ print c
+
+%prep
+%autosetup -n otherstuf-1.1.0
+
+%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-otherstuf -f filelist.lst
+%dir %{python3_sitelib}/*
+
+%files help -f doclist.lst
+%{_docdir}/*
+
+%changelog
+* Wed May 10 2023 Python_Bot <Python_Bot@openeuler.org> - 1.1.0-1
+- Package Spec generated