Skip to content

python3Packages.flet: fix out of the box experience#251877

Closed
lucasew wants to merge 9 commits intoNixOS:masterfrom
lucasew:fix-flet
Closed

python3Packages.flet: fix out of the box experience#251877
lucasew wants to merge 9 commits intoNixOS:masterfrom
lucasew:fix-flet

Conversation

@lucasew
Copy link
Contributor

@lucasew lucasew commented Aug 28, 2023

Description of changes

Without this PR flet gives an error about missing some binary in HOME, that's because the Python library does some kind of RPC to a GUI app made in flutter.

This PR solves this issue by packaging the GUI app and patching the library so it works out of the box.

Web still doesn't work because buildFlutterApplication don't allow trivially creating web builds yet.

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandbox = true set in nix.conf? (See Nix manual)
  • 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/)
  • 23.11 Release Notes (or backporting 23.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.

@github-actions github-actions bot added the 6.topic: python Python is a high-level, general-purpose programming language. label Aug 28, 2023
@lucasew
Copy link
Contributor Author

lucasew commented Aug 28, 2023

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

6 packages built:
  • flet-client-flutter
  • flet-client-flutter.debug
  • python310Packages.flet
  • python310Packages.flet.dist
  • python311Packages.flet
  • python311Packages.flet.dist

@lucasew
Copy link
Contributor Author

lucasew commented Aug 28, 2023

How to test:

nix run github:lucasew/nixpkgs/fix-flet#python3Packages.flet --refresh -- /some/script.py

There are many examples here: https://github.com/flet-dev/examples

I still need to test if scripts with external modules works nice, like something with numpy idk.

@lucasew lucasew marked this pull request as ready for review August 28, 2023 14:15
Copy link
Contributor

Choose a reason for hiding this comment

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

Please don't, if this is an issue for you use something like nix-update that will properly update the version and hash at the same time.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In this case it's important that the client bumps together with the python module so I am using the python module version to get which revision will be used to build the client. This would only be a reminder to update the hash of the client too when bumping.

Copy link
Contributor

@thiagokokada thiagokokada Aug 28, 2023

Choose a reason for hiding this comment

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

Don't make a package to be dependent on another one version since this tends to cause a multitude of other issues.

Better to keep both of them separate and add a comment for the maintainer to update both at the same time.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Solved

I am now using the src from the flutter program as base. When the flutter program is updated both python libraries are updated by consequence.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

And I think I broke the patch lol

@lucasew lucasew force-pushed the fix-flet branch 2 times, most recently from 7168ddb to 8a1305d Compare August 28, 2023 17:19
@lucasew
Copy link
Contributor Author

lucasew commented Aug 28, 2023

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

10 packages built:
  • flet-client-flutter
  • flet-client-flutter.debug
  • python310Packages.flet
  • python310Packages.flet-core
  • python310Packages.flet-core.dist
  • python310Packages.flet.dist
  • python311Packages.flet
  • python311Packages.flet-core
  • python311Packages.flet-core.dist
  • python311Packages.flet.dist

@lucasew lucasew requested a review from thiagokokada August 28, 2023 17:44
@lucasew
Copy link
Contributor Author

lucasew commented Aug 29, 2023

image

Just tried a quick PoC to check about external libraries support.

The package is also not up to date, I tried bumping it but I think it's better to solve this on a follow up PR.

@AndersonTorres
Copy link
Member

Fix the failures

@lucasew lucasew mentioned this pull request Jan 10, 2024
13 tasks
@lucasew
Copy link
Contributor Author

lucasew commented Jan 10, 2024

Moved to #279936

@lucasew lucasew closed this Jan 10, 2024
@lucasew lucasew deleted the fix-flet branch May 23, 2024 23:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

6.topic: python Python is a high-level, general-purpose programming language.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants