!rWxyQqNqMUDLECdsIf:blad.is

Poetry2nix

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

Load older messages


SenderMessageTime
4 Jun 2022
@adis:blad.isadisbladisIn nixpkgs you'd have to copy pyproject.toml & poetry.lock13:36:24
@schuelermine:matrix.orgschuelermineOK13:36:33
5 Jun 2022
@landau:matrix.orgrhtwith the context of https://discourse.nixos.org/t/mach-nix-pip2nix-poetry2nix-or-pynixify-for-zulip-provision/18836/19, one of the 2 blockers for zulip to use poetry2nix is https://github.com/nix-community/poetry2nix/issues/627. but given that the relevant poetry feature is still not yet released (1.2.0a2), i don't see that zulip on nix will happen soon :/07:57:09
@landau:matrix.orgrhtthe other blocker is https://github.com/python-poetry/poetry/issues/5462, but it's not as severe as https://github.com/nix-community/poetry2nix/issues/62707:58:10
6 Jun 2022
@m1cr0man:m1cr0man.comm1cr0manHey folks. I'm struggling to understand why my dev dependencies aren't available in this shell: https://github.com/m1cr0man/python-nixos-nspawn/blob/commands/flake.nix#L54-L56 (for example, flake8 and black). Any suggestions? TIA21:16:53
@m1cr0man:m1cr0man.comm1cr0man Ah... I was missing a .env at the end. I thought that was implied in mkPoetryEnv, whoops 21:45:41
7 Jun 2022
@adis:blad.isadisbladis
In reply to @m1cr0man:m1cr0man.com
Ah... I was missing a .env at the end. I thought that was implied in mkPoetryEnv, whoops
It's a bit unfortunate, it's a detail that's inherited from pythonX.withPackages.
11:12:14
@m1cr0man:m1cr0man.comm1cr0man
In reply to @adis:blad.is
It's a bit unfortunate, it's a detail that's inherited from pythonX.withPackages.

I do prefer the consistency between them. I actually use py.withPackages on the next line :P

Also a nice discovery I made is that I could use the result of mkPoetryEnv as a python venv in VS Code without nix environment selector :) I thought the nix output wouldn't be compatible but it is

11:14:24
@adis:blad.isadisbladis
In reply to @m1cr0man:m1cr0man.com

I do prefer the consistency between them. I actually use py.withPackages on the next line :P

Also a nice discovery I made is that I could use the result of mkPoetryEnv as a python venv in VS Code without nix environment selector :) I thought the nix output wouldn't be compatible but it is

Cool!
11:14:56
8 Jun 2022
@jeff:ocjtech.usJeff
In reply to @m1cr0man:m1cr0man.com

I do prefer the consistency between them. I actually use py.withPackages on the next line :P

Also a nice discovery I made is that I could use the result of mkPoetryEnv as a python venv in VS Code without nix environment selector :) I thought the nix output wouldn't be compatible but it is

Any tips on how to do that? I've been trying to figure out the best way to integrate vscode/poetry/nix
15:18:20
@m1cr0man:m1cr0man.comm1cr0man
In reply to @jeff:ocjtech.us
Any tips on how to do that? I've been trying to figure out the best way to integrate vscode/poetry/nix
Oh sure! Lemme commit this repo so you can see
18:27:04
@m1cr0man:m1cr0man.comm1cr0manhttps://github.com/m1cr0man/python-nixos-nspawn/tree/commands so you can see in my Readme that for a new clone, you just run a nix build + open vscode and it should all just work ™️. However, I just spent the last hour trying to figure out why my "trick" for adding poetry in with mkPoetryEnv wasn't working and I couldn't figure it out :/ for now I just have another devShell option for poetry exclusively, which is annoying19:18:07
@m1cr0man:m1cr0man.comm1cr0man ^ You know what, this totally doesn't work XD I still need to nix develop in my shell so that python libraries are resolvable. Setting PATH ain't enough. Also poetry isn't happy with the .venv and keeps creating a cache copy. 🤷 21:32:46
9 Jun 2022
@gmacon:matrix.orggmaconpoetry2nix on macos will currently use wheels built for 10.12 and 11.0, but not 10.13, 10.14, or 10.15, but I don't see an obvious reason why this gap exists. Is there a reason, or could we fill in the gap? (for reference: https://github.com/nix-community/poetry2nix/blob/73fc21abbed96024f6533da259d5b01b1337ae4d/pep425.nix#L102)00:26:55
@edrex:matrix.orgedrex joined the room.01:51:15
* @edrex:matrix.orgedrex waves01:52:16
@edrex:matrix.orgedrexI'm trying poetry2nix for a wayland client script01:52:43
@edrex:matrix.orgedrexI have need to depend on a package that has some FFI lib deps (pywlroots)01:54:10
@edrex:matrix.orgedrex I understand overrides override the contents of poetry.lock for nix _ commands, but to populate the lock initially, poetry add _ must be used, and this requires the python package's builddeps to be present in the env, as far as I understand it 01:56:38
@edrex:matrix.orgedrex So I'm adding the libs pywlroots needs to build to my devshell's buildInputs, which seems to work 01:57:48
@edrex:matrix.orgedrexSeems awkward though. Is there something I'm missing?01:58:03
@edrex:matrix.orgedrexI'm just wondering if there's a way to populate the lock file without manually adding all the build deps for the package you want to override to the env. Seems like something poetry2nix should handle.02:04:14
@robert:funklause.dedotlambda joined the room.02:07:30
@edrex:matrix.orgedrexOr at least the issue should be documented.02:13:50
@edrex:matrix.orgedrex how can I get a "Runnable" out of poetry2nix? Something I use as the value of my flake's outputs.apps.default so nix run works? 02:42:57
@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

Show newer messages


Back to Room ListRoom Version: 6