summaryrefslogtreecommitdiff
path: root/python-tinydb.spec
diff options
context:
space:
mode:
Diffstat (limited to 'python-tinydb.spec')
-rw-r--r--python-tinydb.spec115
1 files changed, 115 insertions, 0 deletions
diff --git a/python-tinydb.spec b/python-tinydb.spec
new file mode 100644
index 0000000..47a2a53
--- /dev/null
+++ b/python-tinydb.spec
@@ -0,0 +1,115 @@
+%global _empty_manifest_terminate_build 0
+Name: python-tinydb
+Version: 4.7.1
+Release: 1
+Summary: TinyDB is a tiny, document oriented database optimized for your happiness :)
+License: MIT
+URL: https://github.com/msiemens/tinydb
+Source0: https://mirrors.nju.edu.cn/pypi/web/packages/32/ed/78f24df0fec08f0fb92fc4b4758adcab780660caa8c3f94c2e175eb7e2ba/tinydb-4.7.1.tar.gz
+BuildArch: noarch
+
+Requires: python3-typing-extensions
+
+%description
+ >>> User = Query()
+ >>> # Search for a field value
+ >>> db.search(User.name == 'John')
+ [{'name': 'John', 'age': 22}, {'name': 'John', 'age': 37}]
+ >>> # Combine two queries with logical and
+ >>> db.search((User.name == 'John') & (User.age <= 30))
+ [{'name': 'John', 'age': 22}]
+ >>> # Combine two queries with logical or
+ >>> db.search((User.name == 'John') | (User.name == 'Bob'))
+ [{'name': 'John', 'age': 22}, {'name': 'John', 'age': 37}, {'name': 'Bob', 'age': 42}]
+ >>> # Apply transformation to field with `map`
+ >>> db.search((User.age.map(lambda x: x + x) == 44))
+ >>> [{'name': 'John', 'age': 22}]
+ >>> # More possible comparisons: != < > <= >=
+ >>> # More possible checks: where(...).matches(regex), where(...).test(your_test_func)
+
+%package -n python3-tinydb
+Summary: TinyDB is a tiny, document oriented database optimized for your happiness :)
+Provides: python-tinydb
+BuildRequires: python3-devel
+BuildRequires: python3-setuptools
+BuildRequires: python3-pip
+%description -n python3-tinydb
+ >>> User = Query()
+ >>> # Search for a field value
+ >>> db.search(User.name == 'John')
+ [{'name': 'John', 'age': 22}, {'name': 'John', 'age': 37}]
+ >>> # Combine two queries with logical and
+ >>> db.search((User.name == 'John') & (User.age <= 30))
+ [{'name': 'John', 'age': 22}]
+ >>> # Combine two queries with logical or
+ >>> db.search((User.name == 'John') | (User.name == 'Bob'))
+ [{'name': 'John', 'age': 22}, {'name': 'John', 'age': 37}, {'name': 'Bob', 'age': 42}]
+ >>> # Apply transformation to field with `map`
+ >>> db.search((User.age.map(lambda x: x + x) == 44))
+ >>> [{'name': 'John', 'age': 22}]
+ >>> # More possible comparisons: != < > <= >=
+ >>> # More possible checks: where(...).matches(regex), where(...).test(your_test_func)
+
+%package help
+Summary: Development documents and examples for tinydb
+Provides: python3-tinydb-doc
+%description help
+ >>> User = Query()
+ >>> # Search for a field value
+ >>> db.search(User.name == 'John')
+ [{'name': 'John', 'age': 22}, {'name': 'John', 'age': 37}]
+ >>> # Combine two queries with logical and
+ >>> db.search((User.name == 'John') & (User.age <= 30))
+ [{'name': 'John', 'age': 22}]
+ >>> # Combine two queries with logical or
+ >>> db.search((User.name == 'John') | (User.name == 'Bob'))
+ [{'name': 'John', 'age': 22}, {'name': 'John', 'age': 37}, {'name': 'Bob', 'age': 42}]
+ >>> # Apply transformation to field with `map`
+ >>> db.search((User.age.map(lambda x: x + x) == 44))
+ >>> [{'name': 'John', 'age': 22}]
+ >>> # More possible comparisons: != < > <= >=
+ >>> # More possible checks: where(...).matches(regex), where(...).test(your_test_func)
+
+%prep
+%autosetup -n tinydb-4.7.1
+
+%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-tinydb -f filelist.lst
+%dir %{python3_sitelib}/*
+
+%files help -f doclist.lst
+%{_docdir}/*
+
+%changelog
+* Thu Mar 09 2023 Python_Bot <Python_Bot@openeuler.org> - 4.7.1-1
+- Package Spec generated