diff options
Diffstat (limited to 'python-cql.spec')
-rw-r--r-- | python-cql.spec | 153 |
1 files changed, 153 insertions, 0 deletions
diff --git a/python-cql.spec b/python-cql.spec new file mode 100644 index 0000000..9754cdf --- /dev/null +++ b/python-cql.spec @@ -0,0 +1,153 @@ +%global _empty_manifest_terminate_build 0 +Name: python-cql +Version: 1.4.0 +Release: 1 +Summary: Cassandra Query Language driver +License: UNKNOWN +URL: http://code.google.com/a/apache-extras.org/p/cassandra-dbapi2 +Source0: https://mirrors.nju.edu.cn/pypi/web/packages/0b/15/523f6008d32f05dd3c6a2e7c2f21505f0a785b6dc8949cad325306858afc/cql-1.4.0.tar.gz +BuildArch: noarch + + +%description +A Python driver for CQL that adheres to py-dbapi v2 + (PEP249, Python Database API Specification v2.0: http://www.python.org/dev/peps/pep-0249/). + +Standard use: + >> import cql + >> con = cql.connect(host, port, keyspace) + >> cursor = con.cursor() + >> cursor.execute("CQL QUERY", dict(kw='Foo', kw2='Bar, etc...)) + + - cursor.description # None initially, list of N tuples that represent + the N columns in a row after an execute. Only + contains type and name info, not values. + - cursor.rowcount # -1 initially, N after an execute + - cursor.arraysize # variable size of a fetchmany call + - cursor.fetchone() # returns a single row + - cursor.fetchmany() # returns self.arraysize # of rows + - cursor.fetchall() # returns all rows, don't do this. + + >> cursor.execute("ANOTHER QUERY", **more_kwargs) + >> for row in cursor: # Iteration is equivalent to lots of fetchone() calls + >> doRowMagic(row) + + >> cursor.close() + >> con.close() + +Query substitution: + - Use named parameters and a dictionary of names and values. + e.g. execute("SELECT * FROM CF WHERE name=:name", {"name": "Foo"}) + +%package -n python3-cql +Summary: Cassandra Query Language driver +Provides: python-cql +BuildRequires: python3-devel +BuildRequires: python3-setuptools +BuildRequires: python3-pip +%description -n python3-cql +A Python driver for CQL that adheres to py-dbapi v2 + (PEP249, Python Database API Specification v2.0: http://www.python.org/dev/peps/pep-0249/). + +Standard use: + >> import cql + >> con = cql.connect(host, port, keyspace) + >> cursor = con.cursor() + >> cursor.execute("CQL QUERY", dict(kw='Foo', kw2='Bar, etc...)) + + - cursor.description # None initially, list of N tuples that represent + the N columns in a row after an execute. Only + contains type and name info, not values. + - cursor.rowcount # -1 initially, N after an execute + - cursor.arraysize # variable size of a fetchmany call + - cursor.fetchone() # returns a single row + - cursor.fetchmany() # returns self.arraysize # of rows + - cursor.fetchall() # returns all rows, don't do this. + + >> cursor.execute("ANOTHER QUERY", **more_kwargs) + >> for row in cursor: # Iteration is equivalent to lots of fetchone() calls + >> doRowMagic(row) + + >> cursor.close() + >> con.close() + +Query substitution: + - Use named parameters and a dictionary of names and values. + e.g. execute("SELECT * FROM CF WHERE name=:name", {"name": "Foo"}) + +%package help +Summary: Development documents and examples for cql +Provides: python3-cql-doc +%description help +A Python driver for CQL that adheres to py-dbapi v2 + (PEP249, Python Database API Specification v2.0: http://www.python.org/dev/peps/pep-0249/). + +Standard use: + >> import cql + >> con = cql.connect(host, port, keyspace) + >> cursor = con.cursor() + >> cursor.execute("CQL QUERY", dict(kw='Foo', kw2='Bar, etc...)) + + - cursor.description # None initially, list of N tuples that represent + the N columns in a row after an execute. Only + contains type and name info, not values. + - cursor.rowcount # -1 initially, N after an execute + - cursor.arraysize # variable size of a fetchmany call + - cursor.fetchone() # returns a single row + - cursor.fetchmany() # returns self.arraysize # of rows + - cursor.fetchall() # returns all rows, don't do this. + + >> cursor.execute("ANOTHER QUERY", **more_kwargs) + >> for row in cursor: # Iteration is equivalent to lots of fetchone() calls + >> doRowMagic(row) + + >> cursor.close() + >> con.close() + +Query substitution: + - Use named parameters and a dictionary of names and values. + e.g. execute("SELECT * FROM CF WHERE name=:name", {"name": "Foo"}) + +%prep +%autosetup -n cql-1.4.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-cql -f filelist.lst +%dir %{python3_sitelib}/* + +%files help -f doclist.lst +%{_docdir}/* + +%changelog +* Tue Apr 11 2023 Python_Bot <Python_Bot@openeuler.org> - 1.4.0-1 +- Package Spec generated |