-
-
Notifications
You must be signed in to change notification settings - Fork 14.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
xonsh.xontribs.xontrib-*: init at various #354733
base: master
Are you sure you want to change the base?
Conversation
Hopefully you can get some actual traction on this. Having pushed a lot more packages since I initially made this, the feedback that might come could include a request to change all of the separate xontrib packages into individual commits to match the commit message log preference for introducing new packages. |
144030b
to
5900db4
Compare
Do those commit messages seem better? |
Yes, that seems to match the format. |
5900db4
to
9936e83
Compare
xontribs = lib.mkOption { | ||
default = [ ]; | ||
type = lib.types.listOf lib.types.package; | ||
description = '' | ||
Add the listed xontribs to the package options. Available xontribs are | ||
under xonsh.xontribs. | ||
|
||
Take care in using this option along with manually defining the package | ||
option above, as the two can result in conflicting sets of build dependencies. | ||
This option assumes that the package option has an overridable argument | ||
called `extraPackages`, so if you override the package option but also | ||
intend to use this option, be sure that your resulting package still honors | ||
the necessary option. | ||
''; | ||
example = "xontribs = with pkgs.xonsh.xontribs; [ xontrib-vox xontrib-abbrevs ];"; | ||
}; | ||
|
||
extraPackages = lib.mkOption { | ||
default = (ps: [ ]); | ||
type = lib.types.functionTo (lib.types.listOf lib.types.package); | ||
description = '' | ||
Add the specified extra packages to the xonsh package. | ||
Preferred over using `programs.xonsh.package` as it composes with `programs.xonsh.xontribs`. | ||
|
||
Take care in using this option along with manually defining the package | ||
option above, as the two can result in conflicting sets of build dependencies. | ||
This option assumes that the package option has an overridable argument | ||
called `extraPackages`, so if you override the package option but also | ||
intend to use this option, be sure that your resulting package still honors | ||
the necessary option. | ||
''; | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to separate xontribs from other python packages? I think they can be both in one option.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was addressed in the review of my original PR. Xontribs are intentionally hobbled code and do not need to exclusively be written in Python (they can also be written in Xonsh syntax itself). Rather than using the established methods for Python plugin detection, Xonsh requires that its plugins all drop their entry point into the same folder and leave out the __init__.py
file. Xonsh itself provides that init file and then looks for the xontribs in that directory. As such, xontribs are not truly valid Python packages and really shouldn't be handled as such.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was addressed in the review of my original PR. Xontribs are intentionally hobbled code and do not need to exclusively be written in Python (they can also be written in Xonsh syntax itself). Rather than using the established methods for Python plugin detection, Xonsh requires that its plugins all drop their entry point into the same folder and leave out the
__init__.py
file. Xonsh itself provides that init file and then looks for the xontribs in that directory. As such, xontribs are not truly valid Python packages and really shouldn't be handled as such.
Xontribs and Python packages are both added to the wrapper's parameter extraPackages
now and works fine so far for me, so I don't understand why there are two options to override extraPackages
. Do you mean the wrapper needs rework?
Closes #241386
Supersedes the above PR, I've gone ahead and updated and cleaned up all of the packages (including a small fix for
xontrib-jupyter
, after an upstream Xonsh change.) It has also been rebased on master accordingly.I am very driven to get this done to let nix-community/home-manager#5494 proceed, as I have wanted to switch to Xonsh for a while now.
CC @greg-hellings as author of the previous PR
Things done
nix.conf
? (See Nix manual)sandbox = relaxed
sandbox = true
nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)Add a 👍 reaction to pull requests you find important.