2020-08-16 21:33:47 +01:00
|
|
|
{ lib, buildPythonPackage, fetchFromGitHub, isPy27, pythonOlder, fetchpatch
|
2019-01-07 18:25:57 +00:00
|
|
|
, cachecontrol
|
2020-06-21 12:31:52 +01:00
|
|
|
, cachy
|
|
|
|
, cleo
|
2020-02-22 18:25:57 +00:00
|
|
|
, clikit
|
2020-06-21 12:31:52 +01:00
|
|
|
, html5lib
|
|
|
|
, httpretty
|
2020-02-22 18:25:57 +00:00
|
|
|
, importlib-metadata
|
|
|
|
, intreehooks
|
2020-06-21 12:31:52 +01:00
|
|
|
, keyring
|
2020-02-22 18:25:57 +00:00
|
|
|
, lockfile
|
2020-06-21 12:31:52 +01:00
|
|
|
, pexpect
|
|
|
|
, pkginfo
|
2020-10-03 21:26:43 +01:00
|
|
|
, poetry-core
|
2020-06-21 12:31:52 +01:00
|
|
|
, pytestCheckHook
|
|
|
|
, pytestcov
|
|
|
|
, pytest-mock
|
|
|
|
, requests
|
|
|
|
, requests-toolbelt
|
|
|
|
, shellingham
|
|
|
|
, tomlkit
|
2020-10-03 21:26:43 +01:00
|
|
|
, virtualenv
|
2019-01-07 18:25:57 +00:00
|
|
|
}:
|
|
|
|
|
2020-06-21 12:31:52 +01:00
|
|
|
buildPythonPackage rec {
|
2019-01-07 18:25:57 +00:00
|
|
|
pname = "poetry";
|
2020-11-06 05:23:00 +00:00
|
|
|
version = "1.1.4";
|
2020-03-02 18:12:04 +00:00
|
|
|
format = "pyproject";
|
2020-06-21 12:31:52 +01:00
|
|
|
disabled = isPy27;
|
2019-01-07 18:25:57 +00:00
|
|
|
|
2020-06-21 12:31:52 +01:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "python-poetry";
|
|
|
|
repo = pname;
|
|
|
|
rev = version;
|
2020-11-06 05:23:00 +00:00
|
|
|
sha256 = "0lx3qpz5dad0is7ki5a4vxphvc8cm8fnv4bmrx226a6nvvaj6ahs";
|
2019-01-07 18:25:57 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
postPatch = ''
|
2020-02-22 18:25:57 +00:00
|
|
|
substituteInPlace pyproject.toml \
|
2020-10-03 21:26:43 +01:00
|
|
|
--replace 'importlib-metadata = {version = "^1.6.0", python = "<3.8"}' \
|
|
|
|
'importlib-metadata = {version = ">=1.6,<2", python = "<3.8"}'
|
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 12:31:52 +01:00
|
|
|
cachecontrol
|
|
|
|
cachy
|
2020-02-22 18:25:57 +00:00
|
|
|
cleo
|
|
|
|
clikit
|
2020-06-21 12:31:52 +01:00
|
|
|
html5lib
|
|
|
|
keyring
|
|
|
|
lockfile
|
|
|
|
pexpect
|
2019-01-07 18:25:57 +00:00
|
|
|
pkginfo
|
2020-10-03 21:26:43 +01:00
|
|
|
poetry-core
|
2020-06-21 12:31:52 +01:00
|
|
|
requests
|
|
|
|
requests-toolbelt
|
2019-01-07 18:25:57 +00:00
|
|
|
shellingham
|
|
|
|
tomlkit
|
2020-10-03 21:26:43 +01:00
|
|
|
virtualenv
|
2020-06-21 12:31:52 +01: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-10-03 21:26:43 +01:00
|
|
|
checkInputs = [ pytestCheckHook httpretty pytest-mock pytestcov ];
|
2020-06-21 12:31:52 +01:00
|
|
|
preCheck = "export HOME=$TMPDIR";
|
|
|
|
disabledTests = [
|
|
|
|
# touches network
|
|
|
|
"git"
|
|
|
|
"solver"
|
|
|
|
"load"
|
|
|
|
"vcs"
|
|
|
|
"prereleases_if_they_are_compatible"
|
2020-10-03 21:26:43 +01:00
|
|
|
"test_executor"
|
2020-06-21 12:31:52 +01:00
|
|
|
# requires git history to work correctly
|
|
|
|
"default_with_excluded_data"
|
2020-08-16 21:33:47 +01:00
|
|
|
# toml ordering has changed
|
|
|
|
"lock"
|
2020-10-03 21:26:43 +01:00
|
|
|
# fs permission errors
|
|
|
|
"test_builder_should_execute_build_scripts"
|
2020-06-21 12:31:52 +01: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 ];
|
|
|
|
};
|
|
|
|
}
|