1{ lib, buildPythonPackage, fetchPypi, callPackage
2, isPy27, isPy34
3, cleo
4, requests
5, cachy
6, requests-toolbelt
7, pyrsistent
8, pyparsing
9, cachecontrol
10, pkginfo
11, html5lib
12, shellingham
13, tomlkit
14, typing
15, pathlib2
16, virtualenv
17, functools32
18, pytest
19}:
20
21let
22 cleo6 = cleo.overrideAttrs (oldAttrs: rec {
23 version = "0.6.8";
24 src = fetchPypi {
25 inherit (oldAttrs) pname;
26 inherit version;
27 sha256 = "06zp695hq835rkaq6irr1ds1dp2qfzyf32v60vxpd8rcnxv319l5";
28 };
29 });
30
31 jsonschema3 = callPackage ./jsonschema.nix { };
32
33in buildPythonPackage rec {
34 pname = "poetry";
35 version = "0.12.10";
36
37 src = fetchPypi {
38 inherit pname version;
39 sha256 = "00npb0jlimnk4r01zkhfmns4843j1hfhd388s326da5pd8n0dq7l";
40 };
41
42 postPatch = ''
43 substituteInPlace setup.py --replace \
44 "requests-toolbelt>=0.8.0,<0.9.0" \
45 "requests-toolbelt>=0.8.0,<0.10.0"
46 '';
47
48 propagatedBuildInputs = [
49 cleo6
50 requests
51 cachy
52 requests-toolbelt
53 jsonschema3
54 pyrsistent
55 pyparsing
56 cachecontrol
57 pkginfo
58 html5lib
59 shellingham
60 tomlkit
61 ] ++ lib.optionals (isPy27 || isPy34) [ typing pathlib2 ]
62 ++ lib.optionals isPy27 [ virtualenv functools32 ];
63
64 # No tests in Pypi tarball
65 doCheck = false;
66 checkInputs = [ pytest ];
67 checkPhase = ''
68 pytest tests
69 '';
70
71 meta = with lib; {
72 homepage = https://github.com/sdispater/poetry;
73 description = "Python dependency management and packaging made easy";
74 license = licenses.mit;
75 maintainers = with maintainers; [ jakewaksbaum ];
76 };
77}