Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions pkgs/development/interpreters/python/hooks/default.nix
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
self: super: with self;
self: dontUse: with self;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we use _ here instead of dontUse?

Copy link
Member Author

@Artturin Artturin Aug 7, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I want it to be noticeable without evalling that it should not be used, It could be changed to _dontUse if one wanted to quieten deadnix.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BTW, why exactly will this never be useful or usable at any time in the future?

I can see why it isn't useful right now, but it seemed non-obvious to me that it would never be useful. If that's true there probably ought to be a comment explaining it.

Copy link
Member Author

@Artturin Artturin Aug 7, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If super had to be used then it won't be possible to deduplicate and inherits would have to be done manually

      keep = self: {
        inherit (self)
          condaInstallHook
          condaUnpackHook
          eggBuildHook
          eggInstallHook
          eggUnpackHook
          flitBuildHook
          pipBuildHook
          pipInstallHook
          pytestCheckHook
          pythonCatchConflictsHook
          pythonImportsCheckHook
          pythonNamespacesHook
          pythonOutputDistHook
          pythonRecompileBytecodeHook
          pythonRelaxDepsHook
          pythonRemoveBinBytecodeHook
          pythonRemoveTestsDirHook
          setuptoolsBuildHook
          setuptoolsCheckHook
          setuptoolsRustBuildHook
          sphinxHook
          unittestCheckHook
          venvShellHook
          wheelUnpackHook
          wrapPython
        ;
      };

calling twice with self probably won't work when the package actually has a difference between self and super, I don't know when that would be the case here or why using super would be necessary here

Copy link
Member Author

@Artturin Artturin Aug 7, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The best thing to solve this issue would be #228139 and to deprecate python3.pkgs
but it's not urgent

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Of course that is assuming I debugged correctly and there's no other issues.

Copy link

@ghost ghost Aug 16, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


let
pythonInterpreter = super.python.pythonForBuild.interpreter;
pythonSitePackages = super.python.sitePackages;
pythonCheckInterpreter = super.python.interpreter;
pythonInterpreter = python.pythonForBuild.interpreter;
pythonSitePackages = python.sitePackages;
pythonCheckInterpreter = python.interpreter;
setuppy = ../run_setup.py;
in {
makePythonHook = args: pkgs.makeSetupHook ({passthru.provides.setupHook = true; } // args);
Expand Down
5 changes: 3 additions & 2 deletions pkgs/development/interpreters/python/passthrufun.nix
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,13 @@
selfTargetTarget = pythonOnTargetForTarget.pkgs or {}; # There is no Python TargetTarget.
};
hooks = import ./hooks/default.nix;
keep = lib.extends hooks pythonPackagesFun;
keep = self: hooks self {};
extra = _: {};
optionalExtensions = cond: as: lib.optionals cond as;
pythonExtension = import ../../../top-level/python-packages.nix;
python2Extension = import ../../../top-level/python2-packages.nix;
extensions = lib.composeManyExtensions ([
hooks
pythonExtension
] ++ (optionalExtensions (!self.isPy3k) [
python2Extension
Expand All @@ -64,7 +65,7 @@
otherSplices
keep
extra
(lib.extends (lib.composeExtensions aliases extensions) keep))
(lib.extends (lib.composeExtensions aliases extensions) pythonPackagesFun))
{
overrides = packageOverrides;
python = self;
Expand Down