11 poetry = self.callPackage ./unwrapped.nix { };
13 # The versions of Poetry and poetry-core need to match exactly,
14 # and poetry-core in nixpkgs requires a staging cycle to be updated,
15 # so apply an override here.
17 # We keep the override around even when the versions match, as
18 # it's likely to become relevant again after the next Poetry update.
19 poetry-core = super.poetry-core.overridePythonAttrs (old: rec {
21 src = fetchFromGitHub {
22 owner = "python-poetry";
25 hash = "sha256-3dmvFn2rxtR0SK8oiEHIVJhpJpX4Mm/6kZnIYNSDv90=";
33 disabledTests = old.disabledTests ++ [
35 "test_package_with_include"
36 # Nix changes timestamp
37 "test_dist_info_date_time_default_value"
38 "test_sdist_members_mtime_default"
39 "test_sdist_mtime_zero"
44 python = python3.override (old: {
46 packageOverrides = lib.composeManyExtensions (
47 (if old ? packageOverrides then [ old.packageOverrides ] else [ ]) ++ [ newPackageOverrides ]
53 poetry-audit-plugin = callPackage ./plugins/poetry-audit-plugin.nix { };
54 poetry-plugin-export = callPackage ./plugins/poetry-plugin-export.nix { };
55 poetry-plugin-up = callPackage ./plugins/poetry-plugin-up.nix { };
56 poetry-plugin-poeblix = callPackage ./plugins/poetry-plugin-poeblix.nix { };
57 poetry-plugin-shell = callPackage ./plugins/poetry-plugin-shell.nix { };
60 # selector is a function mapping pythonPackages to a list of plugins
61 # e.g. poetry.withPlugins (ps: with ps; [ poetry-plugin-up ])
65 selected = selector (plugins python.pkgs);
67 python.pkgs.toPythonApplication (
68 python.pkgs.poetry.overridePythonAttrs (old: {
69 dependencies = old.dependencies ++ selected;
71 # save some build time when adding plugins by disabling tests
72 doCheck = selected == [ ];
74 # Propagating dependencies leaks them through $PYTHONPATH which causes issues
75 # when used in nix-shell.
77 rm $out/nix-support/propagated-build-inputs
81 plugins = plugins python.pkgs;
82 inherit withPlugins python;