2018-09-03 02:56:53 +01:00
|
|
|
{ stdenv, buildPythonPackage, fetchPypi, fetchpatch, python
|
2017-12-13 22:33:23 +00:00
|
|
|
, unittest2, scripttest, pytz, pylint, mock
|
|
|
|
, testtools, pbr, tempita, decorator, sqlalchemy
|
|
|
|
, six, sqlparse, testrepository
|
2017-05-03 21:30:37 +01:00
|
|
|
}:
|
|
|
|
buildPythonPackage rec {
|
2017-05-27 10:25:35 +01:00
|
|
|
pname = "sqlalchemy-migrate";
|
2019-02-02 23:25:30 +00:00
|
|
|
version = "0.12.0";
|
2017-05-03 21:30:37 +01:00
|
|
|
|
2017-12-13 22:33:23 +00:00
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2019-02-02 23:25:30 +00:00
|
|
|
sha256 = "1bngmbcry97kwhrxwm0d74zg9qg7gmiws6rd78xshyfgpcqdmylc";
|
2017-05-03 21:30:37 +01:00
|
|
|
};
|
|
|
|
|
2018-09-03 02:56:53 +01:00
|
|
|
# See: https://review.openstack.org/#/c/608382/
|
|
|
|
patches = [ (fetchpatch {
|
|
|
|
url = https://github.com/openstack/sqlalchemy-migrate/pull/18.patch;
|
|
|
|
sha256 = "1qyfq2m7w7xqf0r9bc2x42qcra4r9k9l9g1jy5j0fvlb6bvvjj07";
|
|
|
|
}) ];
|
|
|
|
|
2018-07-24 16:56:55 +01:00
|
|
|
checkInputs = [ unittest2 scripttest pytz mock testtools testrepository ];
|
2017-05-03 21:30:37 +01:00
|
|
|
propagatedBuildInputs = [ pbr tempita decorator sqlalchemy six sqlparse ];
|
|
|
|
|
2017-12-13 22:33:23 +00:00
|
|
|
prePatch = ''
|
|
|
|
sed -i -e /tempest-lib/d \
|
|
|
|
-e /testtools/d \
|
|
|
|
test-requirements.txt
|
|
|
|
'';
|
2017-05-03 21:30:37 +01:00
|
|
|
checkPhase = ''
|
|
|
|
export PATH=$PATH:$out/bin
|
|
|
|
echo sqlite:///__tmp__ > test_db.cfg
|
|
|
|
# depends on ibm_db_sa
|
|
|
|
rm migrate/tests/changeset/databases/test_ibmdb2.py
|
|
|
|
# wants very old testtools
|
|
|
|
rm migrate/tests/versioning/test_schema.py
|
|
|
|
# transient failures on py27
|
|
|
|
substituteInPlace migrate/tests/versioning/test_util.py --replace "test_load_model" "noop"
|
|
|
|
${python.interpreter} setup.py test
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
2018-09-03 02:56:53 +01:00
|
|
|
homepage = https://github.com/openstack/sqlalchemy-migrate;
|
2017-05-03 21:30:37 +01:00
|
|
|
description = "Schema migration tools for SQLAlchemy";
|
|
|
|
license = licenses.asl20;
|
2017-09-23 14:08:28 +01:00
|
|
|
maintainers = with maintainers; [ makefu ];
|
2017-05-03 21:30:37 +01:00
|
|
|
};
|
|
|
|
}
|