From e0816431a23a06692d86c0b545b4522b9a9bc939 Mon Sep 17 00:00:00 2001 From: adisbladis Date: Fri, 2 Aug 2024 23:10:35 +1200 Subject: [PATCH] treewide: Pass self when overriding Python Otherwise references to the Python interpreter inside the set are wrong, as demonstrated by: ``` nix with import { }; let python' = python3.override { packageOverrides = final: prev: { requests = prev.requests.overridePythonAttrs(old: { version = "1337"; }); }; }; in python'.pkgs.python.pkgs.requests ``` which returns the _non_ overriden requests. And the same with `self`: ``` with import { }; let python' = python3.override { self = python'; packageOverrides = final: prev: { requests = prev.requests.overridePythonAttrs(old: { version = "1337"; }); }; }; in python'.pkgs.python.pkgs.requests ``` which returns the overriden requests. This can manifest itself as file collisions when constructing environments or as subtly incorrect dependency graphs. --- pkgs/applications/gis/qgis/unwrapped-ltr.nix | 1 + pkgs/applications/gis/qgis/unwrapped.nix | 1 + pkgs/applications/graphics/textual-paint/default.nix | 1 + pkgs/applications/misc/archivebox/default.nix | 1 + pkgs/applications/misc/archivy/default.nix | 1 + pkgs/applications/misc/dbx/default.nix | 2 +- pkgs/applications/misc/haxor-news/default.nix | 3 +-- pkgs/applications/misc/pytrainer/default.nix | 1 + pkgs/applications/misc/tandoor-recipes/default.nix | 1 + pkgs/applications/networking/cluster/nixops/default.nix | 1 + .../networking/instant-messengers/turses/default.nix | 1 + .../networking/instant-messengers/zulip-term/default.nix | 1 + pkgs/applications/networking/seahub/default.nix | 1 + pkgs/applications/office/paperless-ngx/default.nix | 1 + pkgs/applications/version-management/sourcehut/default.nix | 1 + pkgs/applications/video/catt/default.nix | 1 + pkgs/applications/video/frigate/default.nix | 1 + pkgs/applications/video/pyca/default.nix | 2 +- pkgs/by-name/az/azure-cli/python-packages.nix | 1 + pkgs/by-name/ca/calibre-web/package.nix | 1 + pkgs/by-name/ch/charmcraft/package.nix | 1 + pkgs/by-name/gd/gdtoolkit_3/package.nix | 1 + pkgs/by-name/gd/gdtoolkit_4/package.nix | 1 + pkgs/by-name/ir/irrd/package.nix | 2 +- pkgs/by-name/mu/music-assistant/package.nix | 1 + pkgs/by-name/na/nanopb/package.nix | 2 +- pkgs/by-name/od/odoo/package.nix | 1 + pkgs/by-name/od/odoo15/package.nix | 1 + pkgs/by-name/od/odoo16/package.nix | 1 + pkgs/by-name/pa/pacu/package.nix | 1 + pkgs/by-name/pa/parsedmarc/package.nix | 1 + pkgs/by-name/pr/pretalx/package.nix | 1 + pkgs/by-name/pr/pretix/package.nix | 1 + pkgs/by-name/ro/rockcraft/package.nix | 1 + pkgs/by-name/sn/snapcraft/package.nix | 1 + pkgs/by-name/yt/yt-dlg/package.nix | 7 +++++-- .../tools/continuous-integration/buildbot/default.nix | 1 + pkgs/development/tools/dt-schema/default.nix | 2 +- pkgs/servers/apache-airflow/default.nix | 1 + pkgs/servers/baserow/default.nix | 1 + pkgs/servers/etebase/default.nix | 1 + pkgs/servers/geospatial/fit-trackee/default.nix | 1 + pkgs/servers/home-assistant/default.nix | 1 + pkgs/servers/mail/mailman/python.nix | 5 +++-- pkgs/servers/mautrix-telegram/default.nix | 1 + pkgs/servers/samba/4.x.nix | 1 + pkgs/servers/web-apps/healthchecks/default.nix | 1 + pkgs/tools/admin/gimme-aws-creds/default.nix | 1 + pkgs/tools/admin/gixy/default.nix | 1 + pkgs/tools/admin/oci-cli/default.nix | 1 + pkgs/tools/audio/piper/train.nix | 5 +---- pkgs/tools/audio/tts/default.nix | 1 + pkgs/tools/filesystems/ceph/default.nix | 1 + pkgs/tools/misc/diffoscope/default.nix | 1 + pkgs/tools/misc/esphome/default.nix | 1 + pkgs/tools/misc/lektor/default.nix | 1 + pkgs/tools/misc/ntfy/default.nix | 1 + pkgs/tools/misc/tvnamer/default.nix | 1 + pkgs/tools/networking/maubot/default.nix | 1 + pkgs/tools/networking/p2p/tahoe-lafs/default.nix | 1 + pkgs/tools/nix/nixos-render-docs/default.nix | 1 + pkgs/tools/package-management/poetry/default.nix | 1 + pkgs/tools/security/expliot/default.nix | 1 + pkgs/tools/security/ioccheck/default.nix | 1 + pkgs/tools/security/netexec/default.nix | 1 + pkgs/tools/security/ssh-mitm/default.nix | 1 + pkgs/tools/text/mrkd/default.nix | 1 + 67 files changed, 73 insertions(+), 15 deletions(-) diff --git a/pkgs/applications/gis/qgis/unwrapped-ltr.nix b/pkgs/applications/gis/qgis/unwrapped-ltr.nix index 95ea7ffdfee3..5e55f8c75e3e 100644 --- a/pkgs/applications/gis/qgis/unwrapped-ltr.nix +++ b/pkgs/applications/gis/qgis/unwrapped-ltr.nix @@ -49,6 +49,7 @@ let py = python311.override { + self = py; packageOverrides = self: super: { pyqt5 = super.pyqt5.override { withLocation = true; diff --git a/pkgs/applications/gis/qgis/unwrapped.nix b/pkgs/applications/gis/qgis/unwrapped.nix index 585d664ab795..4ac26a0c804b 100644 --- a/pkgs/applications/gis/qgis/unwrapped.nix +++ b/pkgs/applications/gis/qgis/unwrapped.nix @@ -49,6 +49,7 @@ let py = python311.override { + self = py; packageOverrides = self: super: { pyqt5 = super.pyqt5.override { withLocation = true; diff --git a/pkgs/applications/graphics/textual-paint/default.nix b/pkgs/applications/graphics/textual-paint/default.nix index c11a5cd632d7..c59ac7b8140e 100644 --- a/pkgs/applications/graphics/textual-paint/default.nix +++ b/pkgs/applications/graphics/textual-paint/default.nix @@ -7,6 +7,7 @@ let python = python3.override { + self = python; packageOverrides = _: super: { pillow = super.pillow.overridePythonAttrs rec { version = "9.5.0"; diff --git a/pkgs/applications/misc/archivebox/default.nix b/pkgs/applications/misc/archivebox/default.nix index 996c11292ab1..4344c6e7e91d 100644 --- a/pkgs/applications/misc/archivebox/default.nix +++ b/pkgs/applications/misc/archivebox/default.nix @@ -15,6 +15,7 @@ let python = python3.override { + self = python; packageOverrides = self: super: { django = super.django_3.overridePythonAttrs (old: rec { version = "3.1.14"; diff --git a/pkgs/applications/misc/archivy/default.nix b/pkgs/applications/misc/archivy/default.nix index 0bb9a89325e5..902bc903bf46 100644 --- a/pkgs/applications/misc/archivy/default.nix +++ b/pkgs/applications/misc/archivy/default.nix @@ -5,6 +5,7 @@ let py = python3.override { + self = py; packageOverrides = self: super: { wtforms = super.wtforms.overridePythonAttrs (oldAttrs: rec { version = "2.3.1"; diff --git a/pkgs/applications/misc/dbx/default.nix b/pkgs/applications/misc/dbx/default.nix index 21f9e52ff84d..294bc33a0ba7 100644 --- a/pkgs/applications/misc/dbx/default.nix +++ b/pkgs/applications/misc/dbx/default.nix @@ -5,7 +5,7 @@ python3, }: let - python = python3.override { packageOverrides = self: super: { pydantic = super.pydantic_1; }; }; + python = python3.override { self = python; packageOverrides = self: super: { pydantic = super.pydantic_1; }; }; in python.pkgs.buildPythonApplication rec { pname = "dbx"; diff --git a/pkgs/applications/misc/haxor-news/default.nix b/pkgs/applications/misc/haxor-news/default.nix index d5ea27c9d50b..8eedf7bc47b5 100644 --- a/pkgs/applications/misc/haxor-news/default.nix +++ b/pkgs/applications/misc/haxor-news/default.nix @@ -3,9 +3,8 @@ let py = python3.override { + self = py; packageOverrides = self: super: { - self = py; - # not compatible with prompt_toolkit >=2.0 prompt-toolkit = super.prompt-toolkit.overridePythonAttrs (oldAttrs: rec { name = "${oldAttrs.pname}-${version}"; diff --git a/pkgs/applications/misc/pytrainer/default.nix b/pkgs/applications/misc/pytrainer/default.nix index 296a81e075da..a1c28898311b 100644 --- a/pkgs/applications/misc/pytrainer/default.nix +++ b/pkgs/applications/misc/pytrainer/default.nix @@ -18,6 +18,7 @@ let python = python310.override { + self = python; packageOverrides = (self: super: { matplotlib = super.matplotlib.override { enableGtk3 = true; diff --git a/pkgs/applications/misc/tandoor-recipes/default.nix b/pkgs/applications/misc/tandoor-recipes/default.nix index 7114cbb3cf76..489c1fefc7e7 100644 --- a/pkgs/applications/misc/tandoor-recipes/default.nix +++ b/pkgs/applications/misc/tandoor-recipes/default.nix @@ -6,6 +6,7 @@ let # python-ldap-3.4.4 does not work with python3(12) python = python311.override { + self = python; packageOverrides = self: super: { validators = super.validators.overridePythonAttrs (_: rec { version = "0.20.0"; diff --git a/pkgs/applications/networking/cluster/nixops/default.nix b/pkgs/applications/networking/cluster/nixops/default.nix index 75902de1b9f6..5cbd49e2f562 100644 --- a/pkgs/applications/networking/cluster/nixops/default.nix +++ b/pkgs/applications/networking/cluster/nixops/default.nix @@ -12,6 +12,7 @@ let nixopsContextBase = this: { python = python3.override { + self = this.python; packageOverrides = self: super: { nixops = self.callPackage ./unwrapped.nix { }; } // (this.plugins self super); diff --git a/pkgs/applications/networking/instant-messengers/turses/default.nix b/pkgs/applications/networking/instant-messengers/turses/default.nix index d6d403322c05..0df36afc3fdf 100644 --- a/pkgs/applications/networking/instant-messengers/turses/default.nix +++ b/pkgs/applications/networking/instant-messengers/turses/default.nix @@ -7,6 +7,7 @@ let py = python3.override { + self = py; packageOverrides = self: super: { # Support for later tweepy releases is missing diff --git a/pkgs/applications/networking/instant-messengers/zulip-term/default.nix b/pkgs/applications/networking/instant-messengers/zulip-term/default.nix index 092cb3299990..7c741216df11 100644 --- a/pkgs/applications/networking/instant-messengers/zulip-term/default.nix +++ b/pkgs/applications/networking/instant-messengers/zulip-term/default.nix @@ -7,6 +7,7 @@ let py = python3.override { + self = py; packageOverrides = self: super: { # Requires "urwid~=2.1.2", otherwise some tests are failing diff --git a/pkgs/applications/networking/seahub/default.nix b/pkgs/applications/networking/seahub/default.nix index 20cdf386257e..604ba4772710 100644 --- a/pkgs/applications/networking/seahub/default.nix +++ b/pkgs/applications/networking/seahub/default.nix @@ -7,6 +7,7 @@ }: let python = python3.override { + self = python; packageOverrides = self: super: { django = super.django_3; }; diff --git a/pkgs/applications/office/paperless-ngx/default.nix b/pkgs/applications/office/paperless-ngx/default.nix index 0107627a72d1..1a2c11cf2023 100644 --- a/pkgs/applications/office/paperless-ngx/default.nix +++ b/pkgs/applications/office/paperless-ngx/default.nix @@ -37,6 +37,7 @@ let # https://github.com/NixOS/nixpkgs/issues/298719 # https://github.com/paperless-ngx/paperless-ngx/issues/5494 python = python3.override { + self = python; packageOverrides = final: prev: { # tesseract5 may be overwritten in the paperless module and we need to propagate that to make the closure reduction effective ocrmypdf = prev.ocrmypdf.override { tesseract = tesseract5; }; diff --git a/pkgs/applications/version-management/sourcehut/default.nix b/pkgs/applications/version-management/sourcehut/default.nix index 050651556a72..147257dc3d5d 100644 --- a/pkgs/applications/version-management/sourcehut/default.nix +++ b/pkgs/applications/version-management/sourcehut/default.nix @@ -13,6 +13,7 @@ # https://github.com/NixOS/nixpkgs/pull/54425#discussion_r250688781 let python = python3.override { + self = python; packageOverrides = self: super: { srht = self.callPackage ./core.nix { }; diff --git a/pkgs/applications/video/catt/default.nix b/pkgs/applications/video/catt/default.nix index d8aa3e44b2c3..f6bdde3577be 100644 --- a/pkgs/applications/video/catt/default.nix +++ b/pkgs/applications/video/catt/default.nix @@ -6,6 +6,7 @@ let python = python3.override { + self = python; packageOverrides = self: super: { pychromecast = super.pychromecast.overridePythonAttrs (_: rec { version = "13.1.0"; diff --git a/pkgs/applications/video/frigate/default.nix b/pkgs/applications/video/frigate/default.nix index 060046f59f03..311e585b2d47 100644 --- a/pkgs/applications/video/frigate/default.nix +++ b/pkgs/applications/video/frigate/default.nix @@ -24,6 +24,7 @@ let }; python = python311.override { + self = python; packageOverrides = self: super: { pydantic = super.pydantic_1; diff --git a/pkgs/applications/video/pyca/default.nix b/pkgs/applications/video/pyca/default.nix index 5ca1e59d107b..52463c468931 100644 --- a/pkgs/applications/video/pyca/default.nix +++ b/pkgs/applications/video/pyca/default.nix @@ -8,6 +8,7 @@ let python = python3.override { + self = python; packageOverrides = self: super: { # pyCA is incompatible with SQLAlchemy 2.0 sqlalchemy = super.sqlalchemy_1_4; @@ -80,4 +81,3 @@ python3.pkgs.buildPythonApplication rec { maintainers = with maintainers; [ pmiddend ]; }; } - diff --git a/pkgs/by-name/az/azure-cli/python-packages.nix b/pkgs/by-name/az/azure-cli/python-packages.nix index 48a7a6670169..fc15dc4aba24 100644 --- a/pkgs/by-name/az/azure-cli/python-packages.nix +++ b/pkgs/by-name/az/azure-cli/python-packages.nix @@ -23,6 +23,7 @@ let }); py = python3.override { + self = py; packageOverrides = self: super: { inherit buildAzureCliPackage; diff --git a/pkgs/by-name/ca/calibre-web/package.nix b/pkgs/by-name/ca/calibre-web/package.nix index 75da25427c3b..397b9e76cfc4 100644 --- a/pkgs/by-name/ca/calibre-web/package.nix +++ b/pkgs/by-name/ca/calibre-web/package.nix @@ -7,6 +7,7 @@ let python = python3.override { + self = python; packageOverrides = self: super: { sqlalchemy = super.sqlalchemy_1_4; }; diff --git a/pkgs/by-name/ch/charmcraft/package.nix b/pkgs/by-name/ch/charmcraft/package.nix index fc5ef145d1bc..1f792167d740 100644 --- a/pkgs/by-name/ch/charmcraft/package.nix +++ b/pkgs/by-name/ch/charmcraft/package.nix @@ -8,6 +8,7 @@ let python = python3.override { + self = python; packageOverrides = self: super: { pydantic-yaml = super.pydantic-yaml.overridePythonAttrs (old: rec { version = "0.11.2"; diff --git a/pkgs/by-name/gd/gdtoolkit_3/package.nix b/pkgs/by-name/gd/gdtoolkit_3/package.nix index 6b6abbfc4026..01b6a15e0e10 100644 --- a/pkgs/by-name/gd/gdtoolkit_3/package.nix +++ b/pkgs/by-name/gd/gdtoolkit_3/package.nix @@ -5,6 +5,7 @@ let python = python3.override { + self = python; packageOverrides = self: super: { lark = super.lark.overridePythonAttrs (old: rec { # gdtoolkit needs exactly this lark version diff --git a/pkgs/by-name/gd/gdtoolkit_4/package.nix b/pkgs/by-name/gd/gdtoolkit_4/package.nix index 6f4a25602ee2..0f54bd3385ed 100644 --- a/pkgs/by-name/gd/gdtoolkit_4/package.nix +++ b/pkgs/by-name/gd/gdtoolkit_4/package.nix @@ -5,6 +5,7 @@ let python = python3.override { + self = python; packageOverrides = self: super: { lark = super.lark.overridePythonAttrs (old: rec { # gdtoolkit needs exactly this lark version diff --git a/pkgs/by-name/ir/irrd/package.nix b/pkgs/by-name/ir/irrd/package.nix index b6d323129abd..581576f68fb3 100644 --- a/pkgs/by-name/ir/irrd/package.nix +++ b/pkgs/by-name/ir/irrd/package.nix @@ -11,6 +11,7 @@ let py = python3.override { + self = py; packageOverrides = final: prev: { # sqlalchemy 1.4.x or 2.x are not supported sqlalchemy = prev.sqlalchemy.overridePythonAttrs (oldAttrs: rec { @@ -174,4 +175,3 @@ py.pkgs.buildPythonPackage rec { maintainers = teams.wdz.members; }; } - diff --git a/pkgs/by-name/mu/music-assistant/package.nix b/pkgs/by-name/mu/music-assistant/package.nix index ba7d00824652..fcdd7277b758 100644 --- a/pkgs/by-name/mu/music-assistant/package.nix +++ b/pkgs/by-name/mu/music-assistant/package.nix @@ -9,6 +9,7 @@ let python = python3.override { + self = python; packageOverrides = self: super: { music-assistant-frontend = self.callPackage ./frontend.nix { }; }; diff --git a/pkgs/by-name/na/nanopb/package.nix b/pkgs/by-name/na/nanopb/package.nix index bd14e9d8c75b..bfd72b7214f6 100644 --- a/pkgs/by-name/na/nanopb/package.nix +++ b/pkgs/by-name/na/nanopb/package.nix @@ -26,6 +26,7 @@ let inherit (self.passthru) generator-out; }; python3 = buildPackages.python3.override { + self = python3; packageOverrides = _: _: { nanopb-proto = self.passthru.python-module; }; @@ -119,4 +120,3 @@ in ''; }; }) - diff --git a/pkgs/by-name/od/odoo/package.nix b/pkgs/by-name/od/odoo/package.nix index fe3a7aed3681..fd3768bcd742 100644 --- a/pkgs/by-name/od/odoo/package.nix +++ b/pkgs/by-name/od/odoo/package.nix @@ -11,6 +11,7 @@ let python = python310.override { + self = python; packageOverrides = final: prev: { # requirements.txt fixes docutils at 0.17; the default 0.21.1 tested throws exceptions docutils-0_17 = prev.docutils.overridePythonAttrs (old: rec { diff --git a/pkgs/by-name/od/odoo15/package.nix b/pkgs/by-name/od/odoo15/package.nix index ae39beb4a6d9..0ea859435e9e 100644 --- a/pkgs/by-name/od/odoo15/package.nix +++ b/pkgs/by-name/od/odoo15/package.nix @@ -3,6 +3,7 @@ let python = python310.override { + self = python; packageOverrides = self: super: { pypdf2 = super.pypdf2.overridePythonAttrs (old: rec { version = "1.28.6"; diff --git a/pkgs/by-name/od/odoo16/package.nix b/pkgs/by-name/od/odoo16/package.nix index 0dba5841035d..91e634a13b22 100644 --- a/pkgs/by-name/od/odoo16/package.nix +++ b/pkgs/by-name/od/odoo16/package.nix @@ -8,6 +8,7 @@ let python = python310.override { + self = python; packageOverrides = self: super: { flask = super.flask.overridePythonAttrs (old: rec { version = "2.3.3"; diff --git a/pkgs/by-name/pa/pacu/package.nix b/pkgs/by-name/pa/pacu/package.nix index 5c87d124ee96..0ee1f4f1c8cc 100644 --- a/pkgs/by-name/pa/pacu/package.nix +++ b/pkgs/by-name/pa/pacu/package.nix @@ -7,6 +7,7 @@ let python = python3.override { + self = python; packageOverrides = self: super: { sqlalchemy = super.sqlalchemy_1_4; }; }; in diff --git a/pkgs/by-name/pa/parsedmarc/package.nix b/pkgs/by-name/pa/parsedmarc/package.nix index 6c08dced6326..acc8cee9782b 100644 --- a/pkgs/by-name/pa/parsedmarc/package.nix +++ b/pkgs/by-name/pa/parsedmarc/package.nix @@ -4,6 +4,7 @@ let python = python3.override { + self = python; packageOverrides = self: super: { # https://github.com/domainaware/parsedmarc/issues/464 msgraph-core = super.msgraph-core.overridePythonAttrs (old: rec { diff --git a/pkgs/by-name/pr/pretalx/package.nix b/pkgs/by-name/pr/pretalx/package.nix index 6313a6748b8d..e3838cdb7d8f 100644 --- a/pkgs/by-name/pr/pretalx/package.nix +++ b/pkgs/by-name/pr/pretalx/package.nix @@ -10,6 +10,7 @@ let python = python3.override { + self = python; packageOverrides = final: prev: { django-bootstrap4 = prev.django-bootstrap4.overridePythonAttrs (oldAttrs: rec { version = "3.0.0"; diff --git a/pkgs/by-name/pr/pretix/package.nix b/pkgs/by-name/pr/pretix/package.nix index 40a51c1458d1..2b7e8676d180 100644 --- a/pkgs/by-name/pr/pretix/package.nix +++ b/pkgs/by-name/pr/pretix/package.nix @@ -11,6 +11,7 @@ let python = python3.override { + self = python; packageOverrides = self: super: { django = super.django_4; diff --git a/pkgs/by-name/ro/rockcraft/package.nix b/pkgs/by-name/ro/rockcraft/package.nix index 48b95df85b52..7b581363ee68 100644 --- a/pkgs/by-name/ro/rockcraft/package.nix +++ b/pkgs/by-name/ro/rockcraft/package.nix @@ -8,6 +8,7 @@ let python = python3.override { + self = python; packageOverrides = self: super: { craft-application = super.craft-application.overridePythonAttrs (old: rec { version = "1.2.1"; diff --git a/pkgs/by-name/sn/snapcraft/package.nix b/pkgs/by-name/sn/snapcraft/package.nix index 1af08c97fd1a..7e5164eb529d 100644 --- a/pkgs/by-name/sn/snapcraft/package.nix +++ b/pkgs/by-name/sn/snapcraft/package.nix @@ -12,6 +12,7 @@ let python = python3.override { + self = python; packageOverrides = self: super: { pydantic-yaml = super.pydantic-yaml.overridePythonAttrs (old: rec { version = "0.11.2"; diff --git a/pkgs/by-name/yt/yt-dlg/package.nix b/pkgs/by-name/yt/yt-dlg/package.nix index 8cc4d65b2a91..ee5f288b5ab1 100644 --- a/pkgs/by-name/yt/yt-dlg/package.nix +++ b/pkgs/by-name/yt/yt-dlg/package.nix @@ -5,7 +5,7 @@ fetchPypi }: let - python3Packages = + python3' = (python3.override { packageOverrides = final: prev: { wxpython = prev.wxpython.overrideAttrs rec { @@ -17,7 +17,10 @@ let }; }; }; - }).pkgs; + }); + + python3Packages = python3'.pkgs; + in python3Packages.buildPythonApplication rec { pname = "yt-dlg"; diff --git a/pkgs/development/tools/continuous-integration/buildbot/default.nix b/pkgs/development/tools/continuous-integration/buildbot/default.nix index b2ec827f7526..daffa9165162 100644 --- a/pkgs/development/tools/continuous-integration/buildbot/default.nix +++ b/pkgs/development/tools/continuous-integration/buildbot/default.nix @@ -6,6 +6,7 @@ # Take packages from self first, then python.pkgs (and secondarily pkgs) lib.makeScope (self: newScope (self.python.pkgs // self)) (self: { python = python3.override { + self = self.python; packageOverrides = self: super: { sqlalchemy = super.sqlalchemy_1_4; moto = super.moto.overridePythonAttrs (oldAttrs: { diff --git a/pkgs/development/tools/dt-schema/default.nix b/pkgs/development/tools/dt-schema/default.nix index 5736d301b32d..c1a16d729bb6 100644 --- a/pkgs/development/tools/dt-schema/default.nix +++ b/pkgs/development/tools/dt-schema/default.nix @@ -3,6 +3,7 @@ }: let python = python3.override { + self = python; packageOverrides = self: super: { # see https://github.com/devicetree-org/dt-schema/issues/108 jsonschema = super.jsonschema.overridePythonAttrs (old: rec { @@ -27,4 +28,3 @@ let python = python3.override { }); }; }; in python.pkgs.toPythonApplication python.pkgs.dtschema - diff --git a/pkgs/servers/apache-airflow/default.nix b/pkgs/servers/apache-airflow/default.nix index 1055f79806d4..48df7ea612b4 100644 --- a/pkgs/servers/apache-airflow/default.nix +++ b/pkgs/servers/apache-airflow/default.nix @@ -5,6 +5,7 @@ let python = python3.override { + self = python; packageOverrides = pySelf: pySuper: { connexion = pySuper.connexion.overridePythonAttrs (o: rec { version = "2.14.2"; diff --git a/pkgs/servers/baserow/default.nix b/pkgs/servers/baserow/default.nix index bfc905175084..c42dc0d55a31 100644 --- a/pkgs/servers/baserow/default.nix +++ b/pkgs/servers/baserow/default.nix @@ -8,6 +8,7 @@ let python = python3.override { + self = python; packageOverrides = self: super: { antlr4-python3-runtime = super.antlr4-python3-runtime.override { antlr4 = antlr4_9; diff --git a/pkgs/servers/etebase/default.nix b/pkgs/servers/etebase/default.nix index 6076bb161fa3..2d22f510b387 100644 --- a/pkgs/servers/etebase/default.nix +++ b/pkgs/servers/etebase/default.nix @@ -9,6 +9,7 @@ let python = python3.override { + self = python; packageOverrides = self: super: { pydantic = super.pydantic_1; }; diff --git a/pkgs/servers/geospatial/fit-trackee/default.nix b/pkgs/servers/geospatial/fit-trackee/default.nix index 587fb24c2087..f6c4da43a8e3 100644 --- a/pkgs/servers/geospatial/fit-trackee/default.nix +++ b/pkgs/servers/geospatial/fit-trackee/default.nix @@ -7,6 +7,7 @@ }: let python = python3.override { + self = python; packageOverrides = self: super: { sqlalchemy = super.sqlalchemy_1_4; diff --git a/pkgs/servers/home-assistant/default.nix b/pkgs/servers/home-assistant/default.nix index a57f0d32c4a6..58c20cd01fc2 100644 --- a/pkgs/servers/home-assistant/default.nix +++ b/pkgs/servers/home-assistant/default.nix @@ -451,6 +451,7 @@ let ]; python = python312.override { + self = python; packageOverrides = lib.composeManyExtensions (defaultOverrides ++ [ packageOverrides ]); }; diff --git a/pkgs/servers/mail/mailman/python.nix b/pkgs/servers/mail/mailman/python.nix index 933b8357a33d..9eddfea2e51c 100644 --- a/pkgs/servers/mail/mailman/python.nix +++ b/pkgs/servers/mail/mailman/python.nix @@ -1,6 +1,7 @@ { python3, fetchPypi, lib, overlay ? (_: _: {}) }: -python3.override { +lib.fix (self: python3.override { + inherit self; packageOverrides = lib.composeExtensions (self: super: { /* @@ -35,4 +36,4 @@ python3.override { }) overlay; -} +}) diff --git a/pkgs/servers/mautrix-telegram/default.nix b/pkgs/servers/mautrix-telegram/default.nix index 81997920b756..4e9d00a9534b 100644 --- a/pkgs/servers/mautrix-telegram/default.nix +++ b/pkgs/servers/mautrix-telegram/default.nix @@ -7,6 +7,7 @@ let python = python3.override { + self = python; packageOverrides = self: super: { tulir-telethon = self.telethon.overridePythonAttrs (oldAttrs: rec { version = "1.37.0a1"; diff --git a/pkgs/servers/samba/4.x.nix b/pkgs/servers/samba/4.x.nix index 8723033346b0..a45b1bd488d2 100644 --- a/pkgs/servers/samba/4.x.nix +++ b/pkgs/servers/samba/4.x.nix @@ -55,6 +55,7 @@ with lib; let # samba-tool requires libxcrypt-legacy algorithms python = python3Packages.python.override { + self = python; libxcrypt = libxcrypt-legacy; }; wrapPython = python3Packages.wrapPython.override { diff --git a/pkgs/servers/web-apps/healthchecks/default.nix b/pkgs/servers/web-apps/healthchecks/default.nix index ee7d2122917d..5436555cd28a 100644 --- a/pkgs/servers/web-apps/healthchecks/default.nix +++ b/pkgs/servers/web-apps/healthchecks/default.nix @@ -6,6 +6,7 @@ }: let py = python3.override { + self = py; packageOverrides = final: prev: { django = prev.django_5; }; diff --git a/pkgs/tools/admin/gimme-aws-creds/default.nix b/pkgs/tools/admin/gimme-aws-creds/default.nix index ab43e9971d8e..49a7f60e3342 100644 --- a/pkgs/tools/admin/gimme-aws-creds/default.nix +++ b/pkgs/tools/admin/gimme-aws-creds/default.nix @@ -10,6 +10,7 @@ let python = python3.override { + self = python; packageOverrides = self: super: { fido2 = super.fido2.overridePythonAttrs (oldAttrs: rec { version = "0.9.3"; diff --git a/pkgs/tools/admin/gixy/default.nix b/pkgs/tools/admin/gixy/default.nix index 157430dcecda..5d1bfb65d4c2 100644 --- a/pkgs/tools/admin/gixy/default.nix +++ b/pkgs/tools/admin/gixy/default.nix @@ -8,6 +8,7 @@ let python = python3.override { + self = python; packageOverrides = self: super: { pyparsing = super.pyparsing.overridePythonAttrs rec { version = "2.4.7"; diff --git a/pkgs/tools/admin/oci-cli/default.nix b/pkgs/tools/admin/oci-cli/default.nix index a84c62ca6330..b51d4d50b4a8 100644 --- a/pkgs/tools/admin/oci-cli/default.nix +++ b/pkgs/tools/admin/oci-cli/default.nix @@ -7,6 +7,7 @@ let py = python3.override { + self = py; packageOverrides = self: super: { click = super.click.overridePythonAttrs (oldAttrs: rec { diff --git a/pkgs/tools/audio/piper/train.nix b/pkgs/tools/audio/piper/train.nix index 2cab1ba4ba04..476138e78837 100644 --- a/pkgs/tools/audio/piper/train.nix +++ b/pkgs/tools/audio/piper/train.nix @@ -3,10 +3,7 @@ }: let - python = python3.override { - packageOverrides = self: super: { - }; - }; + python = python3; in python.pkgs.buildPythonPackage { diff --git a/pkgs/tools/audio/tts/default.nix b/pkgs/tools/audio/tts/default.nix index 1d459e70c2e7..67552e99e7bf 100644 --- a/pkgs/tools/audio/tts/default.nix +++ b/pkgs/tools/audio/tts/default.nix @@ -7,6 +7,7 @@ let python = python3.override { + self = python; packageOverrides = self: super: { torch = super.torch-bin; torchvision = super.torchvision-bin; diff --git a/pkgs/tools/filesystems/ceph/default.nix b/pkgs/tools/filesystems/ceph/default.nix index e116304f07b4..5e3af349fc5a 100644 --- a/pkgs/tools/filesystems/ceph/default.nix +++ b/pkgs/tools/filesystems/ceph/default.nix @@ -169,6 +169,7 @@ let # Watch out for python <> boost compatibility python = python311.override { + self = python; packageOverrides = self: super: let cryptographyOverrideVersion = "40.0.1"; bcryptOverrideVersion = "4.0.1"; diff --git a/pkgs/tools/misc/diffoscope/default.nix b/pkgs/tools/misc/diffoscope/default.nix index a61e7329ebb1..363d32634b75 100644 --- a/pkgs/tools/misc/diffoscope/default.nix +++ b/pkgs/tools/misc/diffoscope/default.nix @@ -78,6 +78,7 @@ let python = python3.override { + self = python; packageOverrides = final: prev: { # version 4 or newer would log the followng error but tests currently don't fail because radare2 is disabled # ValueError: argument TNULL is not a TLSH hex string diff --git a/pkgs/tools/misc/esphome/default.nix b/pkgs/tools/misc/esphome/default.nix index e495fe13650d..57f29a9d103d 100644 --- a/pkgs/tools/misc/esphome/default.nix +++ b/pkgs/tools/misc/esphome/default.nix @@ -12,6 +12,7 @@ let python = python3Packages.python.override { + self = python; packageOverrides = self: super: { esphome-dashboard = self.callPackage ./dashboard.nix { }; }; diff --git a/pkgs/tools/misc/lektor/default.nix b/pkgs/tools/misc/lektor/default.nix index 84c4042912bd..09942bac6ca8 100644 --- a/pkgs/tools/misc/lektor/default.nix +++ b/pkgs/tools/misc/lektor/default.nix @@ -9,6 +9,7 @@ let python = python3.override { + self = python; packageOverrides = self: super: { mistune = super.mistune.overridePythonAttrs (old: rec { version = "2.0.5"; diff --git a/pkgs/tools/misc/ntfy/default.nix b/pkgs/tools/misc/ntfy/default.nix index 348c1e315253..54e232eafd9c 100644 --- a/pkgs/tools/misc/ntfy/default.nix +++ b/pkgs/tools/misc/ntfy/default.nix @@ -13,6 +13,7 @@ let python = python39.override { + self = python; packageOverrides = self: super: { ntfy-webpush = self.callPackage ./webpush.nix { }; diff --git a/pkgs/tools/misc/tvnamer/default.nix b/pkgs/tools/misc/tvnamer/default.nix index d1ddb319dc19..5015a5e40b56 100644 --- a/pkgs/tools/misc/tvnamer/default.nix +++ b/pkgs/tools/misc/tvnamer/default.nix @@ -5,6 +5,7 @@ let python' = python3.override { + self = python'; packageOverrides = final: prev: rec { # tvdb_api v3.1.0 has a hard requirement on requests-cache < 0.6 requests-cache = prev.requests-cache.overridePythonAttrs (oldAttrs: rec { diff --git a/pkgs/tools/networking/maubot/default.nix b/pkgs/tools/networking/maubot/default.nix index 6ea75522701a..b66940d92390 100644 --- a/pkgs/tools/networking/maubot/default.nix +++ b/pkgs/tools/networking/maubot/default.nix @@ -9,6 +9,7 @@ let python = python3.override { + self = python; packageOverrides = final: prev: { # aiosqlite>=0.16,<0.19 aiosqlite = prev.aiosqlite.overridePythonAttrs (old: rec { diff --git a/pkgs/tools/networking/p2p/tahoe-lafs/default.nix b/pkgs/tools/networking/p2p/tahoe-lafs/default.nix index e9de0da071c6..10d21934b2c0 100644 --- a/pkgs/tools/networking/p2p/tahoe-lafs/default.nix +++ b/pkgs/tools/networking/p2p/tahoe-lafs/default.nix @@ -10,6 +10,7 @@ let # uses eliot in a way incompatible after version 1.14.0. # These versions should be unpinned, when updating Tahoe-LAFS to a more recent version. python = python311.override { + self = python; packageOverrides = self: super: { eliot = super.eliot.overridePythonAttrs (oldAttrs: rec { version = "1.14.0"; diff --git a/pkgs/tools/nix/nixos-render-docs/default.nix b/pkgs/tools/nix/nixos-render-docs/default.nix index 94d2e9b51bde..956e0fcfc6e0 100644 --- a/pkgs/tools/nix/nixos-render-docs/default.nix +++ b/pkgs/tools/nix/nixos-render-docs/default.nix @@ -5,6 +5,7 @@ let python = python3.override { + self = python; packageOverrides = final: prev: { markdown-it-py = prev.markdown-it-py.overridePythonAttrs (_: { doCheck = false; diff --git a/pkgs/tools/package-management/poetry/default.nix b/pkgs/tools/package-management/poetry/default.nix index 415a2c0274d3..3317e785d0b8 100644 --- a/pkgs/tools/package-management/poetry/default.nix +++ b/pkgs/tools/package-management/poetry/default.nix @@ -22,6 +22,7 @@ let }); } // (plugins self); python = python3.override (old: { + self = python; packageOverrides = lib.composeManyExtensions ((if old ? packageOverrides then [ old.packageOverrides ] else [ ]) ++ [ newPackageOverrides ]); }); diff --git a/pkgs/tools/security/expliot/default.nix b/pkgs/tools/security/expliot/default.nix index 9a23087aa10d..028cacb6a0ba 100644 --- a/pkgs/tools/security/expliot/default.nix +++ b/pkgs/tools/security/expliot/default.nix @@ -4,6 +4,7 @@ }: let py = python3.override { + self = py; packageOverrides = self: super: { cmd2 = super.cmd2.overridePythonAttrs (oldAttrs: rec { diff --git a/pkgs/tools/security/ioccheck/default.nix b/pkgs/tools/security/ioccheck/default.nix index 2637fea90528..2f054c6dc6a6 100644 --- a/pkgs/tools/security/ioccheck/default.nix +++ b/pkgs/tools/security/ioccheck/default.nix @@ -5,6 +5,7 @@ let py = python3.override { + self = py; packageOverrides = self: super: { emoji = super.emoji.overridePythonAttrs rec { version = "1.7.0"; diff --git a/pkgs/tools/security/netexec/default.nix b/pkgs/tools/security/netexec/default.nix index 3ac0eebda954..33447f98516e 100644 --- a/pkgs/tools/security/netexec/default.nix +++ b/pkgs/tools/security/netexec/default.nix @@ -5,6 +5,7 @@ }: let python = python3.override { + self = python; packageOverrides = self: super: { impacket = super.impacket.overridePythonAttrs { version = "0.12.0.dev1-unstable-2023-11-30"; diff --git a/pkgs/tools/security/ssh-mitm/default.nix b/pkgs/tools/security/ssh-mitm/default.nix index 745090c8e9a1..6694a9edaae2 100644 --- a/pkgs/tools/security/ssh-mitm/default.nix +++ b/pkgs/tools/security/ssh-mitm/default.nix @@ -9,6 +9,7 @@ let py = python3.override { + self = py; packageOverrides = self: super: { paramiko = super.paramiko.overridePythonAttrs (oldAttrs: rec { version = "3.3.1"; diff --git a/pkgs/tools/text/mrkd/default.nix b/pkgs/tools/text/mrkd/default.nix index b43b6cfdf6ab..1c223861b486 100644 --- a/pkgs/tools/text/mrkd/default.nix +++ b/pkgs/tools/text/mrkd/default.nix @@ -5,6 +5,7 @@ let python = python3.override { + self = python; packageOverrides = self: super: { # https://github.com/refi64/mrkd/pull/6 mistune = super.mistune.overridePythonAttrs (old: rec {