Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions pkgs/development/python-modules/flet-core/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{ lib
, python3
, buildPythonPackage
, fetchPypi
}:

buildPythonPackage rec {
pname = "flet-core";
version = "0.6.2";
format = "pyproject";

src = fetchPypi {
pname = "flet_core";
inherit version;
hash = "sha256-WMkm+47xhuYz1HsiPfF7YbOCg7Xlbj9oHI9nVtwAb/w=";
};

nativeBuildInputs = with python3.pkgs; [
poetry-core
];

propagatedBuildInputs = with python3.pkgs; [
typing-extensions
repath
];
Comment on lines +18 to +25
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


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.


meta = {
description = "The library is the foundation of Flet framework and is not intended to be used directly";
homepage = "https://flet.dev/";
license = lib.licenses.asl20;
maintainers = [ lib.maintainers.heyimnova ];
};
}
50 changes: 50 additions & 0 deletions pkgs/development/python-modules/flet/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
{ lib
, python3
, buildPythonPackage
, fetchPypi
}:

buildPythonPackage rec {
pname = "flet";
version = "0.6.2";
format = "pyproject";

src = fetchPypi {
inherit pname version;
hash = "sha256-EDNATwO2N4jXVC5H1VmXqC9XGTnQo8vLvTEozRYZuj4=";
};

patches = [
./pyproject.toml.patch
];

nativeBuildInputs = with python3.pkgs; [
poetry-core
];

propagatedBuildInputs = with python3.pkgs; [
flet-core
typing-extensions
websocket-client
watchdog
oauthlib
websockets
httpx
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?


pythonImportsCheck = [
"flet"
];

meta = {
description = "A framework that enables you to easily build realtime web, mobile, and desktop apps in Python";
homepage = "https://flet.dev/";
changelog = "https://github.com/flet-dev/flet/releases/tag/v${version}";
license = lib.licenses.asl20;
maintainers = [ lib.maintainers.heyimnova ];
mainProgram = "flet";
};
}
11 changes: 11 additions & 0 deletions pkgs/development/python-modules/flet/pyproject.toml.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -20,7 +20,7 @@ flet-core = "0.6.2"
python = "^3.7"
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.

oauthlib = "^3.2.2"
websockets = "^10.4"
httpx = "^0.23.3"
30 changes: 30 additions & 0 deletions pkgs/development/python-modules/repath/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{ lib
, python3
, buildPythonPackage
, fetchPypi
}:

buildPythonPackage rec {
pname = "repath";
version = "0.9.0";

src = fetchPypi {
inherit pname version;
hash = "sha256-gpITm6xqDkP9nXBgXU6NrrJdRmcuSE7TGiTHzgrvD7c=";
};

propagatedBuildInputs = with python3.pkgs; [
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.

"repath"
];

meta = {
description = "A port of the node module path-to-regexp to Python";
homepage = "https://github.com/nickcoutsos/python-repath";
license = lib.licenses.mit;
maintainers = [ lib.maintainers.heyimnova ];
};
}
6 changes: 6 additions & 0 deletions pkgs/top-level/python-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3641,6 +3641,10 @@ self: super: with self; {

fleep = callPackage ../development/python-modules/fleep { };

flet = callPackage ../development/python-modules/flet { };

flet-core = callPackage ../development/python-modules/flet-core { };

flexmock = callPackage ../development/python-modules/flexmock { };

flickrapi = callPackage ../development/python-modules/flickrapi { };
Expand Down Expand Up @@ -10252,6 +10256,8 @@ self: super: with self; {

reparser = callPackage ../development/python-modules/reparser { };

repath = callPackage ../development/python-modules/repath { };

repeated-test = callPackage ../development/python-modules/repeated-test { };

repocheck = callPackage ../development/python-modules/repocheck { };
Expand Down