!rWxyQqNqMUDLECdsIf:blad.is

Poetry2nix

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

Load older messages


SenderMessageTime
6 May 2022
@a7p:matrix.orgAlbrecht Mühlenschulte:/ I'm currently working in nix repl and could not find anything on how to enable traces there.08:05:11
@adis:blad.isadisbladis
In reply to @a7p:matrix.org
:/ I'm currently working in nix repl and could not find anything on how to enable traces there.
Are you talking about https://github.com/nim65s/matrix-webhook
08:11:21
@adis:blad.isadisbladisI cloned it and built it just fine08:13:03
@a7p:matrix.orgAlbrecht Mühlenschulte
In reply to @adis:blad.is
Are you talking about https://github.com/nim65s/matrix-webhook
Exactly - till now I used mach-nix to install if from pypi, but now I need to patch it a bit, since influxdb send's webhook-messages formated in the wrong way.
08:13:09
@a7p:matrix.orgAlbrecht Mühlenschulte
In reply to @adis:blad.is
I cloned it and built it just fine
Oh! Then I'm messing up on a more general level :/.
08:13:53
@a7p:matrix.orgAlbrecht Mühlenschulte so just to be clear, poetry2nix.mkPoetryApplication { projectDir = ./.; } builds for you? 08:14:45
@adis:blad.isadisbladisYes08:14:59
@adis:blad.isadisbladisFrom poetry2nix master and a couple of days old nixos-unstable08:15:12
@a7p:matrix.orgAlbrecht Mühlenschulteokay, I'll update both and retry - thank you very much08:20:15
@a7p:matrix.orgAlbrecht Mühlenschulte adisbladis: thank you very much, it works fine with the poetry2nix version in unstable - should have tried that before wasting your time. 08:28:37
@adis:blad.isadisbladis:)08:33:40
@adis:blad.isadisbladisUsually I'm trying to backport updates, but there were some pretty big scary changes so I stopped doing this for 21.1108:34:31
@a7p:matrix.orgAlbrecht MühlenschulteRedacted or Malformed Event10:24:16
8 May 2022
@landau:matrix.orgrht joined the room.12:08:34
@landau:matrix.orgrhti have a question on https://github.com/nix-community/poetry2nix/issues/561#issuecomment-1120383711= -- i have used the latest master of poetry2nix, but i still got the error "can't find file to patch at input line". i'm trying to install mypy 0.94012:10:11
@landau:matrix.orgrht

my default.nix:

{ pkgs ? import <nixpkgs> {} }:
let
  poetry2nix_repo = fetchGit {
    url = "https://github.com/nix-community/poetry2nix.git";
    ref = "master";
    rev = "96e3794e5d4d48e7f85d0dfcee90256a3a65475b";
  };
  poetry2nix = import poetry2nix_repo {
    inherit pkgs;
    poetry = pkgs.poetry;
  };
  zulipEnv = poetry2nix.mkPoetryEnv {
    projectDir = ./.;
    preferWheels = true;
    python = pkgs.python310;
  };
in zulipEnv.env
12:10:29
@semmulder2:matrix.orgsemmulder2 joined the room.12:33:38
@semmulder2:matrix.orgsemmulder2

Hi all! I'm working on a PR to fix this issue: https://github.com/nix-community/poetry2nix/issues/613. But I'm running into something I don't know how to solve. To address this ticket I need to adjust a SetupHook to format a TOML file. Since there don't seem to be standalone TOML formatters out there I am planning on using https://pypi.org/project/toml/ or https://github.com/sdispater/tomlkit. However, adding that library as a dependency to the SetupHook like so:

makeSetupHook
{
  name = "remove-path-dependencies.sh";
  deps = [ python.pythonForBuild.pkgs.toml ];
  substitutions = {
    inherit pythonInterpreter;
    pyprojectPatchScript = "${./pyproject-without-special-deps.py}";
    fields = [ "path" ];
    kind = "path";
  };
} ./remove-special-dependencies.sh

seems to result in nix-build getting stuck in a loop during instantiation of the derivations. I guess this has something to do with pythonForBuild and some bootstrapping stuff, but I'm unsure how to proceed. Does anyone have an idea?

12:33:42
@semmulder2:matrix.orgsemmulder2

Figured it out:

      dontRemoveSpecialDependencies = map (p: p.pname) (
        python.pythonForBuild.pkgs.requiredPythonModules (with python.pythonForBuild.pkgs; [
          tomlkit
          packaging
          poetry-core
        ]));
...
      nativeBuildInputs = [
        pythonPackages.poetry2nixFixupHook
      ]
      ++ lib.optional (!isSource && (getManyLinuxDeps fileInfo.name).str != null) autoPatchelfHook
      ++ lib.optionals (format == "pyproject" && ! lib.elem name dontRemoveSpecialDependencies) [
        pythonPackages.removePathDependenciesHook
        pythonPackages.removeGitDependenciesHook
      ];
14:40:12
9 May 2022
@adis:blad.isadisbladis
In reply to @landau:matrix.org

my default.nix:

{ pkgs ? import <nixpkgs> {} }:
let
  poetry2nix_repo = fetchGit {
    url = "https://github.com/nix-community/poetry2nix.git";
    ref = "master";
    rev = "96e3794e5d4d48e7f85d0dfcee90256a3a65475b";
  };
  poetry2nix = import poetry2nix_repo {
    inherit pkgs;
    poetry = pkgs.poetry;
  };
  zulipEnv = poetry2nix.mkPoetryEnv {
    projectDir = ./.;
    preferWheels = true;
    python = pkgs.python310;
  };
in zulipEnv.env
Could you point me to the repo this is in?
08:11:25
@landau:matrix.orgrhti haven't committed anything to git (and github) yet08:26:17
@landau:matrix.orgrht

but this is a snippet of my pyproject.toml:

[tool.poetry.dependencies]
python = "^3.10"
mypy = "^0.940"
08:27:11
@adis:blad.isadisbladis Right, the culprit here is a combination of preferWheels and the patch being applied regardless 08:37:25
@landau:matrix.orgrhtok let me try without wheels08:37:43
@adis:blad.isadisbladis It takes a while to build mypy as it's doing some native compilation using mypyc 08:38:42
@adis:blad.isadisbladis
In reply to @landau:matrix.org
ok let me try without wheels
I've fixed it on poetry2nix master
08:38:59
@landau:matrix.orgrhtok, let me try master instead08:39:13
@adis:blad.isadisbladisSo that we don't apply the patch in the case of a wheel08:39:26
@landau:matrix.orgrhtappreciate the fix. this means a lot!08:39:31
@landau:matrix.orgrhtit works!08:43:39

Show newer messages


Back to Room ListRoom Version: 6