2020-09-25 04:45:31 +00:00
|
|
|
{ lib, buildPythonPackage, fetchFromGitHub, isPy27, pythonOlder, fetchpatch
|
2020-04-24 23:36:52 +00:00
|
|
|
, cachecontrol
|
2020-06-15 15:56:04 +00:00
|
|
|
, cachy
|
|
|
|
, cleo
|
2020-04-24 23:36:52 +00:00
|
|
|
, clikit
|
2020-06-15 15:56:04 +00:00
|
|
|
, html5lib
|
|
|
|
, httpretty
|
2020-04-24 23:36:52 +00:00
|
|
|
, importlib-metadata
|
|
|
|
, intreehooks
|
2020-06-15 15:56:04 +00:00
|
|
|
, keyring
|
2020-04-24 23:36:52 +00:00
|
|
|
, lockfile
|
2020-06-15 15:56:04 +00:00
|
|
|
, pexpect
|
|
|
|
, pkginfo
|
2020-10-07 09:15:18 +00:00
|
|
|
, poetry-core
|
2020-06-15 15:56:04 +00:00
|
|
|
, pytestCheckHook
|
2021-07-24 12:14:16 +00:00
|
|
|
, pytest-cov
|
2020-06-15 15:56:04 +00:00
|
|
|
, pytest-mock
|
|
|
|
, requests
|
|
|
|
, requests-toolbelt
|
|
|
|
, shellingham
|
|
|
|
, tomlkit
|
2020-10-07 09:15:18 +00:00
|
|
|
, virtualenv
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
2020-06-15 15:56:04 +00:00
|
|
|
buildPythonPackage rec {
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "poetry";
|
2021-07-14 22:03:04 +00:00
|
|
|
version = "1.1.7";
|
2020-04-24 23:36:52 +00:00
|
|
|
format = "pyproject";
|
2020-06-15 15:56:04 +00:00
|
|
|
disabled = isPy27;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2020-06-15 15:56:04 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "python-poetry";
|
|
|
|
repo = pname;
|
|
|
|
rev = version;
|
2021-07-14 22:03:04 +00:00
|
|
|
sha256 = "03cbzjw0sb8rs85iq191ndk9523d6qpymh2nhw5bvcxfvsf9042d";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace pyproject.toml \
|
2020-10-07 09:15:18 +00:00
|
|
|
--replace 'importlib-metadata = {version = "^1.6.0", python = "<3.8"}' \
|
2021-05-03 20:48:10 +00:00
|
|
|
'importlib-metadata = {version = ">=1.6", python = "<3.8"}' \
|
2021-04-26 19:14:03 +00:00
|
|
|
--replace 'version = "^21.2.0"' 'version = ">=21.2"'
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
nativeBuildInputs = [ intreehooks ];
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
2020-06-15 15:56:04 +00:00
|
|
|
cachecontrol
|
|
|
|
cachy
|
2020-04-24 23:36:52 +00:00
|
|
|
cleo
|
|
|
|
clikit
|
2020-06-15 15:56:04 +00:00
|
|
|
html5lib
|
|
|
|
keyring
|
|
|
|
lockfile
|
|
|
|
pexpect
|
2020-04-24 23:36:52 +00:00
|
|
|
pkginfo
|
2020-10-07 09:15:18 +00:00
|
|
|
poetry-core
|
2020-06-15 15:56:04 +00:00
|
|
|
requests
|
|
|
|
requests-toolbelt
|
2020-04-24 23:36:52 +00:00
|
|
|
shellingham
|
|
|
|
tomlkit
|
2020-10-07 09:15:18 +00:00
|
|
|
virtualenv
|
2020-06-15 15:56:04 +00:00
|
|
|
] ++ lib.optionals (pythonOlder "3.8") [ importlib-metadata ];
|
2020-04-24 23:36:52 +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"
|
|
|
|
'';
|
|
|
|
|
2021-07-24 12:14:16 +00:00
|
|
|
checkInputs = [ pytestCheckHook httpretty pytest-mock pytest-cov ];
|
2020-06-15 15:56:04 +00:00
|
|
|
preCheck = "export HOME=$TMPDIR";
|
|
|
|
disabledTests = [
|
|
|
|
# touches network
|
|
|
|
"git"
|
|
|
|
"solver"
|
|
|
|
"load"
|
|
|
|
"vcs"
|
|
|
|
"prereleases_if_they_are_compatible"
|
2020-10-07 09:15:18 +00:00
|
|
|
"test_executor"
|
2020-06-15 15:56:04 +00:00
|
|
|
# requires git history to work correctly
|
|
|
|
"default_with_excluded_data"
|
2020-09-25 04:45:31 +00:00
|
|
|
# toml ordering has changed
|
|
|
|
"lock"
|
2020-10-07 09:15:18 +00:00
|
|
|
# fs permission errors
|
|
|
|
"test_builder_should_execute_build_scripts"
|
2020-06-15 15:56:04 +00:00
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2020-12-09 12:39:15 +00:00
|
|
|
patches = [
|
|
|
|
# The following patch addresses a minor incompatibility with
|
|
|
|
# pytest-mock. This is addressed upstream in
|
|
|
|
# https://github.com/python-poetry/poetry/pull/3457
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://github.com/python-poetry/poetry/commit/8ddceb7c52b3b1f35412479707fa790e5d60e691.diff";
|
|
|
|
sha256 = "yHjFb9xJBLFOqkOZaJolKviTdtST9PMFwH9n8ud2Y+U=";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
meta = with lib; {
|
|
|
|
homepage = "https://python-poetry.org/";
|
|
|
|
description = "Python dependency management and packaging made easy";
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ jakewaksbaum ];
|
|
|
|
};
|
|
|
|
}
|