nixpkgs/pkgs/development/python-modules/poetry/default.nix

92 lines
2.1 KiB
Nix
Raw Normal View History

2019-01-07 18:25:57 +00:00
{ lib, buildPythonPackage, fetchPypi, callPackage
, isPy27, isPy34
, cleo
, requests
, cachy
, requests-toolbelt
, pyrsistent
, pyparsing
, cachecontrol
, pkginfo
, html5lib
, shellingham
, subprocess32
2019-01-07 18:25:57 +00:00
, tomlkit
, typing
, pathlib2
, virtualenv
, functools32
, pytest
2019-10-27 15:08:27 +00:00
, jsonschema
2019-01-07 18:25:57 +00:00
}:
let
2019-10-27 15:08:27 +00:00
cleo6 = cleo.overridePythonAttrs (oldAttrs: rec {
2019-01-07 18:25:57 +00:00
version = "0.6.8";
src = fetchPypi {
inherit (oldAttrs) pname;
inherit version;
sha256 = "06zp695hq835rkaq6irr1ds1dp2qfzyf32v60vxpd8rcnxv319l5";
};
});
glob2 = callPackage ./glob2.nix { };
2019-01-07 18:25:57 +00:00
in buildPythonPackage rec {
pname = "poetry";
version = "0.12.17";
2019-01-07 18:25:57 +00:00
src = fetchPypi {
inherit pname version;
sha256 = "0gxwcd65qjmzqzppf53x51sic1rbcd9py6cdzx3aprppipimslvf";
2019-01-07 18:25:57 +00:00
};
postPatch = ''
2019-03-11 15:49:22 +00:00
substituteInPlace setup.py --replace \
"requests-toolbelt>=0.8.0,<0.9.0" \
2019-09-26 17:17:08 +01:00
"requests-toolbelt>=0.8.0,<0.10.0" \
--replace 'pyrsistent>=0.14.2,<0.15.0' 'pyrsistent>=0.14.2,<0.16.0'
2019-01-07 18:25:57 +00:00
'';
format = "pyproject";
2019-01-07 18:25:57 +00:00
propagatedBuildInputs = [
2019-10-27 15:08:27 +00:00
cachy
2019-01-07 18:25:57 +00:00
cleo6
requests
cachy
requests-toolbelt
2019-10-27 15:08:27 +00:00
jsonschema
2019-01-07 18:25:57 +00:00
pyrsistent
pyparsing
cachecontrol
pkginfo
html5lib
shellingham
tomlkit
] ++ lib.optionals (isPy27 || isPy34) [ typing pathlib2 glob2 ]
++ lib.optionals isPy27 [ virtualenv functools32 subprocess32 ];
2019-01-07 18:25:57 +00: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 18:25:57 +00: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 ];
};
}