south-1.0: Package the 2014-07-01 release dev-python/south
authorW. Trevor King <wking@tremily.us>
Wed, 1 Oct 2014 17:43:22 +0000 (10:43 -0700)
committerW. Trevor King <wking@tremily.us>
Wed, 1 Oct 2014 17:58:14 +0000 (10:58 -0700)
South is now end-of-life [1]:

  Please note that South is now end of lifed in favour of the ​new
  migrations framework in Django 1.7, which is based on South but with
  significant design improvements. South will not work with Django
  1.7; it supports only versions 1.4, 1.5 and 1.6.

so I've limited compatibility to <dev-python/django-1.7.

I've also included a Python 3 compatibility patch (direct download
from [2]) which was merged into South's master branch with e2c9102
(Merged in gdub/south/python3-iteritems, pull request #162,
2014-08-01).  Without this patch, the Python 3 tests fail.  With it,
the tests pass, although a number are skipped and there are still some
odd messages on stderr like [3]:

  FATAL ERROR - The following SQL query failed: DROP TABLE "test_nonexistdeltable";
  The error was: no such table: test_nonexistdeltable

I've also trimmed the Manifest, because my overlay uses thin, unsigned
manifests.  Feel free to re-thicken if you prefer.

I've also skipped the ChangeLog entry, because folks can just look at
this commit message.  Feel free to extract a ChangeLog entry from this
if you prefer.

[1]: http://south.aeracode.org/
[2]: https://bitbucket.org/andrewgodwin/south/commits/3753b49ca9f3d34c94156622b380def245d88e80/raw/
[3]: http://south.aeracode.org/ticket/1256

Manifest
files/south-1.0-3753b49c-Replace-dict.iteritems-with-six.patch [new file with mode: 0644]
south-1.0.ebuild [new file with mode: 0644]

index 19a3b16b6d9525f2ce3c4ba0fe6f015950cab724..36f091d037f487f8ef58b5c74a9f2cd0e08f886a 100644 (file)
--- a/Manifest
+++ b/Manifest
@@ -1,16 +1,7 @@
-AUX south-0.7.5-tests.patch 705 SHA256 a9dd6876f54d40236d824e7a3ffc540af57d9883b8c7268390e49b3a8df9a6dd SHA512 22cbbb6a73aa2ac61a43ad3848de19a6103b016994a7ccf353e4a52068ba861b040b4e37e24793dc60332601c792117b8e20746c352ce0d452ca0b8b6a028aee WHIRLPOOL 4ddf6ddef6b269ad0902a3def0b6863aeaa70dd8db15c53ec91e630aea59bcac3455f3758d492a622cc79b1eebaeb256083604c0874969352400822ab7f08cf6
 DIST south-0.7.2.tar.gz 110527 SHA256 003fdcc1af01fda473d0f92f7f5afc25a75756a2a04acfb76c9a1d41a5db4211 SHA512 aeb53706dbec36b7bf00e10c582d059cee5966cf882ab439b52a008a8ab9b5d064e18a4d498a2a1fee4d2dbe973964296110f647663006c7e4f950d95bc71813 WHIRLPOOL 491d7a39042fef55bf175803018b89b909783b616b0a4990c0415dd276fe08f528a81e42616566d4340865e92eb6860631b903a94ff03f19649b67ad6e92ac51
 DIST south-0.7.3.tar.gz 112673 SHA256 ab1c72cd013fab2ddbef3100f2bf7a7f3d9fbc7169cd3e6c181060c17fdeea97 SHA512 09b8cd649523e42b4f469083fb563855c4382f68413571cad746c82b1e777c3725e595884eef339f73bde9c2ab8e137769df84ad9a912243e8cb2fcfed9a96c2 WHIRLPOOL 0839fe0bc37d508363959c70062cb3b3b3039207877265c9b1f0897470ab4f8f6f2406fe11730a21b434b9cdf84a9f7408d8a952d13cd65cfe37922c0ac24c56
 DIST south-0.7.4.tar.gz 131682 SHA256 431aea5aee19944f3c18ffc44e873aa3444c40c6492900dfed9f0b47c7938c50 SHA512 2e2b88688880acb489eb959a0798155a25fbf0ff5ee4e6a501375872e6e43ac74e6e5d191ea881f1eb56f6b5fea2b91513f73dac120d9a2f84ed1cfa488b5aab WHIRLPOOL 11550efebdd3cb785717e9a443e3910135a1a367a2a1253dc6c3d83cf75539d2aaf8b78f0261a76af129c7858e184fea4291dfb1026baa840129530ccef5ae40
 DIST south-0.7.5.tar.gz 134536 SHA256 e1f8bb50750b4e3eedf85106ea5d581488b6533885afdba91de81e07ac57ad12 SHA512 6696bb0b75132a1f6d11600834589af26008bdf53e55b1d8ab141392d68c62316abbeb02a3f850155b852232b5bc8326d2b415261eec667d5f591302ec952b70 WHIRLPOOL 417986c9fc7896f1f542c4ae49415e941bc641440d71de6c4093b87861d019342c7caca39e7ee43910ccb0dfd0ab2d8f3d9106d1f6974c4ea4d8ea8a24b3a588
 DIST south-0.7.6.tar.gz 136861 SHA256 481197a915a017291f34b0e01a004f7e1a4c1b43354809177849d46def1d9a03 SHA512 4c2dce16d30a3739347a8b8578ad32a80f256d2d9c3f3d63c82a39bc531dbb0a0c7d548c3dcf2de3bf414accf934cb87d11b4c8eac3f8abf40949a2c112d77bd WHIRLPOOL 04115995db09c7c6c06125ebc4242cef29f1a5ee8c6d99c726f5a86d5b6b7d663cf9463fce05a347213ec17c0b5a4639aa744420a9124135fc78e49060c227c6
 DIST south-0.8.1.tar.gz 140335 SHA256 cd2496fea244c9a9d655758d8eccb5db888331b7d0a64f7eb2bacdb99a2fa150 SHA512 b2eae51854ae9d7abed2474495939ec80a88d2a9c046b24e4bc65d99b2c25b00482386cec11000f2001317fb5855fcb093d6df329b217d462d7112ef0b695655 WHIRLPOOL 173872bd22de1bcdb3eec0c62fdf0b4a48a017d786fb9f6997d0d6f66378fcb4d26d9b70404b3b70e1fadb5d76f3b39f0c1e4112cdd22ac07fe900179fc0f195
