base16-schemes: unstable-2024-06-21 -> unstable-2024-11-12
[NixPkgs.git] / pkgs / by-name / po / poetry / unwrapped.nix
blob8e24ed705b48b017481eeeb1afd708cf313e9f05
1 { lib
2 , stdenv
3 , buildPythonPackage
4 , pythonOlder
5 , fetchFromGitHub
6 , installShellFiles
7 , build
8 , cachecontrol
9 , cleo
10 , crashtest
11 , dulwich
12 , fastjsonschema
13 , installer
14 , keyring
15 , packaging
16 , pexpect
17 , pkginfo
18 , platformdirs
19 , poetry-core
20 , poetry-plugin-export
21 , pyproject-hooks
22 , requests
23 , requests-toolbelt
24 , shellingham
25 , tomlkit
26 , trove-classifiers
27 , virtualenv
28 , xattr
29 , tomli
30 , importlib-metadata
31 , deepdiff
32 , pytestCheckHook
33 , httpretty
34 , pytest-mock
35 , pytest-xdist
36 , darwin
39 buildPythonPackage rec {
40   pname = "poetry";
41   version = "1.8.4";
42   pyproject = true;
44   disabled = pythonOlder "3.8";
46   src = fetchFromGitHub {
47     owner = "python-poetry";
48     repo = "poetry";
49     rev = "refs/tags/${version}";
50     hash = "sha256-pk57Jxf4hkMKLn1pOa9BtHLwLJ6qmXc55TqQN5Vr2k8=";
51   };
53   build-system = [
54     poetry-core
55   ];
57   nativeBuildInputs = [
58     installShellFiles
59   ];
61   pythonRelaxDeps = [
62     "dulwich"
63     "keyring"
64     "virtualenv"
65   ];
67   dependencies = [
68     build
69     cachecontrol
70     cleo
71     crashtest
72     dulwich
73     fastjsonschema
74     installer
75     keyring
76     packaging
77     pexpect
78     pkginfo
79     platformdirs
80     poetry-core
81     poetry-plugin-export
82     pyproject-hooks
83     requests
84     requests-toolbelt
85     shellingham
86     tomlkit
87     trove-classifiers
88     virtualenv
89   ] ++ lib.optionals (stdenv.hostPlatform.isDarwin) [
90     xattr
91   ] ++ lib.optionals (pythonOlder "3.11") [
92     tomli
93   ] ++ lib.optionals (pythonOlder "3.10") [
94     importlib-metadata
95   ] ++ cachecontrol.optional-dependencies.filecache;
97   postInstall = ''
98     installShellCompletion --cmd poetry \
99       --bash <($out/bin/poetry completions bash) \
100       --fish <($out/bin/poetry completions fish) \
101       --zsh <($out/bin/poetry completions zsh) \
102   '';
104   nativeCheckInputs = [
105     deepdiff
106     pytestCheckHook
107     httpretty
108     pytest-mock
109     pytest-xdist
110   ] ++ lib.optionals stdenv.hostPlatform.isDarwin [
111     darwin.ps
112   ];
114   preCheck = (''
115     export HOME=$TMPDIR
116   '' + lib.optionalString (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64) ''
117     # https://github.com/python/cpython/issues/74570#issuecomment-1093748531
118     export no_proxy='*';
119   '');
121   postCheck = lib.optionalString (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64) ''
122     unset no_proxy
123   '';
125   disabledTests = [
126     "test_builder_should_execute_build_scripts"
127     "test_env_system_packages_are_relative_to_lib"
128     "test_executor_known_hashes"
129     "test_install_warning_corrupt_root"
130   ];
132   pytestFlagsArray = [
133     "-m 'not network'"
134   ];
136   # Allow for package to use pep420's native namespaces
137   pythonNamespaces = [
138     "poetry"
139   ];
141   # Unset ambient PYTHONPATH in the wrapper, so Poetry only ever runs with its own,
142   # isolated set of dependencies. This works because the correct PYTHONPATH is set
143   # in the Python script, which runs after the wrapper.
144   makeWrapperArgs = ["--unset PYTHONPATH"];
146   meta = with lib; {
147     changelog = "https://github.com/python-poetry/poetry/blob/${src.rev}/CHANGELOG.md";
148     homepage = "https://python-poetry.org/";
149     description = "Python dependency management and packaging made easy";
150     license = licenses.mit;
151     maintainers = with maintainers; [ jakewaksbaum dotlambda ];
152     mainProgram = "poetry";
153   };