2021-01-11 07:54:33 +00:00
|
|
|
{ lib, stdenv, buildPythonPackage, fetchPypi, fetchpatch, python
|
2019-06-16 20:59:06 +01:00
|
|
|
, unittest2, scripttest, pytz, mock
|
2017-12-13 22:33:23 +00:00
|
|
|
, 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";
|
2021-01-03 04:48:02 +00:00
|
|
|
version = "0.13.0";
|
2017-05-03 21:30:37 +01:00
|
|
|
|
2017-12-13 22:33:23 +00:00
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2021-01-03 04:48:02 +00:00
|
|
|
sha256 = "1y0lcqii7b4vp7yh9dyxrl4i77hi8jkkw7d06mgdw2h458ljxh0b";
|
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 {
|
2020-04-01 02:11:51 +01:00
|
|
|
url = "https://github.com/openstack/sqlalchemy-migrate/pull/18.patch";
|
2018-09-03 02:56:53 +01:00
|
|
|
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 ];
|
|
|
|
|
2019-04-23 03:49:34 +01:00
|
|
|
doCheck = !stdenv.isDarwin;
|
|
|
|
|
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
|
|
|
|
'';
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2020-04-01 02:11:51 +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
|
|
|
};
|
|
|
|
}
|