2020-08-16 20:33:47 +00:00
|
|
|
{ lib, buildPythonPackage, fetchFromGitHub, isPy27, pythonOlder, fetchpatch
|
2019-01-07 18:25:57 +00:00
|
|
|
, cachecontrol
|
2020-06-21 11:31:52 +00:00
|
|
|
, cachy
|
|
|
|
, cleo
|
2020-02-22 18:25:57 +00:00
|
|
|
, clikit
|
2020-06-21 11:31:52 +00:00
|
|
|
, html5lib
|
|
|
|
, httpretty
|
2020-02-22 18:25:57 +00:00
|
|
|
, importlib-metadata
|
|
|
|
, intreehooks
|
2020-06-21 11:31:52 +00:00
|
|
|
, jsonschema
|
|
|
|
, keyring
|
2020-02-22 18:25:57 +00:00
|
|
|
, lockfile
|
2020-06-21 11:31:52 +00:00
|
|
|
, pexpect
|
|
|
|
, pkginfo
|
|
|
|
, pygments
|
|
|
|
, pyparsing
|
|
|
|
, pyrsistent
|
|
|
|
, pytestCheckHook
|
|
|
|
, pytestcov
|
|
|
|
, pytest-mock
|
|
|
|
, requests
|
|
|
|
, requests-toolbelt
|
|
|
|
, shellingham
|
|
|
|
, tomlkit
|
2019-01-07 18:25:57 +00:00
|
|
|
}:
|
|
|
|
|
2020-06-21 11:31:52 +00:00
|
|
|
buildPythonPackage rec {
|
2019-01-07 18:25:57 +00:00
|
|
|
pname = "poetry";
|
2020-07-26 13:03:36 +00:00
|
|
|
version = "1.0.10";
|
2020-03-02 18:12:04 +00:00
|
|
|
format = "pyproject";
|
2020-06-21 11:31:52 +00:00
|
|
|
disabled = isPy27;
|
2019-01-07 18:25:57 +00:00
|
|
|
|
2020-06-21 11:31:52 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "python-poetry";
|
|
|
|
repo = pname;
|
|
|
|
rev = version;
|
2020-07-26 13:03:36 +00:00
|
|
|
sha256 = "00qfzjjs6clh93gfl1px3ma9km8qxl3f4z819nmyl58zc8ni3zyv";
|
2019-01-07 18:25:57 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
postPatch = ''
|
2020-02-22 18:25:57 +00:00
|
|
|
substituteInPlace pyproject.toml \
|
2020-06-21 11:31:52 +00:00
|
|
|
--replace "pyrsistent = \"^0.14.2\"" "pyrsistent = \"^0.16.0\"" \
|
|
|
|
--replace "requests-toolbelt = \"^0.8.0\"" "requests-toolbelt = \"^0.9.1\"" \
|
2020-03-02 18:12:04 +00:00
|
|
|
--replace 'importlib-metadata = {version = "~1.1.3", python = "<3.8"}' \
|
2020-06-21 11:31:52 +00:00
|
|
|
'importlib-metadata = {version = ">=1.3,<2", python = "<3.8"}' \
|
2020-08-16 20:33:47 +00:00
|
|
|
--replace "tomlkit = \"^0.5.11\"" "tomlkit = \"<2\"" \
|
2020-06-21 11:31:52 +00:00
|
|
|
--replace "cleo = \"^0.7.6\"" "cleo = \"^0.8.0\"" \
|
|
|
|
--replace "version = \"^20.0.1\", python = \"^3.5\"" "version = \"^21.0.0\", python = \"^3.5\"" \
|
|
|
|
--replace "clikit = \"^0.4.2\"" "clikit = \"^0.6.2\""
|
2019-01-07 18:25:57 +00:00
|
|
|
'';
|
|
|
|
|
2020-02-22 18:25:57 +00:00
|
|
|
nativeBuildInputs = [ intreehooks ];
|
|
|
|
|
2019-01-07 18:25:57 +00:00
|
|
|
propagatedBuildInputs = [
|
2020-06-21 11:31:52 +00:00
|
|
|
cachecontrol
|
|
|
|
cachy
|
2020-02-22 18:25:57 +00:00
|
|
|
cleo
|
|
|
|
clikit
|
2020-06-21 11:31:52 +00:00
|
|
|
html5lib
|
2019-10-27 15:08:27 +00:00
|
|
|
jsonschema
|
2020-06-21 11:31:52 +00:00
|
|
|
keyring
|
|
|
|
lockfile
|
|
|
|
pexpect
|
2019-01-07 18:25:57 +00:00
|
|
|
pkginfo
|
2020-06-21 11:31:52 +00:00
|
|
|
pyparsing
|
|
|
|
pyrsistent
|
|
|
|
requests
|
|
|
|
requests-toolbelt
|
2019-01-07 18:25:57 +00:00
|
|
|
shellingham
|
|
|
|
tomlkit
|
2020-06-21 11:31:52 +00:00
|
|
|
] ++ lib.optionals (pythonOlder "3.8") [ importlib-metadata ];
|
2019-01-07 18:25:57 +00:00
|
|
|
|
2019-02-27 20:18:00 +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"
|
|
|
|
'';
|
|
|
|
|
2020-06-21 11:31:52 +00:00
|
|
|
checkInputs = [ pytestCheckHook httpretty pytest-mock pygments pytestcov ];
|
|
|
|
preCheck = "export HOME=$TMPDIR";
|
|
|
|
disabledTests = [
|
|
|
|
# touches network
|
|
|
|
"git"
|
|
|
|
"solver"
|
|
|
|
"load"
|
|
|
|
"vcs"
|
|
|
|
"prereleases_if_they_are_compatible"
|
|
|
|
# requires git history to work correctly
|
|
|
|
"default_with_excluded_data"
|
2020-08-16 20:33:47 +00:00
|
|
|
# toml ordering has changed
|
|
|
|
"lock"
|
2020-06-21 11:31:52 +00:00
|
|
|
];
|
2019-01-07 18:25:57 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
2020-02-22 18:25:57 +00:00
|
|
|
homepage = "https://python-poetry.org/";
|
2019-01-07 18:25:57 +00:00
|
|
|
description = "Python dependency management and packaging made easy";
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ jakewaksbaum ];
|
|
|
|
};
|
|
|
|
}
|