coqPackages.ExtLib: 0.12.2 → 0.13.0
[NixPkgs.git] / pkgs / development / python-modules / flask-dramatiq / default.nix
blobdf943b1d8ed1014bf417b42a73af7b0a296b0139
2   lib,
3   buildPythonPackage,
4   pythonOlder,
5   fetchFromGitLab,
6   poetry-core,
7   dramatiq,
8   flask,
9   requests,
10   pytestCheckHook,
11   flask-migrate,
12   periodiq,
13   postgresql,
14   postgresqlTestHook,
15   psycopg2,
18 buildPythonPackage {
19   pname = "flask-dramatiq";
20   version = "0.6.0";
21   format = "pyproject";
23   disabled = pythonOlder "3.6";
25   src = fetchFromGitLab {
26     owner = "bersace";
27     repo = "flask-dramatiq";
28     rev = "840209e9bf582b4dda468e8bba515f248f3f8534";
29     hash = "sha256-qjV1zyVzHPXMt+oUeGBdP9XVlbcSz2MF9Zygj543T4w=";
30   };
32   postPatch = ''
33     substituteInPlace pyproject.toml \
34       --replace 'poetry>=0.12' 'poetry-core' \
35       --replace 'poetry.masonry.api' 'poetry.core.masonry.api'
37     patchShebangs --build ./example.py
39     sed -i ./tests/unit/pytest.ini \
40       -e 's:--cov=flask_dramatiq::' \
41       -e 's:--cov-report=term-missing::'
42   '';
44   nativeBuildInputs = [ poetry-core ];
46   propagatedBuildInputs = [ dramatiq ];
48   nativeCheckInputs = [
49     pytestCheckHook
50     flask
51     requests
52     flask-migrate
53     periodiq
54     postgresql
55     postgresqlTestHook
56     psycopg2
57   ] ++ dramatiq.optional-dependencies.rabbitmq;
59   postgresqlTestSetupPost = ''
60     substituteInPlace config.py \
61       --replace 'SQLALCHEMY_DATABASE_URI = f"postgresql://{PGUSER}:{PGPASSWORD}@{PGHOST}/{PGDATABASE}"' \
62         "SQLALCHEMY_DATABASE_URI = \"postgresql://$PGUSER/$PGDATABASE?host=$PGHOST\""
63     python3 ./example.py db upgrade
64   '';
66   pytestFlagsArray = [
67     "-x"
68     "tests/func/"
69     "tests/unit"
70   ];
72   pythonImportsCheck = [ "flask_dramatiq" ];
74   # Does HTTP requests to localhost
75   disabledTests = [
76     "test_fast"
77     "test_other"
78   ];
80   meta = with lib; {
81     description = "Adds Dramatiq support to your Flask application";
82     homepage = "https://gitlab.com/bersace/flask-dramatiq";
83     license = licenses.bsd3;
84     maintainers = with maintainers; [ traxys ];
85   };