[python-sqlamp] Initial import

Martin Bacovsky mbacovsk at fedoraproject.org
Thu Apr 14 11:43:18 UTC 2011


commit 3d5110a7c5872284ed8082317d21ee5338994d51
Author: Martin Bačovský <mbacovsk at redhat.com>
Date:   Thu Apr 14 13:43:02 2011 +0200

    Initial import

 .gitignore                        |    1 +
 python-sqlamp.spec                |   75 +++++++++++++++++++++++++++++++++++++
 sa0.6.6.patch                     |   24 ++++++++++++
 sources                           |    1 +
 sqlite-3.6.x-bug-workaround.patch |   38 +++++++++++++++++++
 5 files changed, 139 insertions(+), 0 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index e69de29..7a62296 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1 @@
+/sqlamp-0.5.2.tar.gz
diff --git a/python-sqlamp.spec b/python-sqlamp.spec
new file mode 100644
index 0000000..65decd6
--- /dev/null
+++ b/python-sqlamp.spec
@@ -0,0 +1,75 @@
+%if ! (0%{?fedora} > 12 || 0%{?rhel} > 5)
+%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
+%endif
+
+Name:           python-sqlamp
+Version:        0.5.2
+Release:        2%{?dist}
+Summary:        Library for working with hierarchical data structures using SQLAlchemy
+
+Group:          Development/Languages
+License:        BSD
+URL:            http://sqlamp.angri.ru/
+Source0:        http://sqlamp.angri.ru/sqlamp-%{version}.tar.gz
+Patch0:         sa0.6.6.patch
+Patch1:         sqlite-3.6.x-bug-workaround.patch
+BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
+BuildArch:      noarch
+
+BuildRequires: python-devel
+BuildRequires: python-setuptools-devel
+BuildRequires: python-sqlalchemy
+BuildRequires: python-nose
+BuildRequires: python-sphinx
+
+Requires: python-sqlalchemy >= 0.5
+
+%description
+sqlamp is an implementation of an efficient algorithm for working
+with hierarchical data structures. sqlamp uses (and depends on) SQLAlchemy.
+
+%prep
+%setup -q -n sqlamp-%{version}
+%patch0 -p1
+%patch1 -p1
+
+%build
+%{__python} setup.py build
+
+# generate docs
+pushd doc
+PYTHONPATH=../build/lib:$PYTHONPATH make html
+rm _build/html/objects.inv
+rm -rf _build/doctrees 
+rm _build/html/.buildinfo 
+popd
+
+%install
+rm -rf %{buildroot}
+%{__python} setup.py install --skip-build --root %{buildroot}
+
+
+%check
+DB_URI="sqlite:///:memory:" %{__python} setup.py test
+
+
+%clean
+rm -rf %{buildroot}
+
+
+%files
+%defattr(-,root,root,-)
+%doc doc/_build/html
+%doc LICENSE
+
+%{python_sitelib}/sqlamp/
+%{python_sitelib}/sqlamp*.egg-info/
+
+
+%changelog
+* Mon Mar 28 2011 Martin Bacovsky <mbacovsk at redhat.com> - 0.5.2-2
+- Fixed support of SQLAlchemy 0.6.6 in MPOptions.order_by_clause(). Patch by Josip Delic.
+- Workaround for bug in sqlite 3.6.x (problems with binding two integer attributes). Initial patch by Josip Delic.
+
+* Tue Dec 14 2010 Martin Bacovsky <mbacovsk at redhat.com> - 0.5.2-1
+- Initial package
diff --git a/sa0.6.6.patch b/sa0.6.6.patch
new file mode 100644
index 0000000..1498194
--- /dev/null
+++ b/sa0.6.6.patch
@@ -0,0 +1,24 @@
+diff -r 131308c390ec -r 2b546fe97248 CHANGES
+--- a/CHANGES	Sun Sep 19 18:22:03 2010 +0400
++++ b/CHANGES	Sun Jan 23 21:39:40 2011 +0300
+@@ -1,3 +1,8 @@
++0.5.3: *not released yet*
++-------------------------
++- Fixed support of SQLAlchemy 0.6.6 in :meth:`MPOptions.order_by_clause`.
++  Patch by Josip Delic.
++
+ 0.5.2: released 2010-09-19
+ --------------------------
+ - SQLAlchemy of versions 0.6.x is now supported as well as 0.5.x.
+diff -r 131308c390ec -r 2b546fe97248 sqlamp/__init__.py
+--- a/sqlamp/__init__.py	Sun Sep 19 18:22:03 2010 +0400
++++ b/sqlamp/__init__.py	Sun Jan 23 21:39:40 2011 +0300
+@@ -206,7 +206,7 @@
+         return sqlalchemy.sql.expression.ClauseList(
+             self.tree_id_field,
+             self.path_field
+-        )
++        ).compile()
+ 
+ 
+ class _InsertionsParamsSelector(object):
diff --git a/sources b/sources
index e69de29..3fbc66d 100644
--- a/sources
+++ b/sources
@@ -0,0 +1 @@
+83cf1611cbce24fa9e2ee679e8fa59fb  sqlamp-0.5.2.tar.gz
diff --git a/sqlite-3.6.x-bug-workaround.patch b/sqlite-3.6.x-bug-workaround.patch
new file mode 100644
index 0000000..2955cad
--- /dev/null
+++ b/sqlite-3.6.x-bug-workaround.patch
@@ -0,0 +1,38 @@
+diff -r 7beb2c6cf64b -r 964320ab0ff5 CHANGES
+--- a/CHANGES	Mon Jan 24 00:24:03 2011 +0300
++++ b/CHANGES	Tue Feb 15 21:57:02 2011 +0100
+@@ -2,6 +2,8 @@
+ -------------------------
+ - Fixed support of SQLAlchemy 0.6.6 in :meth:`MPOptions.order_by_clause`.
+   Patch by Josip Delic.
++- Workaround for bug in sqlite 3.6.x (problems with binding two integer
++  attributes). Initial patch by Josip Delic.
+ 
+ 0.5.2: released 2010-09-19
+ --------------------------
+diff -r 7beb2c6cf64b -r 964320ab0ff5 sqlamp/__init__.py
+--- a/sqlamp/__init__.py	Mon Jan 24 00:24:03 2011 +0300
++++ b/sqlamp/__init__.py	Tue Feb 15 21:57:02 2011 +0100
+@@ -237,14 +237,14 @@
+             # `tree_id` is next unused integer value,
+             # `depth` for root nodes is equal to zero,
+             # `path` should be empty string.
+-            query = self.session.execute(sqlalchemy.select([
+-                (sqlalchemy.func.coalesce(
+-                    sqlalchemy.func.max(opts.tree_id_field), 0)
+-                 + 1).label('tree_id')
+-            ])).fetchone()
+-            self._query_result = dict(
+-                path='', depth=0, tree_id=query['tree_id']
+-            )
++            [tree_id] = self.session.execute(
++                sqlalchemy.func.max(opts.tree_id_field)
++            ).fetchone()
++            if tree_id is None:
++                tree_id = 1
++            else:
++                tree_id += 1
++            self._query_result = dict(path='', depth=0, tree_id=tree_id)
+         else:
+             # a new instance has at least one ancestor.
+             # `tree_id` can be used from parent's value,


More information about the scm-commits mailing list