2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
stdenv,
|
|
|
|
buildPythonPackage,
|
|
|
|
fetchPypi,
|
|
|
|
fetchpatch,
|
|
|
|
python,
|
|
|
|
scripttest,
|
|
|
|
pytz,
|
|
|
|
pbr,
|
|
|
|
tempita,
|
|
|
|
decorator,
|
|
|
|
sqlalchemy,
|
|
|
|
six,
|
|
|
|
sqlparse,
|
|
|
|
testrepository,
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
2022-01-19 23:45:15 +00:00
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "sqlalchemy-migrate";
|
2021-01-05 17:05:55 +00:00
|
|
|
version = "0.13.0";
|
2024-01-02 11:29:13 +00:00
|
|
|
format = "setuptools";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2021-01-05 17:05:55 +00:00
|
|
|
sha256 = "1y0lcqii7b4vp7yh9dyxrl4i77hi8jkkw7d06mgdw2h458ljxh0b";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2022-01-19 23:45:15 +00:00
|
|
|
patches = [
|
2023-07-15 17:15:38 +00:00
|
|
|
# See: https://review.openstack.org/#/c/608382/
|
2023-11-16 04:20:00 +00:00
|
|
|
# https://github.com/openstack/sqlalchemy-migrate/pull/18
|
2022-01-19 23:45:15 +00:00
|
|
|
(fetchpatch {
|
2023-11-16 04:20:00 +00:00
|
|
|
url = "https://github.com/openstack/sqlalchemy-migrate/commit/a5d69a17d9354ec1a792493280f96484740cf7ff.patch";
|
2022-01-19 23:45:15 +00:00
|
|
|
sha256 = "1qyfq2m7w7xqf0r9bc2x42qcra4r9k9l9g1jy5j0fvlb6bvvjj07";
|
|
|
|
})
|
2023-07-15 17:15:38 +00:00
|
|
|
./python3.11-comp.diff
|
2022-01-19 23:45:15 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace test-requirements.txt \
|
|
|
|
--replace "ibm_db_sa>=0.3.0;python_version<'3.0'" "" \
|
|
|
|
--replace "ibm-db-sa-py3;python_version>='3.0'" "" \
|
|
|
|
--replace "tempest-lib>=0.1.0" "" \
|
|
|
|
--replace "testtools>=0.9.34,<0.9.36" "" \
|
|
|
|
--replace "pylint" ""
|
|
|
|
'';
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
nativeCheckInputs = [
|
|
|
|
scripttest
|
|
|
|
pytz
|
|
|
|
testrepository
|
|
|
|
];
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
pbr
|
|
|
|
tempita
|
|
|
|
decorator
|
|
|
|
sqlalchemy
|
|
|
|
six
|
|
|
|
sqlparse
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
doCheck = !stdenv.isDarwin;
|
|
|
|
|
|
|
|
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-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2022-01-19 23:45:15 +00:00
|
|
|
homepage = "https://opendev.org/x/sqlalchemy-migrate";
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Schema migration tools for SQLAlchemy";
|
|
|
|
license = licenses.asl20;
|
2022-01-19 23:45:15 +00:00
|
|
|
maintainers = teams.openstack.members ++ (with maintainers; [ makefu ]);
|
2023-03-15 16:39:30 +00:00
|
|
|
broken = lib.versionAtLeast sqlalchemy.version "2.0.0";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|