!rWxyQqNqMUDLECdsIf:blad.is

Poetry2nix

318 Members
https://github.com/nix-community/poetry2nix63 Servers

Load older messages


SenderMessageTime
2 Oct 2024
@mirorred_basilisk:matrix.orgmirorred_basilisk * yeah okay it seems like a partially fixed issue with poetry2nix and some packages? I guess i'll make a new issue about it / see if i can fix the deps14:33:41
4 Oct 2024
@ryoschin:matrix.org@ryoschin:matrix.org left the room.22:04:24
8 Oct 2024
@schuelermine:matrix.orgschuelermine changed their profile picture.16:33:14
9 Oct 2024
@john:friendsgiv.ingjohn joined the room.01:20:20
@shamrocklee:matrix.orgShamrockLee (Yueh-Shun Li) set a profile picture.14:18:28
@schuelermine:matrix.orgschuelermine changed their profile picture.23:47:10
10 Oct 2024
@milibopp:matrix.org@milibopp:matrix.org left the room.09:10:54
@blaese:matrix.uni-marburg.deOliver Bläse joined the room.20:34:11
11 Oct 2024
@blaese:matrix.uni-marburg.deOliver Bläsehi, 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
@tyberius_prime:matrix.orgTyberiusPrime (smilodon inopinatus)are you adding fastapi[standard]? I think there was a github issue about this recently...11:01:35
@blaese:matrix.uni-marburg.deOliver BläseYes, 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
@blaese:matrix.uni-marburg.deOliver BläseAnd 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
@blaese:matrix.uni-marburg.deOliver 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:fsfe.orglaurents joined the room.12:19:08
@laurents:fsfe.orglaurents

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:fsfe.orglaurents *

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:fsfe.orglaurents *

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:fsfe.orglaurents *

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:fsfe.orglaurents

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:0upti.meK900This might just be a side effect of package name normalization 15:17:07
@laurents:fsfe.orglaurentsit 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:0upti.meK900We try to normalize it across the ecosystem 15:29:43
@blaese:matrix.uni-marburg.deOliver BläseIs 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:fsfe.orglaurents
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:matrix.imvirtu 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:matrix.imvirtu * 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:matrix.orgnate5824 joined the room.21:33:26
@nate5824:matrix.orgnate5824

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:matrix.orgnate5824 *

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:matrix.orgnate5824 I only added preferWheels = true for maturin but supposedly there's already an override for that in p2n? 21:59:19

Show newer messages


Back to Room ListRoom Version: 6