-EBUILD south-0.7.2.ebuild 1129 SHA256 5b17315137d4ca7c345018812eea2403b0c171e7c266015bb929d419e653e9a0 SHA512 f2473b52b7d5c1fb32b0499c783b010ee646c9aec8b88b571cc612d01ba5634acc245449e7c96edffbe7b98869abcd2813a72fbdd5b45f4105e85aeefe7dc44b WHIRLPOOL 7f3dd94c252e6e0560aa264ae6b08dd1fc9e0787dc40b898c5dfb37df7200fad87f133434a9dfaf7acc2b9555ff50d2b98679faf0aa8a794b63757dac05a2c36
-EBUILD south-0.7.3.ebuild 1129 SHA256 f97f0acda5c2a241f3d46a44c499639fc894dab3aca3ddc7a6cda80b6947f43a SHA512 022f529d13b59d128454836eac05a8697d9eb6ade7942792a6f5fb2bab0f5cdc5b90512af90453782331987e3c4ebf49a502005d528bf529321cf70fa0ca6d56 WHIRLPOOL 42fedf6998842f6ee344868ba6387411de3271e526a029202c50c1a996c9ae419a898c84dc4d40e7beb9dad57dce148315a973f05315dc6c72ad28e4deed8178
-EBUILD south-0.7.4.ebuild 1196 SHA256 e121acfbefabad525dc533a358603d48265b3206407683c535c750884ac015d0 SHA512 3fafb57ce173700be90a58907fac193db11d32c8e40369609d0985c022ddd85a04bafcc58b02adbc593c9414240b6e1039612e3264baeafb48e9a4e9ab8ef943 WHIRLPOOL e7851e4802b4860f21121b59661c813c1a9ee95982d7c86f7d65281e0bfa79dc3c142be3b039607f54fde7c645d6b441b526081e24c39d47251326e6c9bafbb4
-EBUILD south-0.7.5-r1.ebuild 1860 SHA256 91dcb36f1161a25109c6bc422b40ad9d3b0a21822a8d85fa032c7f09b93722b2 SHA512 e6de73fe36af308ff143c22351844cd07eaa0bdcbeb6fff05986645b1d658569fbb023544e90edb672303a07718dbf10813ef1a986813e4732c00246d71542bf WHIRLPOOL 892d65db7457e001d1edeb0907070bc00bb2cd34426dc0f3f195f576212c3ab6049731213313291fb45fac02a9b611db17af1f1ca3d0c13196d04b146cb32df9
-EBUILD south-0.7.5.ebuild 1815 SHA256 e0452e3041f0ec878c11b8186d5726b03a1068be7dae4d0aac2a223fac1be177 SHA512 9adb139420fd6f30db597c2d19dafc9d5a88a17cff17d9af98a0d5befb0bc10b0f25d494bcc53e1a9bc68e7a374a326c8fb130c02b678daeecd6fa6339caf4b9 WHIRLPOOL a14a619907455f42c468230d7e874620fdf3e20655499b03284c3e6d82cbee099f2054b7b55d4b26abf11339439c0c800fe698152e7e9c1c2ae744d83be905ce
-EBUILD south-0.7.6.ebuild 1662 SHA256 cb1026d51879b80b7d19c78070f12e123eb94996a7cca8ac9ed6ad77925d477c SHA512 124d15bc0e556ba6536d64fc62e20bc42ca8949906e377235e8b631d1d144a830d03b16db91d1b410970ec780b4e5f73313ae30a74fa34174c4c08712028bccb WHIRLPOOL f8818ba3dd8207b83a0891332b413c57522fe1a32883fcc44953289a69f63800ce339cd8ffb3e1b5a792604dc8cc15a92646d0d0c754d4ceb15c0de170353666
-EBUILD south-0.8.1.ebuild 1749 SHA256 70252e6577c8f57626758c394baa6db3b0ff61a9107c760a915b2bb49d30fd7b SHA512 e8926f736e3e33d9e01fb919c0ceca7ea8e5359a3c013c7f7c8069247e5e2398396695ed9a22b9a5bbc32c385d4062e4dc6a323c3b7a5e9d0c3ac9281766486f WHIRLPOOL 1a9aab1a10f5331b7a1b5a7775a5eff3503cf238c3b3454cd44910deee91ec9e47f64dda0e7c59e3e557f09d2c5dbdd130a8aedec34e9720b2867bc02eb20f4a
-MISC ChangeLog 1914 SHA256 084c8fd900db9d808c4b4545d0bca46571668a8aa965ad9428a4e336c7c7880f SHA512 8db34f1eb936d74e5c774bdb8cca01973fa7fe35e8b7da6370a4ce8e83552b31c9d7e07e9d6f95f65a4f1c5f4244fcecf6368c91d0943e5a287f5caa7364e436 WHIRLPOOL bcf027e6f494629dc445e94e115527115bdc19d2dd79fe86f0d520af766aea4108d50b970033e68e2b08c8985cc7f84cc24d227f05203bead5ba6063cd1a06e4
-MISC metadata.xml 236 SHA256 8db85d348f1fcca741457358302188e30b7b1c0524a9a55820b935d8bcac959e SHA512 8086fc7bc2140d0b7b96293ba80717a8dcb88b255cc3906b5ac1ec4b9c67a412d3a51ad03a19e3b700a0235d0622b525ef85289f616646d47c698b3b54157b7e WHIRLPOOL 080a90e854f29d29d005f164fba91fc9e05f362460cd8f825ecb7f16d893a1cce1f7e842bf561918a491d156c48c1d8e4a60b177ab28667c067ee379d626de68
+DIST south-1.0.tar.gz 97890 SHA256 017ecc2d66818580e1131af61b8d96901c4a2d05b051186196d9d4f35bdbb901 SHA512 8f181e8879734ddc3bba4e6f9e0efc3d4db4783fbd629c56c4f72401d161080bed51e3955bc37b7796160145c733321f356c63aece22da752695fc3e24c9b90b WHIRLPOOL 8f7949c96394906a53ecfcedcbe3c9b9fdae32db4c28fb7f507c8529fc586947021eebee259b5caab5a03550a4003b0d8aed9a1f6bcc658fb1b48dbdd64ddf6f
diff --git a/files/south-1.0-3753b49c-Replace-dict.iteritems-with-six.patch b/files/south-1.0-3753b49c-Replace-dict.iteritems-with-six.patch
new file mode 100644 (file)
index 0000000..07c50ed
--- /dev/null
@@ -0,0 +1,60 @@
+# HG changeset patch
+# User Gary Wilson Jr. <gary@thegarywilson.com>
+# Date 1397849538 18000
+# Branch python3-iteritems
+# Node ID 3753b49ca9f3d34c94156622b380def245d88e80
+# Parent  0e17add9b5e0f30f7cf5acf47961eea6a7f4032c
+Fixed a Python 3 incompatibility by replacing dict.iteritems() usage with an iteritems py3 util function from six.
+
+diff --git a/south/migration/migrators.py b/south/migration/migrators.py
+--- a/south/migration/migrators.py
++++ b/south/migration/migrators.py
+@@ -16,7 +16,7 @@
+ from south.db import DEFAULT_DB_ALIAS
+ from south.models import MigrationHistory
+ from south.signals import ran_migration
+-from south.utils.py3 import StringIO
++from south.utils.py3 import StringIO, iteritems
+ class Migrator(object):
+@@ -161,7 +161,7 @@
+             if self.verbosity:
+                 print(" - Migration '%s' is marked for no-dry-run." % migration)
+             return
+-        for name, db in south.db.dbs.iteritems():
++        for name, db in iteritems(south.db.dbs):
+             south.db.dbs[name].dry_run = True
+         # preserve the constraint cache as it can be mutated by the dry run
+         constraint_cache = deepcopy(south.db.db._constraint_cache)
+@@ -181,7 +181,7 @@
+             if self._ignore_fail:
+                 south.db.db.debug = old_debug
+             south.db.db.clear_run_data(pending_creates)
+-            for name, db in south.db.dbs.iteritems():
++            for name, db in iteritems(south.db.dbs):
+                 south.db.dbs[name].dry_run = False
+             # restore the preserved constraint cache from before dry run was
+             # executed
+diff --git a/south/utils/py3.py b/south/utils/py3.py
+--- a/south/utils/py3.py
++++ b/south/utils/py3.py
+@@ -26,3 +26,18 @@
+ def with_metaclass(meta, base=object):
+     """Create a base class with a metaclass."""
+     return meta("NewBase", (base,), {})
++
++
++def _add_doc(func, doc):
++    """Add documentation to a function."""
++    func.__doc__ = doc
++
++if PY3:
++    def iteritems(d, **kw):
++        return iter(d.items(**kw))
++else:
++    def iteritems(d, **kw):
++        return iter(d.iteritems(**kw))
++
++_add_doc(iteritems,
++         "Return an iterator over the (key, value) pairs of a dictionary.")
diff --git a/south-1.0.ebuild b/south-1.0.ebuild
new file mode 100644 (file)
index 0000000..e3d248b
--- /dev/null
@@ -0,0 +1,59 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header$
+
+EAPI=5
+
+PYTHON_COMPAT=( python{2_7,3_2,3_3,3_4} pypy )
+
+inherit distutils-r1
+
+MY_PN="South"
+MY_P="${MY_PN}-${PV}"
+
+DESCRIPTION="Intelligent schema migrations for Django apps."
+HOMEPAGE="http://south.aeracode.org/"
+SRC_URI="mirror://pypi/${MY_P:0:1}/${MY_PN}/${MY_P}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="Apache-2.0"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="doc test"
+
+RDEPEND="<dev-python/django-1.7[${PYTHON_USEDEP}]"
+DEPEND="${RDEPEND}
+       dev-python/setuptools[${PYTHON_USEDEP}]
+       doc? ( dev-python/sphinx dev-python/jinja )
+       test? ( dev-python/django[sqlite] )"
+
+PATCHES=( "${FILESDIR}"/${P}-3753b49c-Replace-dict.iteritems-with-six.patch )
+
+S="${WORKDIR}/${MY_P}"
+
+# we are setting up the tests, but they fail
+
+python_compile_all() {
+       use doc && emake -C docs html
+}
+
+python_install_all() {
+       distutils-r1_python_install_all
+       use doc && local HTML_DOCS=( docs/_build/html/. )
+}
+
+python_test() {
+       cd "${BUILD_DIR}"
+       django-admin.py startproject southtest || die "setting up test env failed"
+       cd southtest
+       sed -i \
+               -e "/^INSTALLED_APPS/a\    'south'," \
+               southtest/settings.py || die "sed failed"
+       echo "SKIP_SOUTH_TESTS=False" >> southtest/settings.py
+       "${EPYTHON}" manage.py test south || die "tests failed for ${EPYTHON}"
+}
+
+pkg_postinst() {
+       elog "In order to use the south schema migrations for your Django project,"
+       elog "just add 'south' to your INSTALLED_APPS in the settings.py file."
+       elog "manage.py will now automagically offer the new functions."
+}