2022-01-13 20:06:32 +00:00
|
|
|
{ lib
|
2023-01-20 10:41:00 +00:00
|
|
|
, stdenv
|
|
|
|
, python3
|
2022-01-13 20:06:32 +00:00
|
|
|
, fetchFromGitHub
|
2022-09-30 11:47:45 +00:00
|
|
|
, installShellFiles
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
2023-01-20 10:41:00 +00:00
|
|
|
let
|
|
|
|
python = python3;
|
|
|
|
in python.pkgs.buildPythonApplication rec {
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "poetry";
|
2023-01-20 10:41:00 +00:00
|
|
|
version = "1.3.2";
|
2020-04-24 23:36:52 +00:00
|
|
|
format = "pyproject";
|
2022-01-13 20:06:32 +00:00
|
|
|
|
2023-01-20 10:41:00 +00:00
|
|
|
disabled = python.pkgs.pythonOlder "3.7";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2020-06-15 15:56:04 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "python-poetry";
|
|
|
|
repo = pname;
|
2022-09-30 11:47:45 +00:00
|
|
|
rev = "refs/tags/${version}";
|
2023-01-20 10:41:00 +00:00
|
|
|
hash = "sha256-12EiEGI9Vkb6EUY/W2KWeLigxWra1Be4ozvi8njBpEU=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2022-01-13 20:06:32 +00:00
|
|
|
nativeBuildInputs = [
|
2022-09-30 11:47:45 +00:00
|
|
|
installShellFiles
|
2022-01-13 20:06:32 +00:00
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-01-20 10:41:00 +00:00
|
|
|
propagatedBuildInputs = with python.pkgs; [
|
2020-06-15 15:56:04 +00:00
|
|
|
cachecontrol
|
2020-04-24 23:36:52 +00:00
|
|
|
cleo
|
2022-01-13 20:06:32 +00:00
|
|
|
crashtest
|
2022-09-30 11:47:45 +00:00
|
|
|
dulwich
|
2023-01-20 10:41:00 +00:00
|
|
|
filelock
|
2020-06-15 15:56:04 +00:00
|
|
|
html5lib
|
2022-09-30 11:47:45 +00:00
|
|
|
jsonschema
|
2020-06-15 15:56:04 +00:00
|
|
|
keyring
|
2022-01-26 04:04:25 +00:00
|
|
|
packaging
|
2020-06-15 15:56:04 +00:00
|
|
|
pexpect
|
2020-04-24 23:36:52 +00:00
|
|
|
pkginfo
|
2022-09-30 11:47:45 +00:00
|
|
|
platformdirs
|
2020-10-07 09:15:18 +00:00
|
|
|
poetry-core
|
2022-09-30 11:47:45 +00:00
|
|
|
poetry-plugin-export
|
2020-06-15 15:56:04 +00:00
|
|
|
requests
|
|
|
|
requests-toolbelt
|
2020-04-24 23:36:52 +00:00
|
|
|
shellingham
|
|
|
|
tomlkit
|
2023-01-20 10:41:00 +00:00
|
|
|
trove-classifiers
|
2020-10-07 09:15:18 +00:00
|
|
|
virtualenv
|
2022-09-30 11:47:45 +00:00
|
|
|
] ++ lib.optionals (stdenv.isDarwin) [
|
|
|
|
xattr
|
2023-01-20 10:41:00 +00:00
|
|
|
] ++ lib.optionals (pythonOlder "3.11") [
|
|
|
|
tomli
|
2022-09-30 11:47:45 +00:00
|
|
|
] ++ lib.optionals (pythonOlder "3.10") [
|
2022-01-13 20:06:32 +00:00
|
|
|
importlib-metadata
|
2022-09-30 11:47:45 +00:00
|
|
|
] ++ lib.optionals (pythonOlder "3.8") [
|
|
|
|
backports-cached-property
|
|
|
|
] ++ cachecontrol.optional-dependencies.filecache;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
postInstall = ''
|
2022-09-30 11:47:45 +00:00
|
|
|
installShellCompletion --cmd poetry \
|
|
|
|
--bash <($out/bin/poetry completions bash) \
|
|
|
|
--fish <($out/bin/poetry completions fish) \
|
|
|
|
--zsh <($out/bin/poetry completions zsh) \
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2023-01-20 10:41:00 +00:00
|
|
|
# Propagating dependencies leaks them through $PYTHONPATH which causes issues
|
|
|
|
# when used in nix-shell.
|
|
|
|
postFixup = ''
|
|
|
|
rm $out/nix-support/propagated-build-inputs
|
|
|
|
'';
|
|
|
|
|
|
|
|
checkInputs = with python.pkgs; [
|
|
|
|
cachy
|
2022-09-30 11:47:45 +00:00
|
|
|
deepdiff
|
|
|
|
flatdict
|
2022-01-13 20:06:32 +00:00
|
|
|
pytestCheckHook
|
|
|
|
httpretty
|
|
|
|
pytest-mock
|
2022-09-30 11:47:45 +00:00
|
|
|
pytest-xdist
|
2022-01-13 20:06:32 +00:00
|
|
|
];
|
|
|
|
|
2022-10-30 15:09:59 +00:00
|
|
|
preCheck = (''
|
2022-01-13 20:06:32 +00:00
|
|
|
export HOME=$TMPDIR
|
2022-10-30 15:09:59 +00:00
|
|
|
'' + lib.optionalString (stdenv.isDarwin && stdenv.isAarch64) ''
|
|
|
|
# https://github.com/python/cpython/issues/74570#issuecomment-1093748531
|
|
|
|
export no_proxy='*';
|
|
|
|
'');
|
|
|
|
|
|
|
|
postCheck = lib.optionalString (stdenv.isDarwin && stdenv.isAarch64) ''
|
|
|
|
unset no_proxy
|
2022-01-13 20:06:32 +00:00
|
|
|
'';
|
|
|
|
|
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"
|
2023-01-20 10:41:00 +00:00
|
|
|
] ++ lib.optionals (python.pythonAtLeast "3.10") [
|
2022-01-13 20:06:32 +00:00
|
|
|
# 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
|
|
|
|
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; {
|
2023-01-20 10:41:00 +00:00
|
|
|
changelog = "https://github.com/python-poetry/poetry/blob/${src.rev}/CHANGELOG.md";
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://python-poetry.org/";
|
|
|
|
description = "Python dependency management and packaging made easy";
|
|
|
|
license = licenses.mit;
|
2023-01-20 10:41:00 +00:00
|
|
|
maintainers = with maintainers; [ jakewaksbaum dotlambda ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|