| 23 Nov 2023 |
Simon Richard | Thanks, that worked! However, the second time I ran nix develop I got the error attribute 'format' missing. I think it's being caused by the pypoetry.toml file or the poetry.lock file since those are the only files that have changed since the first time I ran nix develop. Any thoughts? | 14:56:48 |
| 25 Nov 2023 |
| @10leej:matrix.org joined the room. | 15:56:35 |
| 28 Nov 2023 |
| BenBot joined the room. | 14:30:58 |
BenBot | Hey all, is there a newer way to add overrides that isn't in the docs?
I keep getting errors that both poetry2nix.overrides and poetry2nix.defaultPoetryOverrides is missing from poetry2nix
| 14:31:48 |
K900 | Is poetry2nix your flake? | 15:58:08 |
K900 | * Is
poetry2nix your flake input? | 15:58:14 |
K900 | Check the flake example in the repo | 15:58:20 |
| 29 Nov 2023 |
BenBot | In reply to @k900:0upti.me Is poetry2nix your flake input? It was my misunderstanding of how scope works in nix. I got past that, but now there are other problems :( | 15:58:06 |
BenBot | we're using protobuf to generate some classes at build time, but I can't figure out how to run protoc during the build phase of makePoetryApplication.
It doesn't seem like whatever mkPoetryApplication outputs has override or overrideAttrs so i'm at a loss 😓
| 15:58:57 |
K900 | Ideally you'd run it as part of your normal Python build | 15:59:16 |
K900 | Probably with a Poetry plugin | 15:59:30 |
BenBot | I'll look into that then. From a quick google search last night, I didn't see an easy way to run a make command or anything like that during poetry's build. But i'm no poetry expert, so i may have missed it | 16:00:35 |
K900 | There isn't | 16:02:07 |
BenBot | this seems like a huge limitation then :( I'm having a similar issue with an elixir flake. No way to generate protobuf modules before running the mixRelease function in nix | 16:02:58 |
K900 | Well | 16:03:08 |
K900 | You can do it in Nix | 16:03:10 |
K900 | And then copy in the files | 16:03:13 |
BenBot | Yeah, that's the hack i have now.
Generate the files in a package named proto then use the $out from that as the projectDir for mkPoetryApplication.
It's weirder for elixir since I need to install a remote dep (a protoc plugin) to generate the modules
| 16:04:32 |
BenBot | Is there any reason the derivation that mkPoetryApplication returns doesn't have override or overrideAttrs on it?
I feel like just prepending a make python-proto command to the buildPhase would be really simple
| 16:05:23 |
K900 | It should have overridePythonAttrs | 16:06:08 |
K900 | But also if you're doing that, you're basically making your thing not buildable without Nix | 16:06:20 |
K900 | Which may or may not be a problem for you | 16:06:24 |
BenBot | I'm okay with that. Currently my build process is a very hacky dockerfile, so anything is better than that 😅 Plus it's just an additional make command | 16:07:30 |
BenBot | let me try that overridePythonAttrs | 16:07:47 |
BenBot | In reply to @k900:0upti.me It should have overridePythonAttrs at /nix/store/wzjdajqfi4v7agn3s8hszvg0z8lkbnpw-source/flake.nix:40:21:
39| };
40| default = nn.mkPoetryApplication ({
| ^
41| buildInputs = [ self.packages.${system}.proto ];
error: attribute 'overridePythonAttrs' missing
doesn't seem like it :(
| 16:09:45 |
BenBot | default = nn.mkPoetryApplication ({
buildInputs = [ self.packages.${system}.proto ];
projectDir = "${self.packages.${system}.proto}";
preferWheels = true;
}).overridePythonAttrs (old: { buildPhase = "asdf"; });
| 16:10:14 |
K900 | I'm pretty sure you're doing nn.mkPoetryApplication ({}).overrideAttrs | 16:10:14 |
K900 | Yes | 16:10:17 |
BenBot | :0 | 16:10:29 |
K900 | Where you want (nn.mkPoetryApplication {}).overrideAttrs | 16:10:29 |