2019-01-07 19:25:57 +01:00
|
|
|
{ lib, buildPythonPackage, fetchPypi, callPackage
|
|
|
|
, isPy27, isPy34
|
|
|
|
, cleo
|
|
|
|
, requests
|
|
|
|
, cachy
|
|
|
|
, requests-toolbelt
|
|
|
|
, pyrsistent
|
|
|
|
, pyparsing
|
|
|
|
, cachecontrol
|
|
|
|
, pkginfo
|
|
|
|
, html5lib
|
|
|
|
, shellingham
|
|
|
|
, tomlkit
|
|
|
|
, typing
|
|
|
|
, pathlib2
|
|
|
|
, virtualenv
|
|
|
|
, functools32
|
|
|
|
, pytest
|
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
|
|
|
cleo6 = cleo.overrideAttrs (oldAttrs: rec {
|
|
|
|
version = "0.6.8";
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit (oldAttrs) pname;
|
|
|
|
inherit version;
|
|
|
|
sha256 = "06zp695hq835rkaq6irr1ds1dp2qfzyf32v60vxpd8rcnxv319l5";
|
|
|
|
};
|
|
|
|
});
|
|
|
|
|
|
|
|
jsonschema3 = callPackage ./jsonschema.nix { };
|
2019-04-14 20:40:11 +02:00
|
|
|
glob2 = callPackage ./glob2.nix { };
|
2019-01-07 19:25:57 +01:00
|
|
|
|
|
|
|
in buildPythonPackage rec {
|
|
|
|
pname = "poetry";
|
2019-07-04 11:24:39 +02:00
|
|
|
version = "0.12.17";
|
2019-01-07 19:25:57 +01:00
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2019-07-04 11:24:39 +02:00
|
|
|
sha256 = "0gxwcd65qjmzqzppf53x51sic1rbcd9py6cdzx3aprppipimslvf";
|
2019-01-07 19:25:57 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
postPatch = ''
|
2019-03-11 16:49:22 +01:00
|
|
|
substituteInPlace setup.py --replace \
|
|
|
|
"requests-toolbelt>=0.8.0,<0.9.0" \
|
|
|
|
"requests-toolbelt>=0.8.0,<0.10.0"
|
2019-01-07 19:25:57 +01:00
|
|
|
'';
|
|
|
|
|
2019-04-14 20:40:11 +02:00
|
|
|
format = "pyproject";
|
|
|
|
|
2019-01-07 19:25:57 +01:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
cleo6
|
|
|
|
requests
|
|
|
|
cachy
|
|
|
|
requests-toolbelt
|
|
|
|
jsonschema3
|
|
|
|
pyrsistent
|
|
|
|
pyparsing
|
|
|
|
cachecontrol
|
|
|
|
pkginfo
|
|
|
|
html5lib
|
|
|
|
shellingham
|
|
|
|
tomlkit
|
2019-04-14 20:40:11 +02:00
|
|
|
] ++ lib.optionals (isPy27 || isPy34) [ typing pathlib2 glob2 ]
|
2019-01-07 19:25:57 +01:00
|
|
|
++ lib.optionals isPy27 [ virtualenv functools32 ];
|
|
|
|
|
2019-02-27 21:18:00 +01:00
|
|
|
postInstall = ''
|
|
|
|
mkdir -p "$out/share/bash-completion/completions"
|
|
|
|
"$out/bin/poetry" completions bash > "$out/share/bash-completion/completions/poetry"
|
|
|
|
mkdir -p "$out/share/zsh/vendor-completions"
|
|
|
|
"$out/bin/poetry" completions zsh > "$out/share/zsh/vendor-completions/_poetry"
|
|
|
|
mkdir -p "$out/share/fish/vendor_completions.d"
|
|
|
|
"$out/bin/poetry" completions fish > "$out/share/fish/vendor_completions.d/poetry.fish"
|
|
|
|
'';
|
|
|
|
|
2019-01-07 19:25:57 +01:00
|
|
|
# No tests in Pypi tarball
|
|
|
|
doCheck = false;
|
|
|
|
checkInputs = [ pytest ];
|
|
|
|
checkPhase = ''
|
|
|
|
pytest tests
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
homepage = https://github.com/sdispater/poetry;
|
|
|
|
description = "Python dependency management and packaging made easy";
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ jakewaksbaum ];
|
|
|
|
};
|
|
|
|
}
|