2022-01-13 20:06:32 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
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
|
2022-01-13 20:06:32 +00:00
|
|
|
, crashtest
|
|
|
|
, dataclasses
|
|
|
|
, entrypoints
|
|
|
|
, fetchFromGitHub
|
|
|
|
, fetchpatch
|
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
|
|
|
, pytest-mock
|
2022-01-13 20:06:32 +00:00
|
|
|
, pytestCheckHook
|
|
|
|
, pythonAtLeast
|
|
|
|
, pythonOlder
|
2020-06-15 15:56:04 +00:00
|
|
|
, 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-12-06 16:07:01 +00:00
|
|
|
version = "1.1.12";
|
2020-04-24 23:36:52 +00:00
|
|
|
format = "pyproject";
|
2022-01-13 20:06:32 +00:00
|
|
|
|
|
|
|
disabled = pythonOlder "3.6";
|
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-12-06 16:07:01 +00:00
|
|
|
sha256 = "1fm4yj6wxr24v7b77gmf63j7xsgszhbhzw2i9fvlfi0p9l0q34pm";
|
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
|
|
|
'';
|
|
|
|
|
2022-01-13 20:06:32 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
intreehooks
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
2020-06-15 15:56:04 +00:00
|
|
|
cachecontrol
|
|
|
|
cachy
|
2020-04-24 23:36:52 +00:00
|
|
|
cleo
|
|
|
|
clikit
|
2022-01-13 20:06:32 +00:00
|
|
|
crashtest
|
|
|
|
entrypoints
|
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
|
2022-01-13 20:06:32 +00:00
|
|
|
] ++ lib.optionals (pythonOlder "3.7") [
|
|
|
|
dataclasses
|
|
|
|
] ++ 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"
|
|
|
|
'';
|
|
|
|
|
2022-01-13 20:06:32 +00:00
|
|
|
checkInputs = [
|
|
|
|
pytestCheckHook
|
|
|
|
httpretty
|
|
|
|
pytest-mock
|
|
|
|
];
|
|
|
|
|
|
|
|
preCheck = ''
|
|
|
|
export HOME=$TMPDIR
|
|
|
|
'';
|
|
|
|
|
2020-06-15 15:56:04 +00:00
|
|
|
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"
|
2022-01-13 20:06:32 +00:00
|
|
|
] ++ lib.optionals (pythonAtLeast "3.10") [
|
|
|
|
# RuntimeError: 'auto_spec' might be a typo; use unsafe=True if this is intended
|
|
|
|
"test_info_setup_complex_pep517_error"
|
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
|
2022-01-13 20:06:32 +00:00
|
|
|
# pytest-mock. This is addressed upstream in
|
2020-12-09 12:39:15 +00:00
|
|
|
# https://github.com/python-poetry/poetry/pull/3457
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://github.com/python-poetry/poetry/commit/8ddceb7c52b3b1f35412479707fa790e5d60e691.diff";
|
|
|
|
sha256 = "yHjFb9xJBLFOqkOZaJolKviTdtST9PMFwH9n8ud2Y+U=";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2022-01-13 20:06:32 +00:00
|
|
|
# Allow for package to use pep420's native namespaces
|
|
|
|
pythonNamespaces = [
|
|
|
|
"poetry"
|
|
|
|
];
|
2021-09-26 12:46:18 +00:00
|
|
|
|
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 ];
|
|
|
|
};
|
|
|
|
}
|