!rWxyQqNqMUDLECdsIf:blad.is

Poetry2nix

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

Load older messages


SenderMessageTime
9 Jun 2022
@edrex:matrix.orgedrexhttps://github.com/nix-community/poetry2nix/blob/master/templates/app/flake.nix#L28 uses poetryApplication, but that just results in a shell, not running your application script.02:48:44
@edrex:matrix.orgedrex

Answering my own question:
poetry add has a --lock flag:

Do not perform operations (only update the lockfile).

This is ideal for installing packages that require an override to build in the current env.

Looking at the poetry2nix README, I'm not sure where that could be added, but it's definitely valuable

05:54:44
@edrex:matrix.orgedrex *

Answering my own question:
poetry add has a --lock flag:

Do not perform operations (only update the lockfile).

This is ideal for ~~installing~~ adding packages that require an override to build in the current env.

Looking at the poetry2nix README, I'm not sure where that could be added, but it's definitely valuable

05:55:19
@edrex:matrix.orgedrex I don't really get what preferWheels does. It just tries to get prebuilt packages over building from source? 06:17:09
@edrex:matrix.orgedrex

reading the source of mkPoetryApplicaiton, it seems like it's supposed to produce a runnable, but I get an error

error: attribute 'apps.x86_64-linux.default' should have type 'app'

(nix 2.8)

Anybody know what's up with this? How should I have my project structured for this to work? I have a runnable __init__.py at the project root.

06:45:03
@adis:blad.isadisbladis
In reply to @edrex:matrix.org
I don't really get what preferWheels does. It just tries to get prebuilt packages over building from source?
Yes, exactly. It changes the preference order.
19:53:20
12 Jun 2022
@jamie-howlie:monero.socialjamie-howlieHi all, im trying to use poetry2nix, but I cant get it to work with our internal pypi server.10:54:32
@jamie-howlie:monero.socialjamie-howlieI do have a poetry.lock that points to it10:54:46
@jamie-howlie:monero.socialjamie-howlieAny idea on how to get that working?10:54:57
13 Jun 2022
@linus:schreibt.jetztLinux Hackerman joined the room.14:51:07
@linus:schreibt.jetztLinux HackermanIs there an elegant way to run package tests in a derivation when using poetry2nix?14:58:31
@adis:blad.isadisbladis
In reply to @linus:schreibt.jetzt
Is there an elegant way to run package tests in a derivation when using poetry2nix?
You could just run it in the check phase?
17:13:59
14 Jun 2022
@linus:schreibt.jetztLinux Hackermanoh right, yeah that works since I'm using mkPoetryApplication10:15:13
@linus:schreibt.jetztLinux Hackermanit's a bit confusing since not all the mkPoetry* support all the options that they could AFAIU10:15:31
@linus:schreibt.jetztLinux Hackermanhm, why does setting nativeBuildInputs for a package in an override prevent it from using the python builder?10:19:08
15 Jun 2022
@vengmark2:matrix.orgl0b0 Hi all, I'm running into a problem where nix-shell --pure --run ansible-lint fails with "ImportError: cannot import name 'main' from 'ansible.cli.config'" after changing from nixpkgs 21.11-2022-03-08 (https://github.com/NixOS/nixpkgs/archive/bb3dee861440695ce6d8f43d0dd3a97622cb08c4.tar.gz) to 22.05 (https://github.com/NixOS/nixpkgs/archive/ce6aa13369b667ac2542593170993504932eb836.tar.gz). 04:17:26
@robert:funklause.dedotlambda
In reply to @vengmark2:matrix.org
Hi all, I'm running into a problem where nix-shell --pure --run ansible-lint fails with "ImportError: cannot import name 'main' from 'ansible.cli.config'" after changing from nixpkgs 21.11-2022-03-08 (https://github.com/NixOS/nixpkgs/archive/bb3dee861440695ce6d8f43d0dd3a97622cb08c4.tar.gz) to 22.05 (https://github.com/NixOS/nixpkgs/archive/ce6aa13369b667ac2542593170993504932eb836.tar.gz).
nix-shell --pure -p ansible-lint --run ansible-lint works
04:25:27
@vengmark2:matrix.orgl0b0 dotlambda: I'm installing ansible-lint through poetry2nix though. 04:52:54
@vengmark2:matrix.orgl0b0(So that non-Nix users can use the repo.)04:53:16
@vengmark2:matrix.orgl0b0Scratch that. Turns out in this repo ansible-lint is installed with Nix and ansible itself is installed with Poetry. I'll fix that. Sorry for the noise.21:07:07
@vengmark2:matrix.orgl0b0 * Scratch that. Turns out in this repo pkgs.ansible-lint is installed with Nix and ansible itself is installed with Poetry. I'll fix that. Sorry for the noise. 21:08:34
18 Jun 2022
@atharvaamritkar:matrix.orgwiredhikari joined the room.10:03:40
20 Jun 2022
@dylanrjohnston-fz:matrix.orgdylanrjohnston-fz joined the room.07:10:36
21 Jun 2022
@b42:matrix.orgb42 joined the room.11:57:00
@b42:matrix.orgb42 Hello! I'm looking into replacing "poetry shell" with "nix-shell" in our repo and it seems to work great except the one package contained directly in the repo is not visible in the environment: https://github.com/trezor/trezor-firmware/blob/onvej-sl/poetry2nix/pyproject.toml#L10
Explicitly listing it under editablePackageSources doesn't help. I'm not very familiar with python packaging and probably overlooking something, any hints what to look for?
13:28:41
@b42:matrix.orgb42Shell.nix in question: https://github.com/trezor/trezor-firmware/blob/onvej-sl/poetry2nix/ci/shell.nix#L57-L5913:29:12
24 Jun 2022
@arpd:matrix.orgarpd joined the room.17:08:58
@arpd:matrix.orgarpd Is using poetry2nix purely for environment setup a reasonable use case? I couldn't find much in the docs to help, I'm not interested in building a poetry project, but rather I want to populate a python environment with packages, and if necessary fetch their dependencies and build them locally if cached versions are unavailable 17:10:31
@arpd:matrix.orgarpd I don't mind having a poetry.lock file but after trying that and adding the result of mkApplication or whatever, I got an infinite recursion error when adding the result to buildinputs of mkShell 17:11:39
@k900:0upti.meK900Post your flake17:14:01

Show newer messages


Back to Room ListRoom Version: 6