Skip to content
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

python3Packages.flet: fix flet by nix run complaining about missing flet #320913

Merged
merged 1 commit into from
Jul 4, 2024

Conversation

lucasew
Copy link
Contributor

@lucasew lucasew commented Jun 19, 2024

Description of changes

If one runs flet by using nix run it complains about missing flet.

This PR fixes this.

Signed-off-by: lucasew [email protected]

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.

@lucasew
Copy link
Contributor Author

lucasew commented Jun 19, 2024

Result of nixpkgs-review pr 320913 run on x86_64-linux 1

4 packages built:
  • python311Packages.flet
  • python311Packages.flet.dist
  • python312Packages.flet
  • python312Packages.flet.dist

Comment on lines 66 to 69
fixupPhase = ''
wrapProgram $out/bin/flet \
--prefix PYTHONPATH : $PYTHONPATH
'';
Copy link
Member

@Artturin Artturin Jun 27, 2024

Choose a reason for hiding this comment

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

Suggested change
fixupPhase = ''
wrapProgram $out/bin/flet \
--prefix PYTHONPATH : $PYTHONPATH
'';
makeWrapperArgs = [
"--prefix PYTHONPATH : $PYTHONPATH"
];

However, I can't reproduce the import error because bin/.flet-wrapped already contains a line like this

import sys;import site;import functools;sys.argv[0] = '/nix/store/6ynbyvrzxy5g7maa7w8xm5mhxz23kmvv-python3.11-flet-0.22.1/bin/flet';functools.reduce(lambda k, p: site.addsitedir(p, k), ['/nix/store/6ynbyvrzxy5g7maa7w8xm5mhxz23kmvv-python3.11-flet-0.22.1/lib/python3.11/site-packages','/nix/store/4akqnwj2agnmf7jpr2w782d76yaalzfs-python3.11-fastapi-0.110.2/lib/python3...
$ ./result/bin/flet
usage: flet [-h] [--version] {create,run,pack,publish,build} ...

positional arguments:
  {create,run,pack,publish,build}
    create              Create a new Flet app from a template.
    run                 Run Flet app.
    pack                Package Flet app to a standalone bundle.
    publish             Publish Flet app as a standalone web app.
    build               Build an executable app or install bundle.

options:
  -h, --help            show this help message and exit
  --version             show program's version number and exit

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It only happens when you actually open a example, --help works for me too.

Copy link
Member

@Artturin Artturin Jul 4, 2024

Choose a reason for hiding this comment

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

Please try to find out why the additional wrapping is needed, ask in the nix python matrix channel if needed.

@lucasew
Copy link
Contributor Author

lucasew commented Jul 4, 2024

Result of nixpkgs-review pr 320913 run on x86_64-linux 1

4 packages built:
  • python311Packages.flet
  • python311Packages.flet.dist
  • python312Packages.flet
  • python312Packages.flet.dist

@Artturin Artturin merged commit 8d7e1c4 into NixOS:master Jul 4, 2024
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants