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
pyspread: Correct dependencies and make wrapper #94537
Conversation
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/need-help-wrapping-pyspread/8573/1 |
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.
If this is just meant to be just the application, and you don't need to export the package as a python package, then it should probably be moved out of python-modules
and packaged as an application. Please see https://github.com/NixOS/nixpkgs/blob/master/doc/languages-frameworks/python.section.md#building-packages-and-applications and https://github.com/NixOS/nixpkgs/blob/master/doc/languages-frameworks/python.section.md#buildpythonapplication-function
then you would just do something like:
mkDerivationWith buildPythonApplication rec {
...
}
@jonringer Thank you for reviewing. Users may also want extra packages when writing those expressions. Since There is also an API to be imported in python scripts, and that's the reason I preserve pyspread-unwrapped. |
pkgs/top-level/all-packages.nix
Outdated
@@ -22235,6 +22235,9 @@ in | |||
|
|||
pybitmessage = callPackage ../applications/networking/instant-messengers/pybitmessage { }; | |||
|
|||
wrapPyspread = libsForQt5.callPackage ../applications/misc/pyspread-app/wrap-pyspread.nix { }; |
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.
Expose only a single attribute, the application that works.
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.
When writing a NixOS module or a home-manager, should I call the file wrap-pyspread.nix
directly?
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.
no, you can reference pkgs.pyspread
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.
@jonringer I tried for a while, but couldn't find a way to override pkgs.pyspread-app
and change its pythonWithDependencies
and customInterpreterName
attributes.
How should I modify the wrapping expressions and write the override one to achieve this?
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.
I modified the program to make pyspread-app
a set, and move the executable application to pyspread-app.app
.
@ofborg eval |
39dccf9
to
be5bc09
Compare
For the Python package * Change dependent python version to 3.6-3.9 * Change dependent widget toolkit to pyqt5 For the application * Add a wrapped application * Add some functions that make overriding easier * pyspread-app: a set containing * pyspread-app.app: the workable application * pyspread-app.wrapPyspread: the wrapping function * .pickRequiredDeps, .pickOptionalDeps: functions to get deps from the given package set
be5bc09
to
f64d98c
Compare
Close this PR as the previously broken package is fixed. |
Change dependent python version to 3.6-3.9
Change dependent widget toolkit to pyqt5
Add a wrapper so as to execute the application from
$out/bin
.Maintainers needed.
Motivation for this change
pyspread 1.99.x depends on Python 3.6-3.9 and pyqt5 instead of Python 2.7, wxPython or pygtk. Some dependent packages have also dropped Python2 support.
A wrapper is made using
overrideAttrs
andpythonFull.withPackages
to make it executable out of the box.It is the first time for me to package a Python application (rewrite the expressions of a package) in nixpkgs.
There might be some better or more efficient ways to do so.
Things done
sandbox
innix.conf
on non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
./result/bin/
) (Tested python36Packages.pyspread)nix path-info -S
before and after) (The closure size ofpyspread
is now 706115728)