| 12 Oct 2024 |
laurents | I figured it out. The name is ofd_expressions, but the override must be named ofd-expressions Those were 8 hours well spent... :/
| 15:13:01 |
K900 | This might just be a side effect of package name normalization | 15:17:07 |
laurents | it seems so, I found a note in the page about edge cases. I wonder if it could be made a bit more obvious in the readme. I'm new to nix, is this specific to poetry2nix or standard across the ecosystem? | 15:21:03 |
K900 | We try to normalize it across the ecosystem | 15:29:43 |
@blaese:matrix.uni-marburg.de | Is it recommended to use the commands from the scripts section from your byproduct or is a custom command with uvicorn equivalent? I invoke my start parameter with an .env file and both versions support this, what should I decide? | 15:32:20 |
laurents | In reply to @k900:0upti.me We try to normalize it across the ecosystem good to keep in mind then. Thanks! | 15:35:47 |
| 13 Oct 2024 |
virtu | is there anything special I need to pay attention to if I want to use poetry2nix to create a package that I can import after installing via flake? for some reason, the package is not in the site-packages of the system-wide python env and I can't import it. I have packages = [{ include = "mypkg", from="src" }] in my pyprojects.toml and am using regular mkPoetryApplication. It works in a devShell, but not system-wide when using something likepython311.withPackages(ps: [ps.someNixPkgsPackage myflake.packages.${system}.default ])` | 16:03:13 |
virtu | * is there anything special I need to pay attention to if I want to use poetry2nix to create a package that I can import after installing via flake? for some reason, the package is not in the site-packages of the system-wide python env and I can't import it. I have packages = [{ include = "mypkg", from="src" }] in my pyprojects.toml and am using regular mkPoetryApplication. It works in a devShell, but not system-wide when using something likepython311.withPackages(ps: \[ps.someNixPkgsPackage myflake.packages.${system}.default \])\ | 16:04:13 |
| 15 Oct 2024 |
| nate5824 joined the room. | 21:33:26 |
nate5824 | Hello, I'm trying to use P2N to get a development environment for Langchain https://github.com/langchain-ai/langchain.
I have a simple env:
myenv = { poetry2nix, lib }: poetry2nix.mkPoetryEnv {
projectDir = self;
preferWheels = true;
}
and I get this error:
error: attribute 'override' missing
at /nix/store/x946wzivanqfxs1dpyai49wfwmj1mimy-source/overrides/default.nix:3851:20:
3850| # the complexity manageable for now.
3851| tokenizers = prev.tokenizers.override {
| ^
3852| preferWheel = true;
| 21:34:37 |
nate5824 | * Hello, I'm trying to use P2N to get a development environment for Langchain https://github.com/langchain-ai/langchain.
I have a simple env as a flake.nix in the root of the Langchain repo (using that pyproject/poetry.toml):
myenv = { poetry2nix, lib }: poetry2nix.mkPoetryEnv {
projectDir = self;
preferWheels = true;
}
and I get this error:
error: attribute 'override' missing
at /nix/store/x946wzivanqfxs1dpyai49wfwmj1mimy-source/overrides/default.nix:3851:20:
3850| # the complexity manageable for now.
3851| tokenizers = prev.tokenizers.override {
| ^
3852| preferWheel = true;
| 21:34:58 |
nate5824 | I only added preferWheels = true for maturin but supposedly there's already an override for that in p2n? | 21:59:19 |
nate5824 | ModuleNotFoundError: No module named 'maturin' | 22:05:41 |
| 16 Oct 2024 |
| loudgolem joined the room. | 02:30:30 |
Artturin | In reply to @nate5824:matrix.org
Hello, I'm trying to use P2N to get a development environment for Langchain https://github.com/langchain-ai/langchain.
I have a simple env as a flake.nix in the root of the Langchain repo (using that pyproject/poetry.toml):
myenv = { poetry2nix, lib }: poetry2nix.mkPoetryEnv {
projectDir = self;
preferWheels = true;
}
and I get this error:
error: attribute 'override' missing
at /nix/store/x946wzivanqfxs1dpyai49wfwmj1mimy-source/overrides/default.nix:3851:20:
3850| # the complexity manageable for now.
3851| tokenizers = prev.tokenizers.override {
| ^
3852| preferWheel = true;
Weird, override exists for it on unstable and nixos-24.05
nix-repl> python3Packages.tokenizers.override
{ __functionArgs = { ... }; __functor = «lambda @ /home/artturin/nixpkgs/lib/trivial.nix:895:19»; }
| 04:28:53 |
loudgolem | maybe offtopic but I have the same error with override with home-manager with https://github.com/nix-community/home-manager/pull/5930 when I do nix build .#test-espanso-basic-configuration
error: attribute 'override' missing
at /nix/store/60sn02zhawl3kwn0r515zff3h6hg6ydz-source/pkgs/top-level/all-packages.nix:4867:21:
4866| };
4867| espanso-wayland = espanso.override {
| ^
4868| x11Support = false;
| 04:31:02 |
loudgolem | * maybe offtopic and/or unrelated but I have the same error with override with home-manager with https://github.com/nix-community/home-manager/pull/5930 when I do nix build .#test-espanso-basic-configuration
error: attribute 'override' missing
at /nix/store/60sn02zhawl3kwn0r515zff3h6hg6ydz-source/pkgs/top-level/all-packages.nix:4867:21:
4866| };
4867| espanso-wayland = espanso.override {
| ^
4868| x11Support = false;
| 04:31:45 |
loudgolem | * maybe offtopic and/or unrelated but I have the same error with override with home-manager with https://github.com/nix-community/home-manager/pull/5930 when I do nix build .#test-espanso-basic-configuration
error: attribute 'override' missing
at /nix/store/60sn02zhawl3kwn0r515zff3h6hg6ydz-source/pkgs/top-level/all-packages.nix:4867:21:
4866| };
4867| espanso-wayland = espanso.override {
| ^
4868| x11Support = false;
| 04:32:11 |
Artturin | In reply to @artturin:matrix.org
Weird, override exists for it on unstable and nixos-24.05
nix-repl> python3Packages.tokenizers.override
{ __functionArgs = { ... }; __functor = «lambda @ /home/artturin/nixpkgs/lib/trivial.nix:895:19»; }
Oh yeah poetry2nix doesn't use those | 04:32:51 |
Artturin | I think | 04:33:55 |
Artturin | I wonder if this works https://github.com/nix-community/poetry2nix/blob/8a18db56dd62edd26458a87e4d335b7df84c3f3f/overrides/default.nix#L884 | 04:34:09 |
Artturin | Maybe missing a lib.makeOverridable call somewhere | 04:34:34 |
Artturin | In reply to @phanirithvij:matrix.org
maybe offtopic and/or unrelated but I have the same error with override with home-manager with https://github.com/nix-community/home-manager/pull/5930 when I do nix build .#test-espanso-basic-configuration
error: attribute 'override' missing
at /nix/store/60sn02zhawl3kwn0r515zff3h6hg6ydz-source/pkgs/top-level/all-packages.nix:4867:21:
4866| };
4867| espanso-wayland = espanso.override {
| ^
4868| x11Support = false;
Not using callPackage (which applies makeOverridable) or makeOverridable will cause override to be missing
callPackage is used so neither of those are the problem https://github.com/NixOS/nixpkgs/blob/6e918e75e8bed152f24787aaad718649dc1963fe/pkgs/top-level/all-packages.nix#L4858 | 04:43:34 |
Artturin | Wrong room anyways, I looked and couldn't see the problem. | 04:54:07 |
| akshaykarle joined the room. | 09:56:30 |
| 18 Oct 2024 |
| @kritnich:kritni.ch left the room. | 11:01:03 |
| 19 Oct 2024 |
| opacity=0 joined the room. | 15:07:29 |
| 20 Oct 2024 |
laurents | Hello! I'm trying to package a python app into a docker image with poetry2nix and then streamLayeredImage. I'm struggling to get my own code into the result. My code is organised like:
+ my_project
|- + ofd_runner
| | ...
| pyproject.toml
| poetry.lock
| flake.nix
In flake.nix I do:
myEnv = pkgs.poetry2nix.mkPoetryEnv {
projectDir = ./.;
preferWheels = true;
};
dockerImage = pkgs.docker.streamLayeredImage {
name = "ofd_user_code";
tag = "latest";
contents = [
pkgs.bash
pkgs.coreutils
ofdUserCodeEnv
];
config = {
Cmd = [
"${myEnv}/bin/dagster"
"api"
"grpc"
"-h"
"0.0.0.0"
"-p"
"4000"
"-m"
"ofd_runner"
];
Env = [
"DAGSTER_HOME=${dagsterHome}"
];
WorkingDir = "${myEnv}/lib/python3.11/site-packages";
};
In pyproject.toml, I have a set of dependencies which end up in my docker image, I can do import polars in the python in that docker image, but import ofd_runner won't work. Why is that? How do I get my own code in ofd_runner to land in my image? | 19:19:23 |
laurents | In reply to @laurents:fsfe.org
Hello! I'm trying to package a python app into a docker image with poetry2nix and then streamLayeredImage. I'm struggling to get my own code into the result. My code is organised like:
+ my_project
|- + ofd_runner
| | ...
| pyproject.toml
| poetry.lock
| flake.nix
In flake.nix I do:
myEnv = pkgs.poetry2nix.mkPoetryEnv {
projectDir = ./.;
preferWheels = true;
};
dockerImage = pkgs.docker.streamLayeredImage {
name = "ofd_user_code";
tag = "latest";
contents = [
pkgs.bash
pkgs.coreutils
ofdUserCodeEnv
];
config = {
Cmd = [
"${myEnv}/bin/dagster"
"api"
"grpc"
"-h"
"0.0.0.0"
"-p"
"4000"
"-m"
"ofd_runner"
];
Env = [
"DAGSTER_HOME=${dagsterHome}"
];
WorkingDir = "${myEnv}/lib/python3.11/site-packages";
};
In pyproject.toml, I have a set of dependencies which end up in my docker image, I can do import polars in the python in that docker image, but import ofd_runner won't work. Why is that? How do I get my own code in ofd_runner to land in my image? apparently I had to use mkPoetryApplication and then use .dependencyEnv to get my code in there. | 22:56:03 |
| 21 Oct 2024 |
| adrblo joined the room. | 14:36:10 |