!rWxyQqNqMUDLECdsIf:blad.is

Poetry2nix

330 Members
https://github.com/nix-community/poetry2nix62 Servers

Load older messages


SenderMessageTime
3 Mar 2022
@jamie-howlie:monero.socialjamie-howlieI have added our pypi server to the pyproject.toml, and if using it outsinde of nix I do manage to add the library to my virtual environment13:28:18
4 Mar 2022
@jmgilman:matrix.orgJoshua Gilman joined the room.18:01:52
@jmgilman:matrix.orgJoshua GilmanAnyone available to help troubleshoot failing build?18:04:09
@jmgilman:matrix.orgJoshua Gilman * Anyone available to help troubleshoot a failing build?18:04:22
5 Mar 2022
@dooygoy:matrix.orgdooygoy left the room.13:56:07
6 Mar 2022
@artturin:matrix.orgArtturin
In reply to @jmgilman:matrix.org
Anyone available to help troubleshoot a failing build?
You should post the error instead of asking if anyone is available to help you
09:05:20
8 Mar 2022
@finn:tomesh.netfinn joined the room.16:16:26
@k900:0upti.meK900 changed their profile picture.18:32:14
@finn:tomesh.netfinn left the room.16:17:40
@charmonium:matrix.orgcharmonium joined the room.23:43:02
@charmonium:matrix.orgcharmonium Any idea why poetry2nix fails to install benchexec? Benchexec's setup.cfg specifies lxml, which pip tries to download, but can't. How do I make an overlay to use the "right" lxml? 23:51:08
9 Mar 2022
@tompurl:destrocodpiece.wtfTom Purl (he/him) joined the room.04:23:32
@tompurl:destrocodpiece.wtfTom Purl (he/him) Hello! I went through the tutorial on Youtube for packaging a Flask app. I would love to do the same thing with a Django app but I assume that I would need to figure out how to start my app from the tool.poetry.scripts command in pyproject.toml. However, I can't find any resource on how exactly to do that. Currently I run python manage.py runserver. How can I specify that command from poetry? 04:43:41
@flokli:matrix.orgflokli joined the room.12:40:05
@vengmark2:matrix.orgl0b0 joined the room.22:05:15
@vengmark2:matrix.orgl0b0 How should I expose the Poetry executable itself when using mkPoetryEnv? I need to be able to run things like poetry add while in the Nix shell. Using mkShell with buildInputs = [ pkgs.poetry ]; seems wrong. 22:07:17
@vengmark2:matrix.orgl0b0 * How should I expose the Poetry executable itself when using mkPoetryEnv? I need to be able to run things like poetry add while in the Nix shell. Using mkShell with buildInputs = [ pkgs.poetry ]; seems wrong. And using extraPackages = ps: [ ps.poetry ]; fails with a collision message. 22:10:01
10 Mar 2022
@mou_bugtracker:matrix.orgmou
In reply to @vengmark2:matrix.org
How should I expose the Poetry executable itself when using mkPoetryEnv? I need to be able to run things like poetry add while in the Nix shell. Using mkShell with buildInputs = [ pkgs.poetry ]; seems wrong. And using extraPackages = ps: [ ps.poetry ]; fails with a collision message.

i use this approach (snippet taken from flake.nix)

        devShell = (pkgs.poetry2nix.mkPoetryEnv {
          projectDir = ./.;
          editablePackageSources = {
            whateverpackagenames = ./.;
          };
        }).env.overrideAttrs (oldAttrs: {
          buildInputs = [ pkgs.poetry ];
        });

05:43:44
@mou_bugtracker:matrix.orgmou
In reply to @tompurl:destrocodpiece.wtf
Hello! I went through the tutorial on Youtube for packaging a Flask app. I would love to do the same thing with a Django app but I assume that I would need to figure out how to start my app from the tool.poetry.scripts command in pyproject.toml. However, I can't find any resource on how exactly to do that. Currently I run python manage.py runserver. How can I specify that command from poetry?
Sorry for late reply, but this question is about poetry itself, not about it integration with nix nor the poetry2nix. So i'm afraid you should try to search answer in diffrerent community. At least i'm not aware about soulution.
14:56:47
@tompurl:destrocodpiece.wtfTom Purl (he/him)
In reply to @mou_bugtracker:matrix.org
Sorry for late reply, but this question is about poetry itself, not about it integration with nix nor the poetry2nix. So i'm afraid you should try to search answer in diffrerent community. At least i'm not aware about soulution.

