!rWxyQqNqMUDLECdsIf:blad.is

Poetry2nix

315 Members
https://github.com/nix-community/poetry2nix58 Servers

Load older messages


SenderMessageTime
6 Nov 2023
@k900:0upti.meK900And it will work (until it inevitably blows up due to some version incompatibility)20:30:07
@matthewcroughan:defenestrate.itmatthewcroughanthat's not true, because then I get collisions 20:30:07
@matthewcroughan:defenestrate.itmatthewcroughan
                tokenizers = super.tokenizers.overridePythonAttrs
                  (
                    old: {
                      sourceRoot = "tokenizers-0.14.1/bindings/python";
                      cargoDeps = pkgs.rustPlatform.importCargoLock {
                        lockFile = ./nix/tokenizers/Cargo.lock;
                      };
                      nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [
                        pkgs.rustPlatform.cargoSetupHook
                        pkgs.rustPlatform.maturinBuildHook
                      ];
                    }
                  );

20:30:11
@matthewcroughan:defenestrate.itmatthewcroughantake this for instance 20:30:13
@matthewcroughan:defenestrate.itmatthewcroughan *
                tokenizers = super.tokenizers.overridePythonAttrs
                  (
                    old: {
                      sourceRoot = "tokenizers-0.14.1/bindings/python";
                      cargoDeps = pkgs.rustPlatform.importCargoLock {
                        lockFile = ./nix/tokenizers/Cargo.lock;
                      };
                      nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [
                        pkgs.rustPlatform.cargoSetupHook
                        pkgs.rustPlatform.maturinBuildHook
                      ];
                    }
                  );

