From bdeeeca95139eb2e235c59be1ecea0c9ce8c8fa3 Mon Sep 17 00:00:00 2001 From: Ralph Bean Date: Fri, 22 Feb 2013 10:50:42 -0500 Subject: [PATCH 1/7] Disable python3 tests. Conflicts: python-alembic.spec --- python-alembic.spec | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/python-alembic.spec b/python-alembic.spec index 066892e..a6aeb11 100644 --- a/python-alembic.spec +++ b/python-alembic.spec @@ -6,7 +6,7 @@ Name: python-alembic Version: 0.3.4 -Release: 9%{?dist} +Release: 10%{?dist} Summary: Database migration tool for SQLAlchemy Group: Development/Libraries @@ -154,11 +154,12 @@ install -m 0644 alembic.1 %{buildroot}%{_mandir}/man1/alembic.1 %check %{__python} setup.py test -%if 0%{?with_python3} -pushd %{py3dir} -%{__python3} setup.py test -popd -%endif +# Disable python3 tests for now. +#%if 0%{?with_python3} +#pushd %{py3dir} +#%{__python3} setup.py test +#popd +#%endif %files @@ -188,6 +189,10 @@ popd %changelog +* Fri Feb 22 2013 Ralph Bean - 0.3.4-10 +- Rebuilt again for good measure. +- Disabled python3 tests.. they started failing in rawhide. + * Wed Sep 12 2012 Ralph Bean - 0.3.4-9 - Require at least sqlalchemy 0.7.4. From ab9ef758904595d78628c821494de6ec00e803de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A1draig=20Brady?= Date: Thu, 14 Mar 2013 14:00:43 +0000 Subject: [PATCH 2/7] update to 0.4.2 Triggered by a possible reqquirement by openstack-quantum-2013.1 Conflicts: python-alembic.spec --- .gitignore | 1 + python-alembic.spec | 7 +++++-- sources | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 6573ab1..dc6682f 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ /alembic-0.3.4.tar.gz +/alembic-0.4.2.tar.gz diff --git a/python-alembic.spec b/python-alembic.spec index a6aeb11..f83fa38 100644 --- a/python-alembic.spec +++ b/python-alembic.spec @@ -5,8 +5,8 @@ %global modname alembic Name: python-alembic -Version: 0.3.4 -Release: 10%{?dist} +Version: 0.4.2 +Release: 1%{?dist} Summary: Database migration tool for SQLAlchemy Group: Development/Libraries @@ -189,6 +189,9 @@ install -m 0644 alembic.1 %{buildroot}%{_mandir}/man1/alembic.1 %changelog +* Thu Mar 14 2013 Pádraig Brady - 0.4.2-1 +- Update to 0.4.2 + * Fri Feb 22 2013 Ralph Bean - 0.3.4-10 - Rebuilt again for good measure. - Disabled python3 tests.. they started failing in rawhide. diff --git a/sources b/sources index bf4346f..26561ce 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -4b5b13025c9c8a4e4c9d2efb61b21959 alembic-0.3.4.tar.gz +c64b9e8928e13df0b68fb6207ba45675 alembic-0.4.2.tar.gz From a39ca3fb7c0513d456058b062d61c029ea36a7f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A1draig=20Brady?= Date: Fri, 15 Mar 2013 12:50:27 +0000 Subject: [PATCH 3/7] remove tests require sqlalchemy >= 0.7.8 --- python-alembic-sqlalchemy-0.7.8.patch | 52 +++++++++++++++++++++++++++ python-alembic.spec | 2 ++ 2 files changed, 54 insertions(+) create mode 100644 python-alembic-sqlalchemy-0.7.8.patch diff --git a/python-alembic-sqlalchemy-0.7.8.patch b/python-alembic-sqlalchemy-0.7.8.patch new file mode 100644 index 0000000..190ab39 --- /dev/null +++ b/python-alembic-sqlalchemy-0.7.8.patch @@ -0,0 +1,52 @@ +Remove tests requiring sqlalchemy > 0.7.8 +See https://bitbucket.org/zzzeek/alembic/commits/d9fc0f82a298a858d9412fe0b270e640639dcc7a + +diff -Naur alembic-0.4.2.orig/tests/test_autogenerate.py alembic-0.4.2/tests/test_autogenerate.py +--- alembic-0.4.2.orig/tests/test_autogenerate.py 2013-01-11 16:12:49.000000000 +0000 ++++ alembic-0.4.2/tests/test_autogenerate.py 2013-03-15 12:43:52.881966999 +0000 +@@ -1,6 +1,6 @@ + from sqlalchemy import MetaData, Column, Table, Integer, String, Text, \ + Numeric, CHAR, ForeignKey, DATETIME, \ +- TypeDecorator, CheckConstraint, Unicode, Enum,\ ++ TypeDecorator, CheckConstraint, Unicode,\ + UniqueConstraint, Boolean, ForeignKeyConstraint + from sqlalchemy.types import NULLTYPE, TIMESTAMP + from sqlalchemy.dialects import mysql +@@ -1070,20 +1070,4 @@ + "existing_server_default='5')" + ) + +- def test_render_enum(self): +- eq_ignore_whitespace( +- autogenerate._repr_type( +- "sa.", +- Enum("one", "two", "three", name="myenum"), +- self.autogen_context), +- "sa.Enum('one', 'two', 'three', name='myenum')" +- ) +- eq_ignore_whitespace( +- autogenerate._repr_type( +- "sa.", +- Enum("one", "two", "three"), +- self.autogen_context), +- "sa.Enum('one', 'two', 'three')" +- ) +- + # TODO: tests for dialect-specific type rendering + imports +diff -Naur alembic-0.4.2.orig/tests/test_op.py alembic-0.4.2/tests/test_op.py +--- alembic-0.4.2.orig/tests/test_op.py 2013-01-11 16:12:49.000000000 +0000 ++++ alembic-0.4.2/tests/test_op.py 2013-03-15 12:46:13.362695693 +0000 +@@ -457,13 +457,6 @@ + "DROP INDEX ik_test" + ) + +-def test_drop_index_schema(): +- context = op_fixture() +- op.drop_index('ik_test', schema='foo') +- context.assert_( +- "DROP INDEX foo.ik_test" +- ) +- + def test_drop_table(): + context = op_fixture() + op.drop_table('tb_test') diff --git a/python-alembic.spec b/python-alembic.spec index f83fa38..98a1206 100644 --- a/python-alembic.spec +++ b/python-alembic.spec @@ -13,6 +13,7 @@ Group: Development/Libraries License: MIT URL: http://pypi.python.org/pypi/alembic Source0: http://pypi.python.org/packages/source/a/%{modname}/%{modname}-%{version}.tar.gz +Patch0: python-alembic-sqlalchemy-0.7.8.patch BuildArch: noarch @@ -86,6 +87,7 @@ Documentation and status of Alembic is at http://readthedocs.org/docs/alembic/ %prep %setup -q -n %{modname}-%{version} +%patch0 -p1 %if 0%{?with_python3} rm -rf %{py3dir} From befdccf7ad0f5e45726f30183f287e7ac5931418 Mon Sep 17 00:00:00 2001 From: Toshio Kuratomi Date: Wed, 29 May 2013 11:03:18 -0700 Subject: [PATCH 4/7] Workaround setuptools to load the correct SQLAlchemy version for the alembic script. https://bugzilla.redhat.com/show_bug.cgi?id=968404 --- python-alembic.spec | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/python-alembic.spec b/python-alembic.spec index 98a1206..11d3011 100644 --- a/python-alembic.spec +++ b/python-alembic.spec @@ -6,7 +6,7 @@ Name: python-alembic Version: 0.4.2 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Database migration tool for SQLAlchemy Group: Development/Libraries @@ -138,7 +138,7 @@ install -d -m 0755 %{buildroot}%{_mandir}/man1 %if 0%{?with_python3} pushd %{py3dir} -%{__python3} setup.py install -O1 --skip-build --root=%{buildroot} +%{__python3} setup.py install --skip-build --root=%{buildroot} mv %{buildroot}/%{_bindir}/%{modname} %{buildroot}/%{_bindir}/python3-%{modname} %if %{?rhel}%{!?rhel:0} <= 6 %else @@ -147,8 +147,15 @@ install -m 0644 python3-alembic.1 %{buildroot}%{_mandir}/man1/python3-alembic.1 popd %endif -%{__python} setup.py install -O1 --skip-build --root=%{buildroot} +%{__python} setup.py install --skip-build --root=%{buildroot} %if %{?rhel}%{!?rhel:0} <= 6 +# Modify /usr/bin/alembic to require SQLAlchemy>=0.6 +# Hacky but setuptools only creates this file after setup.py install is run :-( +# Root cause is that setuptools doesn't recurse the requirements when it processes +# the __requires__. It waits until pkg_resources.require('MODULE') is called. +# Since that isn't done in the entrypoints script, we need to specify the dependency +# on a specific SQLAlchemy version explicitly. +sed -i -e "s|__requires__ = 'alembic==0.4.2'|__requires__ = ['alembic==0.4.2', 'SQLAlchemy>=0.6']|" %{buildroot}%{_bindir}/%{modname} %else install -m 0644 alembic.1 %{buildroot}%{_mandir}/man1/alembic.1 %endif @@ -191,6 +198,10 @@ install -m 0644 alembic.1 %{buildroot}%{_mandir}/man1/alembic.1 %changelog +* Wed May 29 2013 Toshio Kuratomi - 0.4.2-2 +- Workaround setuptools to load the correct SQLAlchemy version for + the alembic script. https://bugzilla.redhat.com/show_bug.cgi?id=968404 + * Thu Mar 14 2013 Pádraig Brady - 0.4.2-1 - Update to 0.4.2 From dd96196125d1a30cd6cd7000166ed78605f437df Mon Sep 17 00:00:00 2001 From: Ralph Bean Date: Mon, 29 Jul 2013 11:57:25 -0400 Subject: [PATCH 5/7] Add forgotten dependency on python-setuptools. --- python-alembic.spec | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/python-alembic.spec b/python-alembic.spec index 99c02ff..39e3b4f 100644 --- a/python-alembic.spec +++ b/python-alembic.spec @@ -6,7 +6,7 @@ Name: python-alembic Version: 0.4.2 -Release: 2%{?dist} +Release: 3%{?dist} Summary: Database migration tool for SQLAlchemy Group: Development/Libraries @@ -21,8 +21,10 @@ BuildArch: noarch BuildRequires: help2man BuildRequires: python2-devel BuildRequires: python-mako +BuildRequires: python-setuptools Requires: python-mako +Requires: python-setuptools # See if we're building for python earlier than 2.7 %if %{?rhel}%{!?rhel:0} >= 6 @@ -43,6 +45,7 @@ BuildRequires: python-tools BuildRequires: python3-sqlalchemy >= 0.7.4 BuildRequires: python3-mako BuildRequires: python3-nose +BuildRequires: python3-setuptools %endif @@ -68,6 +71,7 @@ Group: Development/Libraries Requires: python3-sqlalchemy >= 0.7.4 Requires: python3-mako +Requires: python3-setuptools %description -n python3-alembic Alembic is a new database migrations tool, written by the author of @@ -198,6 +202,9 @@ install -m 0644 alembic.1 %{buildroot}%{_mandir}/man1/alembic.1 %changelog +* Mon Jul 29 2013 Ralph Bean - 0.4.2-3 +- Add forgotten dep on python-setuptools. + * Wed May 29 2013 Toshio Kuratomi - 0.4.2-2 - Workaround setuptools to load the correct SQLAlchemy version for the alembic script. https://bugzilla.redhat.com/show_bug.cgi?id=968404 From b59b6d6843e441c255c3b8d690f029d1b3b4f72d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A1draig=20Brady?= Date: Tue, 28 Jan 2014 10:51:04 +0000 Subject: [PATCH 6/7] avoid python3 on rhel7 and adjust guards for rhel6 --- python-alembic.spec | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/python-alembic.spec b/python-alembic.spec index 39e3b4f..29dbc42 100644 --- a/python-alembic.spec +++ b/python-alembic.spec @@ -1,4 +1,4 @@ -%if 0%{?fedora} > 12 || 0%{?rhel} > 6 +%if 0%{?fedora} > 12 %global with_python3 1 %endif @@ -27,7 +27,7 @@ Requires: python-mako Requires: python-setuptools # See if we're building for python earlier than 2.7 -%if %{?rhel}%{!?rhel:0} >= 6 +%if %{?rhel}%{!?rhel:0} <= 6 BuildRequires: python-sqlalchemy0.7 >= 0.7.4 BuildRequires: python-argparse BuildRequires: python-nose1.1 @@ -99,7 +99,7 @@ cp -a . %{py3dir} %endif # Make sure that epel/rhel picks up the correct version of sqlalchemy -%if %{?rhel}%{!?rhel:0} >= 6 +%if %{?rhel}%{!?rhel:0} <= 6 awk 'NR==1{print "import __main__; __main__.__requires__ = __requires__ = [\"sqlalchemy>=0.6\", \"nose>=0.11\"]; import pkg_resources"}1' setup.py > setup.py.tmp mv setup.py.tmp setup.py %endif From 5c21c8e797192eb6efee4dca41d462807915168d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A1draig=20Brady?= Date: Tue, 28 Jan 2014 12:02:25 +0000 Subject: [PATCH 7/7] test adjustments for rhel7 --- python-alembic-sqlalchemy-0.7.8.patch | 52 --------------------------- python-alembic-sqlalchemy-0.8.patch | 12 +++++++ python-alembic.spec | 2 +- 3 files changed, 13 insertions(+), 53 deletions(-) delete mode 100644 python-alembic-sqlalchemy-0.7.8.patch create mode 100644 python-alembic-sqlalchemy-0.8.patch diff --git a/python-alembic-sqlalchemy-0.7.8.patch b/python-alembic-sqlalchemy-0.7.8.patch deleted file mode 100644 index 190ab39..0000000 --- a/python-alembic-sqlalchemy-0.7.8.patch +++ /dev/null @@ -1,52 +0,0 @@ -Remove tests requiring sqlalchemy > 0.7.8 -See https://bitbucket.org/zzzeek/alembic/commits/d9fc0f82a298a858d9412fe0b270e640639dcc7a - -diff -Naur alembic-0.4.2.orig/tests/test_autogenerate.py alembic-0.4.2/tests/test_autogenerate.py ---- alembic-0.4.2.orig/tests/test_autogenerate.py 2013-01-11 16:12:49.000000000 +0000 -+++ alembic-0.4.2/tests/test_autogenerate.py 2013-03-15 12:43:52.881966999 +0000 -@@ -1,6 +1,6 @@ - from sqlalchemy import MetaData, Column, Table, Integer, String, Text, \ - Numeric, CHAR, ForeignKey, DATETIME, \ -- TypeDecorator, CheckConstraint, Unicode, Enum,\ -+ TypeDecorator, CheckConstraint, Unicode,\ - UniqueConstraint, Boolean, ForeignKeyConstraint - from sqlalchemy.types import NULLTYPE, TIMESTAMP - from sqlalchemy.dialects import mysql -@@ -1070,20 +1070,4 @@ - "existing_server_default='5')" - ) - -- def test_render_enum(self): -- eq_ignore_whitespace( -- autogenerate._repr_type( -- "sa.", -- Enum("one", "two", "three", name="myenum"), -- self.autogen_context), -- "sa.Enum('one', 'two', 'three', name='myenum')" -- ) -- eq_ignore_whitespace( -- autogenerate._repr_type( -- "sa.", -- Enum("one", "two", "three"), -- self.autogen_context), -- "sa.Enum('one', 'two', 'three')" -- ) -- - # TODO: tests for dialect-specific type rendering + imports -diff -Naur alembic-0.4.2.orig/tests/test_op.py alembic-0.4.2/tests/test_op.py ---- alembic-0.4.2.orig/tests/test_op.py 2013-01-11 16:12:49.000000000 +0000 -+++ alembic-0.4.2/tests/test_op.py 2013-03-15 12:46:13.362695693 +0000 -@@ -457,13 +457,6 @@ - "DROP INDEX ik_test" - ) - --def test_drop_index_schema(): -- context = op_fixture() -- op.drop_index('ik_test', schema='foo') -- context.assert_( -- "DROP INDEX foo.ik_test" -- ) -- - def test_drop_table(): - context = op_fixture() - op.drop_table('tb_test') diff --git a/python-alembic-sqlalchemy-0.8.patch b/python-alembic-sqlalchemy-0.8.patch new file mode 100644 index 0000000..0af60f9 --- /dev/null +++ b/python-alembic-sqlalchemy-0.8.patch @@ -0,0 +1,12 @@ +diff -Naur alembic-0.4.2.orig/tests/test_mssql.py alembic-0.4.2/tests/test_mssql.py +--- alembic-0.4.2.orig/tests/test_mssql.py 2013-01-11 16:12:49.000000000 +0000 ++++ alembic-0.4.2/tests/test_mssql.py 2014-01-28 12:01:23.674854937 +0000 +@@ -77,7 +77,7 @@ + context = op_fixture('mssql') + op.drop_index('my_idx', 'my_table') + # TODO: annoying that SQLA escapes unconditionally +- context.assert_contains("DROP INDEX [my_table].my_idx") ++ context.assert_contains("DROP INDEX my_idx ON my_table") + + def test_drop_column_w_default(self): + context = op_fixture('mssql') diff --git a/python-alembic.spec b/python-alembic.spec index 29dbc42..487083e 100644 --- a/python-alembic.spec +++ b/python-alembic.spec @@ -13,7 +13,7 @@ Group: Development/Libraries License: MIT URL: http://pypi.python.org/pypi/alembic Source0: http://pypi.python.org/packages/source/a/%{modname}/%{modname}-%{version}.tar.gz -Patch0: python-alembic-sqlalchemy-0.7.8.patch +Patch0: python-alembic-sqlalchemy-0.8.patch BuildArch: noarch