Thank you mou . I appreciate the help, and there's no reason to apologize :-)

Now that I've thought about the question a bit more, I think what I meant to ask was how does one package a Python app that is a server that has some sort of startup command?

It appears to me that poetry2nix will support the "startup command" only if it can be wrapped by the tools.poetry.scripts param in a pyproject.tompl file. Do you know if this is correct?

15:04:08
@mou_bugtracker:matrix.orgmou
In reply to @tompurl:destrocodpiece.wtf

Thank you mou . I appreciate the help, and there's no reason to apologize :-)

Now that I've thought about the question a bit more, I think what I meant to ask was how does one package a Python app that is a server that has some sort of startup command?

It appears to me that poetry2nix will support the "startup command" only if it can be wrapped by the tools.poetry.scripts param in a pyproject.tompl file. Do you know if this is correct?

i do not know anything about startup scripts, but as i'm aware, scripts declared in tools.poetry.scripts will be installed as part of package installation. Look at my snippet two message earlier (about devShell). I use it with direnv integration and it grants me environment there such scripts are in PATH.
15:10:27
@tompurl:destrocodpiece.wtfTom Purl (he/him)
In reply to @mou_bugtracker:matrix.org
i do not know anything about startup scripts, but as i'm aware, scripts declared in tools.poetry.scripts will be installed as part of package installation. Look at my snippet two message earlier (about devShell). I use it with direnv integration and it grants me environment there such scripts are in PATH.
Thank you!
15:11:02
@mou_bugtracker:matrix.orgmou
In reply to @tompurl:destrocodpiece.wtf
Thank you!
You can find more detailed example in poetry2nix README. direnv integration provided by nix-direnv. But i should note: i used only flake flavor and do not have any experience with plain nix
15:13:27
@vengmark2:matrix.orgl0b0
In reply to @mou_bugtracker:matrix.org

i use this approach (snippet taken from flake.nix)

        devShell = (pkgs.poetry2nix.mkPoetryEnv {
          projectDir = ./.;
          editablePackageSources = {
            whateverpackagenames = ./.;
          };
        }).env.overrideAttrs (oldAttrs: {
          buildInputs = [ pkgs.poetry ];
        });

Thank you! I ended up with a similar approach after a bunch of experimenting:
19:36:02
@vengmark2:matrix.orgl0b0
In reply to @mou_bugtracker:matrix.org

i use this approach (snippet taken from flake.nix)

        devShell = (pkgs.poetry2nix.mkPoetryEnv {
          projectDir = ./.;
          editablePackageSources = {
            whateverpackagenames = ./.;
          };
        }).env.overrideAttrs (oldAttrs: {
          buildInputs = [ pkgs.poetry ];
        });

*

Thank you! I ended up with a similar approach after a bunch of experimenting:

{ pkgs ? import
    (
      fetchTarball
        {
          name = "21.11-2022-03-08";
          url = "https://github.com/NixOS/nixpkgs/archive/bb3dee861440695ce6d8f43d0dd3a97622cb08c4.tar.gz";
          sha256 = "0j94fz656a0xf3s7kvi8p16p52186ks6r3m1gv8i2zmiinlvv5v3";
        })
    { }
}:
let
  python = pkgs.python38;
  poetryEnv = pkgs.poetry2nix.mkPoetryEnv {
    inherit python;
    projectDir = builtins.path { path = ./.; name = "geostore"; };
    extraPackages = ps: [ ps.pip ];
  };
