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: init at 0.6.2 #229482

Merged
merged 3 commits into from
May 9, 2023
Merged

Conversation

heyimnova
Copy link
Member

Description of changes

python3Packages.flet: init at 0.6.2
python3Packages.flet-core: init at 0.6.2
python3Packages.repath: init at 0.9.0

Add the Flet Python module, a framework for easily building Flutter apps with Python. Also add flet-core as it is a dependency of flet, and add repath as it is a dependency of flet-core.

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.05 Release Notes (or backporting 22.11 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.

, python3
}:

with python3.pkgs;
Copy link
Member

Choose a reason for hiding this comment

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

never ever use global with.

Copy link
Member Author

Choose a reason for hiding this comment

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

Thank you, I have corrected this issue

@AndersonTorres AndersonTorres merged commit ee95722 into NixOS:master May 9, 2023
17 checks passed
@heyimnova heyimnova deleted the flet branch May 10, 2023 04:17
Comment on lines +18 to +25
nativeBuildInputs = with python3.pkgs; [
poetry-core
];

propagatedBuildInputs = with python3.pkgs; [
typing-extensions
repath
];
Copy link
Member

Choose a reason for hiding this comment

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

We can't use python3.pkgs in the python package set. Instead, we need to pass all python packages via function arguments, otherwise you are pinning this to just one python version.

I'm fixing this up in #244135.

$ nom-build -A python311Packages.flet
error:
       … while evaluating the attribute 'drvPath'

         at /home/hexa/git/nixos/master/lib/customisation.nix:222:7:

          221|     in commonAttrs // {
          222|       drvPath = assert condition; drv.drvPath;
             |       ^
          223|       outPath = assert condition; drv.outPath;

       … while evaluating the attribute 'drvPath'

         at /home/hexa/git/nixos/master/lib/customisation.nix:222:7:

          221|     in commonAttrs // {
          222|       drvPath = assert condition; drv.drvPath;
             |       ^
          223|       outPath = assert condition; drv.outPath;

       (stack trace truncated; use '--show-trace' to show the full trace)

       error: Python version mismatch in 'python3.11-flet-0.7.4':

       The Python derivation 'python3.11-flet-0.7.4' depends on a Python derivation
       named 'python3.10-flet-core-0.7.4', but the two derivations use different versions
       of Python:

                'python3.11-flet-0.7.4' uses /nix/store/ng1c2jqy48p1x33j1qyg0n5anhfv31g0-python3-3.11.4
           'python3.10-flet-core-0.7.4' uses /nix/store/jhflvwr40xbb0xr6jx4311icp9cym1fp-python3-3.10.12

       Possible solutions:

         * If 'python3.10-flet-core-0.7.4' is a Python library, change the reference to 'python3.10-flet-core-0.7.4'
           in the propagatedBuildInputs of 'python3.11-flet-0.7.4' to use a 'python3.10-flet-core-0.7.4' built from the same
           version of Python

         * If 'python3.10-flet-core-0.7.4' is used as a tool during the build, move the reference to
           'python3.10-flet-core-0.7.4' in 'python3.11-flet-0.7.4' from propagatedBuildInputs to nativeBuildInputs

         * If 'python3.10-flet-core-0.7.4' provides executables that are called at run time, pass its
           bin path to makeWrapperArgs:

               makeWrapperArgs = [ "--prefix PATH : ${lib.makeBinPath [ flet-core ] }" ];

        at /home/hexa/git/nixos/master/pkgs/development/python-modules/flet/default.nix:8:3

Copy link
Member

Choose a reason for hiding this comment

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

This also prevents people from using packageOverrides.
@AndersonTorres In the future please request a review from someone who knows Python packaging before merging.

Copy link
Member

Choose a reason for hiding this comment

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

Fixed in ae735c5 ddc1932 c7437c5 and two more in e66ea73 and 92d6b02

repath
];

doCheck = false;
Copy link
Member

Choose a reason for hiding this comment

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

Why? Also, pythonImportsCheck is missing.

packaging
];

doCheck = false;
Copy link
Member

Choose a reason for hiding this comment

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

Why?

six
];

pythonImportsCheck = [
Copy link
Member

Choose a reason for hiding this comment

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

Also add nativeCheckInputs.

typing-extensions = { version = "^4.4.0", python = "<3.8" }
websocket-client = "^1.4.2"
-watchdog = "^2.2.1"
+watchdog = ">=2.2.1"
Copy link
Member

@dotlambda dotlambda Jul 28, 2023

Choose a reason for hiding this comment

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

Use pythonRelaxDepsHook instead.

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

4 participants