Skip to content

xonsh: fix wrapper, 0.17.0 -> 0.18.2 - #325813

Merged
emilazy merged 3 commits into
NixOS:masterfrom
SamLukeYes:xonsh
Aug 16, 2024
Merged

emilazy merged 3 commits into
NixOS:masterfrom
SamLukeYes:xonsh

Conversation

@SamLukeYes

@SamLukeYes SamLukeYes commented Jul 9, 2024 •

Copy link
Copy Markdown
Member

Description of changes

Reverting the breaking change of top-level xonsh package introduced by #314728, and restore the previous wrapper behavior.

Fixes #248978
Fixes #326339

Note: The fix makes the xonsh executables in the unwrapped variants unusable without a python env, so either add it to a python env or use the wrapper instead. To use another Python version (e.g. avoid the f-string regression xonsh/xonsh#5166), override the python3 used by top-level xonsh, like pkgs.xonsh.override { python3 = pkgs.python311; }.

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 24.11 Release Notes (or backporting 23.11 and 24.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

Add a 👍 reaction to pull requests you find important.

@github-actions github-actions Bot added 6.topic: python Python is a high-level, general-purpose programming language. 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: module (update) This PR changes an existing module in `nixos/` labels Jul 9, 2024
@ofborg ofborg Bot added 11.by: package-maintainer This PR was created by a maintainer of all the package it changes. 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. labels Jul 9, 2024
@SamLukeYes
SamLukeYes marked this pull request as ready for review July 9, 2024 12:10
@SamLukeYes
SamLukeYes requested a review from natsukium as a code owner July 9, 2024 12:11
@SamLukeYes
SamLukeYes requested a review from greg-hellings July 9, 2024 15:06

@greg-hellings greg-hellings left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

OK, so the basic package name is going back to the wrapper and the unwrapped is coming back. 👍

@wegank wegank added the 12.approvals: 1 This PR was reviewed and approved by one person. label Jul 15, 2024
};
};
in
pythonPackages.buildPythonPackage argset

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

why the let-in instead of defining it directly?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Anderson has explained it in #305316 (comment), and I didn't change it.

Comment thread pkgs/by-name/xo/xonsh/unwrapped.nix Resolved
@nixos-discourse

Copy link
Copy Markdown

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/prs-ready-for-review/3032/4355

@SamLukeYes

SamLukeYes commented Aug 9, 2024 •

Copy link
Copy Markdown
Member Author

I'm going to update xonsh to 0.18.2 in this PR, because it is not merged for too long, and I don't want to open a separate PR for update and rebase this one. Drafting until it is done.

@SamLukeYes
SamLukeYes marked this pull request as draft August 9, 2024 13:42
@SamLukeYes SamLukeYes changed the title xonsh: fix wrapper xonsh: fix wrapper, 0.17.0 -> 0.18.2 Aug 9, 2024
@SamLukeYes
SamLukeYes marked this pull request as ready for review August 9, 2024 14:55
@SamLukeYes
SamLukeYes requested a review from lf- August 9, 2024 14:56
@lf-

lf- commented Aug 9, 2024

Copy link
Copy Markdown
Member

So I have a question about the new wrapper: how do you make a dev shell that has a custom Python environment that also works when you run xonsh inside the dev shell, and the dev shell lets you import xonsh?

@SamLukeYes

SamLukeYes commented Aug 10, 2024 •

Copy link
Copy Markdown
Member Author

So I have a question about the new wrapper: how do you make a dev shell that has a custom Python environment that also works when you run xonsh inside the dev shell, and the dev shell lets you import xonsh?

Good question. I didn't think of this use case, but adding the unwrapped xonsh to a python env actually works, because creating a python env effectively wraps it.

{ pkgs ? import <nixpkgs> {} }:

let
  pythonEnv = pkgs.python3.withPackages (ps: with ps; [
    requests
    xonsh
  ]);
in

pkgs.mkShell {
  packages = [ pythonEnv ];
}

This is exactly how the wrapper works, except the wrapper is a proper shell package and only exposes xonsh itself. I've updated the description of changes.

@wegank wegank removed the 12.approvals: 1 This PR was reviewed and approved by one person. label Aug 10, 2024

@greg-hellings greg-hellings left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This, at last, resolves basically all the outstanding difficulties I've been having with Xonsh. Please merge this ASAP.

@emilazy
emilazy merged commit 00f9b25 into NixOS:master Aug 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 6.topic: python Python is a high-level, general-purpose programming language. 8.has: module (update) This PR changes an existing module in `nixos/` 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 11.by: package-maintainer This PR was created by a maintainer of all the package it changes.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Xonsh extraPacakges doesn't work Xonsh adds unwanted entries to PATH

7 participants