ansible-later: 2.0.22 -> 2.0.23
[NixPkgs.git] / pkgs / development / python-modules / sqlalchemy-migrate / default.nix
blobbfae1d7b3b9d909c26f8f56ee674b95a5d849472
1 { lib, stdenv, buildPythonPackage, fetchPypi, fetchpatch, python
2 , scripttest, pytz, pbr, tempita, decorator, sqlalchemy
3 , six, sqlparse, testrepository
4 }:
6 buildPythonPackage rec {
7   pname = "sqlalchemy-migrate";
8   version = "0.13.0";
10   src = fetchPypi {
11     inherit pname version;
12     sha256 = "1y0lcqii7b4vp7yh9dyxrl4i77hi8jkkw7d06mgdw2h458ljxh0b";
13   };
15   # See: https://review.openstack.org/#/c/608382/
16   patches = [
17     (fetchpatch {
18       url = "https://github.com/openstack/sqlalchemy-migrate/pull/18.patch";
19       sha256 = "1qyfq2m7w7xqf0r9bc2x42qcra4r9k9l9g1jy5j0fvlb6bvvjj07";
20     })
21   ];
23   postPatch = ''
24     substituteInPlace test-requirements.txt \
25       --replace "ibm_db_sa>=0.3.0;python_version<'3.0'" "" \
26       --replace "ibm-db-sa-py3;python_version>='3.0'" "" \
27       --replace "tempest-lib>=0.1.0" "" \
28       --replace "testtools>=0.9.34,<0.9.36" "" \
29       --replace "pylint" ""
30   '';
32   checkInputs = [ scripttest pytz testrepository ];
33   propagatedBuildInputs = [ pbr tempita decorator sqlalchemy six sqlparse ];
35   doCheck = !stdenv.isDarwin;
37   checkPhase = ''
38     export PATH=$PATH:$out/bin
39     echo sqlite:///__tmp__ > test_db.cfg
40     # depends on ibm_db_sa
41     rm migrate/tests/changeset/databases/test_ibmdb2.py
42     # wants very old testtools
43     rm migrate/tests/versioning/test_schema.py
44     # transient failures on py27
45     substituteInPlace migrate/tests/versioning/test_util.py --replace "test_load_model" "noop"
46     ${python.interpreter} setup.py test
47   '';
49   meta = with lib; {
50     homepage = "https://opendev.org/x/sqlalchemy-migrate";
51     description = "Schema migration tools for SQLAlchemy";
52     license = licenses.asl20;
53     maintainers = teams.openstack.members ++ (with maintainers; [ makefu ]);
54   };