| 5 Nov 2024 |
| @spacekookie:fairydust.space joined the room. | 14:52:26 |
@spacekookie:fairydust.space | Hey! I'm trying to nixify a poetry project and having issues with one of the tool hashes (for ruff, which I think is a linter?).
The build fails with
specified: sha256-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=
got: sha256-TPr6YdSb5JKltXHDi1PdGzPYjmmsbCFQKxIiJURrBMI=
and I'm trying to override the package like this (as an arg to mkPoetryApplication:
overrides = poetry2nix.overrides.withDefaults (self: super: {
ruff = super.ruff.overrideAttrs ({ src, ... }: {
src = {
inherit (src) owner repo rev;
hash = "sha256-TPr6YdSb5JKltXHDi1PdGzPYjmmsbCFQKxIiJURrBMI=";
};
});
});
but I'm still getting the hash mismatch. Any ideas what I'm doing wrong?
| 14:59:56 |
@spacekookie:fairydust.space | * Hey! I'm trying to nixify a poetry project and having issues with one of the tool hashes (for ruff, which I think is a linter?).
The build fails with
specified: sha256-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=
got: sha256-TPr6YdSb5JKltXHDi1PdGzPYjmmsbCFQKxIiJURrBMI=
and I'm trying to override the package like this (as an arg to mkPoetryApplication:
overrides = poetry2nix.overrides.withDefaults (self: super: { ruff = super.ruff.overrideAttrs ({ src, ... }: {
src = {
inherit (src) owner repo rev;
hash = "sha256-TPr6YdSb5JKltXHDi1PdGzPYjmmsbCFQKxIiJURrBMI=";
};
});
});
but I'm still getting the hash mismatch. Any ideas what I'm doing wrong?
| 15:00:12 |
@spacekookie:fairydust.space | * Hey! I'm trying to nixify a poetry project and having issues with one of the tool hashes (for ruff, which I think is a linter?).
The build fails with
specified: sha256-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=
got: sha256-TPr6YdSb5JKltXHDi1PdGzPYjmmsbCFQKxIiJURrBMI=
and I'm trying to override the package like this (as an arg to mkPoetryApplication:
overrides = poetry2nix.overrides.withDefaults (self: super: {
ruff = super.ruff.overrideAttrs ({ src, ... }: {
src = {
inherit (src) owner repo rev;
hash = "sha256-TPr6YdSb5JKltXHDi1PdGzPYjmmsbCFQKxIiJURrBMI=";
};
});
});
but I'm still getting the hash mismatch. Any ideas what I'm doing wrong?
| 15:00:35 |
@spacekookie:fairydust.space | * Hey! I'm trying to nixify a poetry project and having issues with one of the tool hashes (for ruff, which I think is a linter?).
The build fails with
specified: sha256-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=
got: sha256-TPr6YdSb5JKltXHDi1PdGzPYjmmsbCFQKxIiJURrBMI=
and I'm trying to override the package like this (as an arg to mkPoetryApplication:
overrides = poetry2nix.overrides.withDefaults (self: super: {
ruff = super.ruff.overrideAttrs ({ src, ... }: {
src = {
inherit (src) owner repo rev;
hash = "sha256-TPr6YdSb5JKltXHDi1PdGzPYjmmsbCFQKxIiJURrBMI=";
};
});
});
but I'm still getting the hash mismatch. Any ideas what I'm doing wrong?
| 15:00:57 |
@spacekookie:fairydust.space | The derivation hash isn't changing so I assume the override isn't being applied | 15:01:22 |
K900 | It's probably cargoHash | 15:01:40 |
K900 | The way we handle overrides for those sucks | 15:01:45 |
@spacekookie:fairydust.space | Ooh | 15:01:59 |
K900 | https://github.com/nix-community/poetry2nix/blob/master/overrides/default.nix#L3418 | 15:02:14 |
@spacekookie:fairydust.space | I forgot how to set those in the first place lol | 15:02:14 |
@spacekookie:fairydust.space | Thanks! :) | 15:02:27 |
@spacekookie:fairydust.space | Ah okay. Yeah this project uses 0.7.1 so I guess I should do a PR to poetry2nix to update these? | 15:03:10 |
@spacekookie:fairydust.space | I am getting that "unknown ruff version" warning :P Good to know where it comes from | 15:03:29 |
K900 | Probably yes | 15:04:01 |
| 6 Nov 2024 |
@spacekookie:fairydust.space | I fixed the ruff problem (wip PR with not all the in-between versions added), now failing on the next hurdle: pydantic-xml fails to build because: No module named 'poetry'.
I read the edgecases.md and tried adding poetry to the build inputs of the package, but to no avail. Anything obviously wrong with this?
pydantic-xml = super.pythonPackages.pydantic-xml.overridePythonAttrs
(old: {
buildInputs = (old.buildInputs or [ ]) ++ (pkgs.lib.traceVal [ super.poetry ]);
});
(the trace is being printed as trace: [ «thunk» «thunk» ]
| 08:04:49 |
@spacekookie:fairydust.space | * I fixed the ruff problem (wip PR with not all the in-between versions added), now failing on the next hurdle: pydantic-xml fails to build because: No module named 'poetry'.
I read the edgecases.md and tried adding poetry to the build inputs of the package, but to no avail. Anything obviously wrong with this?
pydantic-xml = super.pythonPackages.pydantic-xml.overridePythonAttrs
(old: {
buildInputs = (old.buildInputs or [ ]) ++ (pkgs.lib.traceVal [ super.poetry ]);
});
(the trace is being printed as trace: [ «thunk» «thunk» ]
| 08:05:30 |
K900 | You probably want super.poetry-core | 08:07:35 |
K900 | Also, check build-systems.json | 08:07:41 |
K900 | That's an easier way to do basically this | 08:07:45 |
@spacekookie:fairydust.space | oh okay! | 08:10:44 |
@spacekookie:fairydust.space | Actually yeah I saw that earlier and forgot about it | 08:10:54 |
@spacekookie:fairydust.space | Is there a way to include arbitrary extra files in the output path of the root mkPoetryApplication build? I tried adding the name of that package (builder-tools for me) to the overrides section but that doesn't seem to be evaluated | 09:26:17 |
@spacekookie:fairydust.space | * Is there a non-obvious/ not-document dway to include arbitrary extra files in the output path of the root mkPoetryApplication build? I tried adding the name of that package (builder-tools for me) to the overrides section but that doesn't seem to be evaluated | 09:26:42 |
@spacekookie:fairydust.space | * Is there a non-obvious/ not-document way to include arbitrary extra files in the output path of the root mkPoetryApplication build? I tried adding the name of that package (builder-tools for me) to the overrides section but that doesn't seem to be evaluated | 09:28:11 |
truh | I think you can use the usual nix derivation hooks. postInstall maybe | 09:28:13 |
@spacekookie:fairydust.space | I'll try that | 09:28:44 |
@spacekookie:fairydust.space | Nice :) that worked! Thanks | 09:29:41 |
@spacekookie:fairydust.space | Sorry for all my probably noob questions haha. I haven't done nix things in a while | 09:30:03 |
K900 | You can also add those files to your pyproject.toml | 09:38:18 |