| 26 Oct 2023 |
K900 | It just adds new API | 22:23:21 |
K900 | Anyway, done here: https://github.com/nix-community/poetry2nix/pull/1375 | 22:23:34 |
| 27 Oct 2023 |
adisbladis | I just moved pyproject.nix to nix-community | 00:55:44 |
adisbladis | If it's going to be such a fundamental dependency of poetry2nix it should live in the same org | 00:56:02 |
| @federicodschonborn:matrix.org changed their profile picture. | 01:24:26 |
K900 | Maybe that will get more eyes on it too | 06:10:37 |
adisbladis | For better or for worse =) | 06:48:53 |
adisbladis | I was holding off on moving it precisely to get less eyes on it ;) | 06:49:04 |
| @janik0:matrix.org joined the room. | 12:56:55 |
@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 | Add pytestCheckHook to your nativeBuildInputs | 13:05:28 |
@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 | It's in python3Packages | 13:16:22 |
@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 |  Download image.png | 13:21:20 |
K900 | Oh | 13:21:44 |
K900 | pytestCheckHook probably pulls in its own pytest | 13:21:50 |
@janik0:matrix.org | I have no idea how to pin them to use the same version since the semVersion numbers seem to be the same | 13:21:52 |
K900 | You want to use the pytestCheckHook from the poetry2nix-created packages set | 13:22:12 |
@janik0:matrix.org | In reply to @k900:0upti.me You want to use the pytestCheckHook from the poetry2nix-created packages set how would I access that? | 13:22:43 |
K900 | That's... a good question, actually | 13:23:31 |
K900 | I'm not sure we have a good way to actually get to that from inside the package itself | 13:23:43 |
@janik0:matrix.org | I can also switch to buildPythonPackage from nixpkgs since I'm reworking some parts of the project anyways like adding test and fixing the bug where it tags prs from people that just changed there github name key because of cause I made the mistake of using that instead of the id.. | 13:28:02 |
@janik0:matrix.org | * I can also just switch to buildPythonPackage from nixpkgs since I'm reworking some parts of the project anyways like adding test and fixing the bug where it tags prs from people that just changed there github name key because of cause I made the mistake of using that instead of the id.. | 13:28:12 |
| @petrichor:envs.net joined the room. | 18:24:47 |
| 28 Oct 2023 |
adisbladis | It's not exactly obvious... But I think you could do:
let
drv = poetry2nix.mkPoetryApplication {
nativeBuildInputs = [
drv.passthru.python.pkgs.pytestCheckHook
];
};
in drv
| 03:31:44 |
adisbladis | In reply to @janik0:matrix.org how would I access that? ^ | 03:32:16 |
cpcloud | Looks like pyproject.nix doesn't handle ^4 style constraints | 09:44:40 |
adisbladis | In reply to @pcloud:matrix.org Looks like pyproject.nix doesn't handle ^4 style constraints It does: https://nix-community.github.io/pyproject.nix/lib/poetry.html#function-library-lib.poetry.parseVersionCond | 10:01:13 |
cpcloud | Does it support it in markers? | 10:01:47 |