20:30:17
@matthewcroughan:defenestrate.itmatthewcroughanhttps://github.com/NixOS/nixpkgs/blob/nixos-unstable/pkgs/development/python-modules/tokenizers/default.nix#L14020:30:31
@matthewcroughan:defenestrate.itmatthewcroughanalready in nixpkgs 20:30:33
@matthewcroughan:defenestrate.itmatthewcroughanbut poetry2nix seems not to be using the nixpkgs derivation 20:31:00
@k900:0upti.meK900And?20:31:01
@matthewcroughan:defenestrate.itmatthewcroughanif I set it to the one from nixpkgs, that's not going to work20:31:22
@k900:0upti.meK900https://github.com/nix-community/poetry2nix/blob/master/overrides/default.nix#L3148-L3154 is what it's doing20:31:23
@matthewcroughan:defenestrate.itmatthewcroughanit doesn't even use the wheel though 20:31:47
@matthewcroughan:defenestrate.itmatthewcroughanhence why I have to override it 20:31:53
@k900:0upti.meK900It should work if you set it to the nixpkgs derivation20:32:33
@k900:0upti.meK900Unless you're also leaking in some other version of it20:32:39
@matthewcroughan:defenestrate.itmatthewcroughanyeah I think the repo I'm packaging uses a newer version 20:32:51
@matthewcroughan:defenestrate.itmatthewcroughanbut is there no way to relax the deps like there is with nixpkgs infra?20:32:59
@k900:0upti.meK900If you're already in that repo, you can just update the constraint20:33:22
@k900:0upti.meK900 If you're not, you can use pythonRelaxDepsHook 20:33:30
@matthewcroughan:defenestrate.itmatthewcroughan
python3.11-gradio-client> no configure script, doing nothing
python3.11-gradio-client> building
python3.11-gradio-client> Executing pipBuildPhase
python3.11-gradio-client> Creating a wheel...
python3.11-gradio-client> WARNING: The directory '/homeless-shelter/.cache/pip' or its parent directory is not owned or is not writable
python3.11-gradio-client> Processing /build/gradio_client-0.6.1
python3.11-gradio-client>   Running command Preparing metadata (pyproject.toml)
python3.11-gradio-client>   Traceback (most recent call last):
python3.11-gradio-client>     File "/nix/store/z41lyyssxy1gza6ngn44q036k213c9gm-python3.11-pip-23.2.1/lib/python3.11/site-packages/pip/
python3.11-gradio-client>       main()
python3.11-gradio-client>     File "/nix/store/z41lyyssxy1gza6ngn44q036k213c9gm-python3.11-pip-23.2.1/lib/python3.11/site-packages/pip/
python3.11-gradio-client>       json_out['return_val'] = hook(**hook_input['kwargs'])
python3.11-gradio-client>                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
python3.11-gradio-client>     File "/nix/store/z41lyyssxy1gza6ngn44q036k213c9gm-python3.11-pip-23.2.1/lib/python3.11/site-packages/pip/
python3.11-gradio-client>       whl_basename = backend.build_wheel(metadata_directory, config_settings)
python3.11-gradio-client>                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
python3.11-gradio-client>     File "/nix/store/rralcg7v1b4x03ll78r4s84c475xaygm-python3.11-hatchling-1.18.0/lib/python3.11/site-package
python3.11-gradio-client>       return os.path.basename(next(builder.build(wheel_directory, ['standard'])))
python3.11-gradio-client>                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
python3.11-gradio-client>     File "/nix/store/rralcg7v1b4x03ll78r4s84c475xaygm-python3.11-hatchling-1.18.0/lib/python3.11/site-package
python3.11-gradio-client>       self.metadata.validate_fields()
python3.11-gradio-client>     File "/nix/store/rralcg7v1b4x03ll78r4s84c475xaygm-python3.11-hatchling-1.18.0/lib/python3.11/site-packages/hatchling/metadata/core.py", line 243, in validate_fields
python3.11-gradio-client>       _ = self.version
python3.11-gradio-client>           ^^^^^^^^^^^^
python3.11-gradio-client>     File "/nix/store/rralcg7v1b4x03ll78r4s84c475xaygm-python3.11-hatchling-1.18.0/lib/python3.11/site-packages/hatchling/metadata/core.py", line 128, in version
python3.11-gradio-client>       self._version = self._get_version()
python3.11-gradio-client>                       ^^^^^^^^^^^^^^^^^^^
python3.11-gradio-client>     File "/nix/store/rralcg7v1b4x03ll78r4s84c475xaygm-python3.11-hatchling-1.18.0/lib/python3.11/site-packages/hatchling/metadata/core.py", line 222, in _get_version
python3.11-gradio-client>       core_metadata = self.core
python3.11-gradio-client>                       ^^^^^^^^^
python3.11-gradio-client>     File "/nix/store/rralcg7v1b4x03ll78r4s84c475xaygm-python3.11-hatchling-1.18.0/lib/python3.11/site-packages/hatchling/metadata/core.py", line 166, in core
python3.11-gradio-client>       metadata_hooks = self.hatch.metadata.hooks
python3.11-gradio-client>                        ^^^^^^^^^^^^^^^^^^^^^^^^^
python3.11-gradio-client>     File "/nix/store/rralcg7v1b4x03ll78r4s84c475xaygm-python3.11-hatchling-1.18.0/lib/python3.11/site-packages/hatchling/metadata/core.py", line 1544, in hooks
python3.11-gradio-client>       raise UnknownPluginError(message)
python3.11-gradio-client>   hatchling.plugin.exceptions.UnknownPluginError: Unknown metadata hook: requirements_txt
20:37:45
@matthewcroughan:defenestrate.itmatthewcroughanAnd now my favourite part, patching out random lines for no apparent reason because who knows how hatchling works 20:37:58
@matthewcroughan:defenestrate.itmatthewcroughanI have had to do this, so often, just removing lines that don't effect the build at all20:38:15
@matthewcroughan:defenestrate.itmatthewcroughanah no, nixpkgs has this https://github.com/NixOS/nixpkgs/blob/nixos-unstable/pkgs/development/python-modules/gradio/client.nix#L8C3-L8C2520:39:14
@matthewcroughan:defenestrate.itmatthewcroughan K900 ⚡️: okay so in this case, there is a drv in nixpkgs. But the poetry overrides don't use it. And I can't just use the one from nixpkgs due to collision/mismatch in dependency graph. 20:40:05
@k900:0upti.meK900No, that's false20:40:11
@k900:0upti.meK900The poetry overrides do use it20:40:16
@k900:0upti.meK900I know because I wrote that fucking code and please don't tell me what it doesn't do20:40:31
@matthewcroughan:defenestrate.itmatthewcroughanI did a ctrl + f for gradio in github.com/nix-community/poetry2nix/blob/master/overrides/default.nix20:40:37
@k900:0upti.meK900So?20:40:46
@matthewcroughan:defenestrate.itmatthewcroughanSo where is it if it exists, and I am not sure why you think I am telling you what your code does or doesn't do.20:41:03

Show newer messages


Back to Room ListRoom Version: 6