in
pkgs.mkShell {
  buildInputs = [
    (pkgs.poetry.override {
      inherit python;
    })
    poetryEnv
  ];
19:37:58
@vengmark2:matrix.orgl0b0 *

Thank you! I ended up with a similar approach after a bunch of experimenting:

{ pkgs ? import
    (
      fetchTarball
        {
          name = "21.11-2022-03-08";
          url = "https://github.com/NixOS/nixpkgs/archive/bb3dee861440695ce6d8f43d0dd3a97622cb08c4.tar.gz";
          sha256 = "0j94fz656a0xf3s7kvi8p16p52186ks6r3m1gv8i2zmiinlvv5v3";
        })
    { }
}:
let
  python = pkgs.python38;
  poetryEnv = pkgs.poetry2nix.mkPoetryEnv {
    inherit python;
    projectDir = builtins.path { path = ./.; name = "geostore"; };
    extraPackages = ps: [ ps.pip ];
  };
in
pkgs.mkShell {
  buildInputs = [
    (pkgs.poetry.override {
      inherit python;
    })
    poetryEnv
  ];
}```
19:38:09
@vengmark2:matrix.orgl0b0 *

Thank you! I ended up with a similar approach after a bunch of experimenting:

{ pkgs ? import
    (
      fetchTarball
        {
          name = "21.11-2022-03-08";
          url = "https://github.com/NixOS/nixpkgs/archive/bb3dee861440695ce6d8f43d0dd3a97622cb08c4.tar.gz";
          sha256 = "0j94fz656a0xf3s7kvi8p16p52186ks6r3m1gv8i2zmiinlvv5v3";
        })
    { }
}:
let
  python = pkgs.python38;
  poetryEnv = pkgs.poetry2nix.mkPoetryEnv {
    inherit python;
    projectDir = builtins.path { path = ./.; name = "geostore"; };
    extraPackages = ps: [ ps.pip ];
  };
in
pkgs.mkShell {
  buildInputs = [
    (pkgs.poetry.override {
      inherit python;
    })
    poetryEnv
  ];
}
19:38:19
@vengmark2:matrix.orgl0b0 *

Thank you! I ended up with a similar approach after a bunch of experimenting:

{ pkgs ? import
    (
      fetchTarball
        {
          name = "nixpkgs-21.11-2022-01-03";
          url = "https://github.com/NixOS/nixpkgs/archive/08370e1e271f6fe00d302bebbe510fe0e2c611ca.tar.gz";
          sha256 = "1s9g0vry5jrrvvna250y538i99zy12xy3bs7m3gb4iq64qhyd6bq";
        })
    { }
}:
let
  python = pkgs.python38;
  poetryEnv = pkgs.poetry2nix.mkPoetryEnv {
    projectDir = builtins.path { path = ./.; name = "geostore"; };
    inherit python;
    extraPackages = ps: [ ps.pip ];
  };
in
poetryEnv.env.overrideAttrs (
  oldAttrs: {
    buildInputs = [
      pkgs.nodePackages.aws-azure-login
      (pkgs.poetry.override {
        inherit python;
      })
    ];
  }
)
19:40:15
@vengmark2:matrix.orgl0b0 *

Thank you! I ended up with a similar approach after a bunch of experimenting:

{ pkgs ? import
    (
      fetchTarball
        {
          name = "nixpkgs-21.11-2022-01-03";
          url = "https://github.com/NixOS/nixpkgs/archive/08370e1e271f6fe00d302bebbe510fe0e2c611ca.tar.gz";
          sha256 = "1s9g0vry5jrrvvna250y538i99zy12xy3bs7m3gb4iq64qhyd6bq";
        })
    { }
}:
let
  python = pkgs.python38;
  poetryEnv = pkgs.poetry2nix.mkPoetryEnv {
    projectDir = builtins.path { path = ./.; name = "geostore"; };
    inherit python;
    extraPackages = ps: [ ps.pip ];
  };
in
poetryEnv.env.overrideAttrs (
  oldAttrs: {
    buildInputs = [
      pkgs.nodePackages.aws-azure-login
      (pkgs.poetry.override {
        inherit python;
      })
    ];
  }
)

This way the poetry2nix env and the Nix shell end up with the same Python environment, rather than the same Python interpreter in two different Nix store directories.

19:41:53
@vengmark2:matrix.orgl0b0 *

Thank you! I ended up with a similar approach after a bunch of experimenting:

{ pkgs ? import
    (
      fetchTarball
        {
          name = "nixpkgs-21.11-2022-01-03";
          url = "https://github.com/NixOS/nixpkgs/archive/08370e1e271f6fe00d302bebbe510fe0e2c611ca.tar.gz";
          sha256 = "1s9g0vry5jrrvvna250y538i99zy12xy3bs7m3gb4iq64qhyd6bq";
        })
    { }
}:
let
  python = pkgs.python38;
  poetryEnv = pkgs.poetry2nix.mkPoetryEnv {
    projectDir = builtins.path { path = ./.; name = "geostore"; };
    inherit python;
    extraPackages = ps: [ ps.pip ];
  };
in
poetryEnv.env.overrideAttrs (
  oldAttrs: {
    buildInputs = [
      (pkgs.poetry.override {
        inherit python;
      })
    ];
  }
)

This way the poetry2nix env and the Nix shell end up with the same Python environment, rather than the same Python interpreter in two different Nix store directories.

19:42:18

Show newer messages


Back to Room ListRoom Version: 6