10 Oct 2024 |
| @milibopp:matrix.org left the room. | 09:10:54 |
| Oliver Bläse joined the room. | 20:34:11 |
11 Oct 2024 |
Oliver Bläse | hi, i want to use poetry2nix to deploy my fastapi application, is there a way to implement the fastapi cli tool to it, so i can benefit from thair well structured logs? | 06:34:34 |
TyberiusPrime (smilodon inopinatus) | are you adding fastapi[standard]? I think there was a github issue about this recently... | 11:01:35 |
Oliver Bläse | Yes, I think this has something to do with the fact that the packages are in a different location in the Nix system. | 11:03:36 |
Oliver Bläse | And I currently don't know how I can start my application in the scripts section with the CLI. I only know the Unicorn version from my main package directly in Python. | 11:04:54 |
Oliver Bläse | * And I currently don't know how I can start my application in the scripts section with the CLI. I only know the Unicrin version from my main package directly in Python. | 11:05:12 |
12 Oct 2024 |
| laurents joined the room. | 12:19:08 |
laurents | Hi all, I am using poetry2nix and crane to build a polars expression in rust for use in python. The setup works outside nix, but I'm struggling to make it work with nix. Each part works fine, but as soon as I add the rust wheel to pyproject.toml , the build fails with:
error: path '/nix/store/msa2hjlaa5dplqcynlcfkjrfs6hv4kck-source/data_pipeline/ofd_expressions/target/wheels/ofd_expressions-0.1.0-cp311-abi3-linux_x86_64.whl' does not exist
My pyproject.toml looks like this (most stuff removed for clarity). Basically the rust code is in a subfolder ofd_expressions .
[tool.poetry.dependencies]
python = ">3.11.0,<3.12"
[...more packages...]
ofd_expressions = { file = "ofd_expressions/target/wheels/ofd_expressions-0.1.0-cp311-abi3-linux_x86_64.whl" }
crateWheel =
(craneLib.buildPackage (
crateCfg
// {
pname = projectName;
version = projectVersion;
# cargoArtifacts = crateArtifacts;
}
# this points to the wheel that is built by crane
crateWheelSrc = "${crateWheel}/${wheelName}";
pkgOverrides = pkgs.poetry2nix.overrides.withDefaults (
final: prev: {
ofd_expressions = prev.ofd_expressions.overridePythonAttrs (old: {
# neither of these seem to change the error message
# src = crateWheelSrc;
src = "${crateWheel}";
});
}
);
dagitApp = pkgs.poetry2nix.mkPoetryApplication {
overrides = pkgOverrides;
projectDir = ./.;
preferWheels = true;
The override does not seem to have any effect, I get the same error whether I add it or not. What am I doing wrong?
| 12:47:14 |
laurents | * Hi all, I am using poetry2nix and crane to build a polars expression in rust for use in python. The setup works outside nix, but I'm struggling to make it work with nix. Each part works fine, but as soon as I add the rust wheel to pyproject.toml , the build fails with:
error: path '/nix/store/msa2hjlaa5dplqcynlcfkjrfs6hv4kck-source/data_pipeline/ofd_expressions/target/wheels/ofd_expressions-0.1.0-cp311-abi3-linux_x86_64.whl' does not exist
My pyproject.toml looks like this (most stuff removed for clarity). Basically the rust code is in a subfolder ofd_expressions .
[tool.poetry.dependencies]
python = ">3.11.0,<3.12"
[...more packages...]
ofd_expressions = { file = "ofd_expressions/target/wheels/ofd_expressions-0.1.0-cp311-abi3-linux_x86_64.whl" }
crateWheel =
(craneLib.buildPackage (
crateCfg
// {
pname = projectName;
version = projectVersion;
# cargoArtifacts = crateArtifacts;
}
# this points to the wheel that is built by crane
crateWheelSrc = "${crateWheel}/${wheelName}";
pkgOverrides = pkgs.poetry2nix.overrides.withDefaults (
final: prev: {
ofd_expressions = prev.ofd_expressions.overridePythonAttrs (old: {
# neither of these seem to change the error message
# src = crateWheelSrc;
src = "${crateWheel}";
});
}
);
dagitApp = pkgs.poetry2nix.mkPoetryApplication {
overrides = pkgOverrides;
projectDir = ./.;
preferWheels = true;
The override does not seem to have any effect, I get the same error whether I add it or not. What am I doing wrong?
| 13:07:39 |
laurents | * Hi all, I am using poetry2nix and crane to build a polars expression in rust for use in python. The setup works outside nix, but I'm struggling to make it work with nix. Each part works fine, but as soon as I add the rust wheel to pyproject.toml , the build fails with:
error: path '/nix/store/msa2hjlaa5dplqcynlcfkjrfs6hv4kck-source/data_pipeline/ofd_expressions/target/wheels/ofd_expressions-0.1.0-cp311-abi3-linux_x86_64.whl' does not exist
My pyproject.toml looks like this (most stuff removed for clarity). Basically the rust code is in a subfolder ofd_expressions .
[tool.poetry.dependencies]
python = ">3.11.0,<3.12"
[...more packages...]
ofd_expressions = { file = "ofd_expressions/target/wheels/ofd_expressions-0.1.0-cp311-abi3-linux_x86_64.whl" }
crateWheel =
(craneLib.buildPackage (
crateCfg
// {
pname = projectName;
version = projectVersion;
# cargoArtifacts = crateArtifacts;
}
# this points to the wheel that is built by crane
crateWheelSrc = "${crateWheel}/${wheelName}";
pkgOverrides = pkgs.poetry2nix.overrides.withDefaults (
final: prev: {
ofd_expressions = prev.ofd_expressions.overridePythonAttrs (old: {
# neither of these seem to change the error message
# src = crateWheelSrc;
src = "${crateWheel}";
});
}
);
dagitApp = pkgs.poetry2nix.mkPoetryApplication {
overrides = pkgOverrides;
projectDir = ./.;
preferWheels = true;
The override does not seem to have any effect, I get the same error whether I add it or not. What am I doing wrong?
| 13:08:21 |
laurents | * Hi all, I am using poetry2nix and crane to build a polars expression in rust for use in python. The setup works outside nix, but I'm struggling to make it work with nix. Each part works fine, but as soon as I add the rust wheel to pyproject.toml , the build fails with:
error: path '/nix/store/msa2hjlaa5dplqcynlcfkjrfs6hv4kck-source/data_pipeline/ofd_expressions/target/wheels/ofd_expressions-0.1.0-cp311-abi3-linux_x86_64.whl' does not exist
My pyproject.toml looks like this (most stuff removed for clarity). Basically the rust code is in a subfolder ofd_expressions .
[tool.poetry.dependencies]
python = ">3.11.0,<3.12"
[...more packages...]
ofd_expressions = { file = "ofd_expressions/target/wheels/ofd_expressions-0.1.0-cp311-abi3-linux_x86_64.whl" }
crateWheel =
(craneLib.buildPackage (
crateCfg
// {
pname = projectName;
version = projectVersion;
# cargoArtifacts = crateArtifacts;
}
# this points to the wheel that is built by crane
crateWheelSrc = "${crateWheel}/${wheelName}";
pkgOverrides = pkgs.poetry2nix.overrides.withDefaults (
final: prev: {
ofd_expressions = prev.ofd_expressions.overridePythonAttrs (old: {
# neither of these seem to change the error message
# src = crateWheelSrc;
src = "${crateWheel}";
});
}
);
dagitApp = pkgs.poetry2nix.mkPoetryApplication {
overrides = pkgOverrides;
projectDir = ./.;
preferWheels = true;
The override does not seem to have any effect, I get the same error whether I add it or not. What am I doing wrong? | 13:08:30 |
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 |
Oliver Bläse | 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 like python311.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 |