2023-01-31 22:27:39 -08:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
stdenv,
|
|
|
|
buildPythonPackage,
|
|
|
|
pythonOlder,
|
|
|
|
fetchFromGitHub,
|
2025-03-05 21:51:19 +02:00
|
|
|
findpython,
|
2023-01-31 22:27:39 -08:00
|
|
|
installShellFiles,
|
2023-03-03 22:05:48 +01:00
|
|
|
build,
|
2023-01-31 22:27:39 -08:00
|
|
|
cachecontrol,
|
|
|
|
cleo,
|
|
|
|
dulwich,
|
2024-01-12 16:06:17 +01:00
|
|
|
fastjsonschema,
|
2023-03-03 22:05:48 +01:00
|
|
|
installer,
|
2023-01-31 22:27:39 -08:00
|
|
|
keyring,
|
|
|
|
packaging,
|
2025-03-05 21:51:19 +02:00
|
|
|
pbs-installer,
|
2023-01-31 22:27:39 -08:00
|
|
|
pkginfo,
|
|
|
|
platformdirs,
|
|
|
|
poetry-core,
|
2023-03-03 22:05:48 +01:00
|
|
|
pyproject-hooks,
|
2023-01-31 22:27:39 -08:00
|
|
|
requests,
|
|
|
|
requests-toolbelt,
|
|
|
|
shellingham,
|
|
|
|
tomlkit,
|
|
|
|
trove-classifiers,
|
|
|
|
virtualenv,
|
|
|
|
xattr,
|
|
|
|
tomli,
|
|
|
|
importlib-metadata,
|
|
|
|
deepdiff,
|
|
|
|
pytestCheckHook,
|
|
|
|
httpretty,
|
|
|
|
pytest-mock,
|
|
|
|
pytest-xdist,
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "poetry";
|
2025-03-29 19:59:39 -07:00
|
|
|
version = "2.1.2";
|
2024-03-03 11:43:19 -08:00
|
|
|
pyproject = true;
|
2023-01-31 22:27:39 -08:00
|
|
|
|
2025-01-05 05:01:08 -08:00
|
|
|
disabled = pythonOlder "3.9";
|
2023-01-31 22:27:39 -08:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "python-poetry";
|
2024-02-25 09:07:21 -08:00
|
|
|
repo = "poetry";
|
2025-01-05 05:01:08 -08:00
|
|
|
tag = version;
|
2025-03-29 19:59:39 -07:00
|
|
|
hash = "sha256-51pO/PP5OwTmi+1uy26CK/1oQ/P21wPBoRVE9Jv0TjA=";
|
2023-01-31 22:27:39 -08:00
|
|
|
};
|
|
|
|
|
2024-10-14 12:27:14 -07:00
|
|
|
build-system = [
|
|
|
|
poetry-core
|
|
|
|
];
|
|
|
|
|
2023-01-31 22:27:39 -08:00
|
|
|
nativeBuildInputs = [
|
|
|
|
installShellFiles
|
|
|
|
];
|
|
|
|
|
2024-06-22 02:03:23 +09:00
|
|
|
pythonRelaxDeps = [
|
|
|
|
"dulwich"
|
|
|
|
"keyring"
|
2024-10-14 12:27:14 -07:00
|
|
|
"virtualenv"
|
2024-06-22 02:03:23 +09:00
|
|
|
];
|
|
|
|
|
2024-10-14 12:27:14 -07:00
|
|
|
dependencies =
|
|
|
|
[
|
2023-03-03 22:05:48 +01:00
|
|
|
build
|
2023-01-31 22:27:39 -08:00
|
|
|
cachecontrol
|
|
|
|
cleo
|
|
|
|
dulwich
|
2024-01-12 16:06:17 +01:00
|
|
|
fastjsonschema
|
2025-03-05 21:51:19 +02:00
|
|
|
findpython
|
2023-03-03 22:05:48 +01:00
|
|
|
installer
|
2023-01-31 22:27:39 -08:00
|
|
|
keyring
|
|
|
|
packaging
|
2025-03-05 21:51:19 +02:00
|
|
|
pbs-installer
|
2023-01-31 22:27:39 -08:00
|
|
|
pkginfo
|
|
|
|
platformdirs
|
|
|
|
poetry-core
|
2023-03-03 22:05:48 +01:00
|
|
|
pyproject-hooks
|
2023-01-31 22:27:39 -08:00
|
|
|
requests
|
|
|
|
requests-toolbelt
|
|
|
|
shellingham
|
|
|
|
tomlkit
|
|
|
|
trove-classifiers
|
|
|
|
virtualenv
|
|
|
|
]
|
|
|
|
++ lib.optionals (stdenv.hostPlatform.isDarwin) [
|
|
|
|
xattr
|
|
|
|
]
|
|
|
|
++ lib.optionals (pythonOlder "3.11") [
|
|
|
|
tomli
|
|
|
|
]
|
|
|
|
++ lib.optionals (pythonOlder "3.10") [
|
|
|
|
importlib-metadata
|
|
|
|
]
|
2025-03-05 21:51:19 +02:00
|
|
|
++ cachecontrol.optional-dependencies.filecache
|
|
|
|
++ pbs-installer.optional-dependencies.download
|
|
|
|
++ pbs-installer.optional-dependencies.install;
|
2023-01-31 22:27:39 -08:00
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
installShellCompletion --cmd poetry \
|
|
|
|
--bash <($out/bin/poetry completions bash) \
|
|
|
|
--fish <($out/bin/poetry completions fish) \
|
|
|
|
--zsh <($out/bin/poetry completions zsh) \
|
|
|
|
'';
|
|
|
|
|
2025-01-30 15:34:48 +11:00
|
|
|
nativeCheckInputs = [
|
|
|
|
deepdiff
|
|
|
|
pytestCheckHook
|
|
|
|
httpretty
|
|
|
|
pytest-mock
|
|
|
|
pytest-xdist
|
|
|
|
];
|
2024-12-10 20:26:33 +01:00
|
|
|
|
2023-01-31 22:27:39 -08:00
|
|
|
preCheck = (
|
|
|
|
''
|
|
|
|
export HOME=$TMPDIR
|
|
|
|
''
|
|
|
|
+ lib.optionalString (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64) ''
|
|
|
|
# https://github.com/python/cpython/issues/74570#issuecomment-1093748531
|
|
|
|
export no_proxy='*';
|
|
|
|
''
|
|
|
|
);
|
|
|
|
|
|
|
|
postCheck = lib.optionalString (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64) ''
|
|
|
|
unset no_proxy
|
|
|
|
'';
|
|
|
|
|
|
|
|
disabledTests = [
|
2024-02-25 09:07:21 -08:00
|
|
|
"test_builder_should_execute_build_scripts"
|
2023-11-04 16:56:57 -07:00
|
|
|
"test_env_system_packages_are_relative_to_lib"
|
|
|
|
"test_install_warning_corrupt_root"
|
2025-01-05 05:01:08 -08:00
|
|
|
"test_project_plugins_are_installed_in_project_folder"
|
2025-03-09 17:27:59 +01:00
|
|
|
"test_application_command_not_found_messages"
|
|
|
|
# PermissionError: [Errno 13] Permission denied: '/build/pytest-of-nixbld/pytest-0/popen-gw3/test_find_poetry_managed_pytho1/.local/share/pypoetry/python/pypy@3.10.8/bin/python'
|
|
|
|
"test_list_poetry_managed"
|
|
|
|
"test_list_poetry_managed"
|
|
|
|
"test_find_all_with_poetry_managed"
|
|
|
|
"test_find_poetry_managed_pythons"
|
2025-05-02 14:55:17 +02:00
|
|
|
# Flaky
|
|
|
|
"test_threading_property_types"
|
|
|
|
"test_threading_single_thread_safe"
|
|
|
|
"test_threading_property_caching"
|
|
|
|
"test_threading_atomic_cached_property_different_instances"
|
2024-02-25 09:07:21 -08:00
|
|
|
];
|
|
|
|
|
|
|
|
pytestFlagsArray = [
|
|
|
|
"-m 'not network'"
|
2023-01-31 22:27:39 -08:00
|
|
|
];
|
|
|
|
|
|
|
|
# Allow for package to use pep420's native namespaces
|
|
|
|
pythonNamespaces = [
|
|
|
|
"poetry"
|
|
|
|
];
|
|
|
|
|
2023-05-14 14:25:30 +03:00
|
|
|
# Unset ambient PYTHONPATH in the wrapper, so Poetry only ever runs with its own,
|
|
|
|
# isolated set of dependencies. This works because the correct PYTHONPATH is set
|
|
|
|
# in the Python script, which runs after the wrapper.
|
|
|
|
makeWrapperArgs = [ "--unset PYTHONPATH" ];
|
|
|
|
|
2023-01-31 22:27:39 -08:00
|
|
|
meta = with lib; {
|
|
|
|
changelog = "https://github.com/python-poetry/poetry/blob/${src.rev}/CHANGELOG.md";
|
|
|
|
homepage = "https://python-poetry.org/";
|
|
|
|
description = "Python dependency management and packaging made easy";
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [
|
|
|
|
jakewaksbaum
|
|
|
|
dotlambda
|
|
|
|
];
|
2023-11-27 02:17:53 +01:00
|
|
|
mainProgram = "poetry";
|
2023-01-31 22:27:39 -08:00
|
|
|
};
|
|
|
|
}
|