!rWxyQqNqMUDLECdsIf:blad.is

Poetry2nix

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

Load older messages


SenderMessageTime
26 Oct 2023
@k900:0upti.meK900And the new instance happens when we export the builder functions directly from the flake21:28:46
@k900:0upti.meK900Because those use the flake's nixpkgsd21:28:51
@k900:0upti.meK900* Because those use the flake's nixpkgs21:28:52
@k900:0upti.meK900And not your app's21:28:55
@schmittlauch:ohai.isschmittlauch (he/him)I see. Thx.21:29:21
@schmittlauch:ohai.isschmittlauch (he/him)Still not qualified enough to figure out the best design choices, but flakes often trigger significant cases of "wat!?" for me ^^21:30:14
@schmittlauch:ohai.isschmittlauch (he/him)
In reply to @k900:0upti.me
And the new instance happens when we export the builder functions directly from the flake
I see why you're doing it that way, but IMHO needing to do this is still against the basic claimed perks/ goals of flakes, e.g. that they have introspectable, discoverable and (hopefully) enumerable outputs that are then re-used by other flakes.
22:05:01
@k900:0upti.meK900 Again, we should probably export poetry2nix.lib.mkPoetry2Nix { pkgs } 22:06:03
@schmittlauch:ohai.isschmittlauch (he/him)If this has the same footprint regarding number of evaluated nixpkgs instances, then: yes, that'd be great (:22:14:41
@k900:0upti.meK900It dos22:15:13
@k900:0upti.meK900* It does22:15:15
@schmittlauch:ohai.isschmittlauch (he/him)And as the legacyPackages output was only broken on master a few days ago, it is IMHO tolerable to break the exposed API again.22:15:31
@k900:0upti.meK900It doesn't break anything22:23:18
@k900:0upti.meK900It just adds new API22:23:21
@k900:0upti.meK900Anyway, done here: https://github.com/nix-community/poetry2nix/pull/137522:23:34
27 Oct 2023
@adis:blad.isadisbladisI just moved pyproject.nix to nix-community00:55:44
@adis:blad.isadisbladisIf it's going to be such a fundamental dependency of poetry2nix it should live in the same org00:56:02
@federicodschonborn:matrix.org@federicodschonborn:matrix.org changed their profile picture.01:24:26
@k900:0upti.meK900Maybe that will get more eyes on it too 06:10:37
@adis:blad.isadisbladisFor better or for worse =)06:48:53
@adis:blad.isadisbladis I was holding off on moving it precisely to get less eyes on it ;) 06:49:04
@janik0:matrix.org@janik0:matrix.org joined the room.12:56:55
@janik0:matrix.org@janik0:matrix.org

Hi, I'm not too familiar with poetry2nix so excuse the probably stupid question, how do I make nix build myPoetryPackage run tests?
Currently my Project looks like:

├── flake.lock
├── flake.nix
├── LICENSE.md
├── poetry.lock
├── pyproject.toml
├── README.md
├── src
│   └── first_time_contribution_tagger
│       ├── __init__.py
│       └── pullRequest.py
└── tests
    └── test_filterGraphqlOutput.py

And if I do: poetry run pytest the test runs successfully

13:04:38
@k900:0upti.meK900 Add pytestCheckHook to your nativeBuildInputs 13:05:28
@mlenz:matrix.org@mlenz:matrix.org I also did not know about this hook! One question though: Which attribute contains this hook? All examples I found online receive it as an argument via callPackage. I tried „pkgs.pytestCheckHook“, but this is empty.   13:16:09
@k900:0upti.meK900 It's in python3Packages 13:16:22
@janik0:matrix.org@janik0:matrix.org

doing:

          defaultPackage = pkgs.poetry2nix.mkPoetryApplication {
            projectDir = ./.;
            nativeBuildInputs = with pkgs; [
              python3.pkgs.pytestCheckHook
            ];
          };

seems to work, currently just have to pin some versions to see if it actually works because pytest and pluggy in my local project are newer then the one in nixpkgs

13:18:05
@janik0:matrix.org@janik0:matrix.orgimage.png
Download image.png
13:21:20
@k900:0upti.meK900Oh13:21:44
@k900:0upti.meK900pytestCheckHook probably pulls in its own pytest13:21:50

Show newer messages


Back to Room ListRoom Version: 6