!rWxyQqNqMUDLECdsIf:blad.is

Poetry2nix

317 Members
https://github.com/nix-community/poetry2nix61 Servers

Load older messages


SenderMessageTime
16 Nov 2023
@k900:0upti.meK900
In reply to @dustee:matrix.org
but 'poetry run python manage.py runserver 0.0.0.0:5600' errors with 'ImportError: libstdc++.so.6: cannot open shared object file: No such file or directory
'
You don't need poetry run
10:05:49
@k900:0upti.meK900 You should just run python directly from the shell 10:05:57
@dustee:matrix.orgdusteeok that works, django is running10:10:51
@dustee:matrix.orgdusteethanks so much for your help10:10:57
@qyliss:fairydust.space@qyliss:fairydust.space left the room.10:11:10
17 Nov 2023
@adis:blad.isadisbladisThe behaviour of editable together with flakes is kinda terrible..00:46:33
@adis:blad.isadisbladis

This doesn't work:

poetry2nix.mkPoetryEnv {
    projectDir = ./.;
    editablePackageSources = {
        my-app = ./src;
    };
}

because my-app resolves to a store path

00:46:52
@adis:blad.isadisbladis So it has to be used with --impure 00:47:20
@petrichor:envs.net@petrichor:envs.net I don't know, it kind of makes sense to me that this use-case requires --impure: there's no reproducibility if you can edit one of the dependencies at any time and have those edits reflected immediately in the environment 10:52:19
@petrichor:envs.net@petrichor:envs.net It would be nice to be able to flip the default though, and declare directly in a flake.nix that some actions should be considered impure by default (with a warning message printed 10:53:03
@petrichor:envs.net@petrichor:envs.net * It would be nice to be able to flip the default though, and declare directly in a flake.nix that some actions should be considered impure by default (with a warning message printed) 10:53:05
@adis:blad.isadisbladisI was considering making it relative to an environment variable 11:23:42
@adis:blad.isadisbladisSo you can use something like https://github.com/srid/flake-root11:24:24
18 Nov 2023
@pcloud:matrix.orgcpcloud Seems like the nixpkgs catch_conflicts.py script is now broken for Python 3.9 11:24:21
@pcloud:matrix.orgcpcloudAh, fixed in https://github.com/NixOS/nixpkgs/pull/26766911:38:06
19 Nov 2023
@pederbs:pvv.ntnu.nopbsds changed their display name from pbsds to pbsds (federation borken, may not see reply).03:35:23
@adis:blad.isadisbladis
In reply to @adis:blad.is
The behaviour of editable together with flakes is kinda terrible..
I think the really hard part about editable installs with flakes is that it doesn't fail in a predictable way.
Maybe I should check for if a path is a nix store path when doing editable and fail on that, since it's clearly not the desired behaviour.
06:28:11
@zxgu:matrix.orgZXGU joined the room.11:01:29
@pederbs:pvv.ntnu.nopbsds changed their display name from pbsds (federation borken, may not see reply) to pbsds.20:38:41
@kranzes:matrix.org@kranzes:matrix.orgHow can I get dbus-python to build?21:59:31
@kranzes:matrix.org@kranzes:matrix.org
error: builder for '/nix/store/54prvc1413an75zb70asbd19kq8zh5va-python3.11-dbus-python-1.3.2.drv' failed with exit code 2;
       last 10 log lines:
       >           ^^^^^^^^^^^^^^^^^^^^^^^
       >   File "/nix/store/ffll6glz3gwx342z0ch8wx30p5cnqz1z-python3-3.11.5/lib/python3.11/importlib/__init__.py", line 126, in import_module
       >     return _bootstrap._gcd_import(name[level:], package, level)
       >            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
       >   File "<frozen importlib._bootstrap>", line 1204, in _gcd_import
       >   File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
       >   File "<frozen importlib._bootstrap>", line 1140, in _find_and_load_unlocked
       > ModuleNotFoundError: No module named 'mesonpy'
       >
       >
       For full logs, run 'nix log /nix/store/54prvc1413an75zb70asbd19kq8zh5va-python3.11-dbus-python-1.3.2.drv'
21:59:47
20 Nov 2023
@petrichor:envs.net@petrichor:envs.netlooks like maybe a missing build-time dependency? https://github.com/nix-community/poetry2nix/blob/master/docs/edgecases.md#modulenotfounderror-no-module-named-packagename07:20:57
@gaivs:matrix.orggaivsHello! I'm having some odd problems with the cattrs package. To reproduce, I use `nix flake init --template github:nix-community/poetry2nix`, then `poetry add cattrs`. When I build, I get the `No module named 'hatchling'` error, so I add an override for cattrs with the hatchling package. When I try to build after this, I get this error: ``` hatchling.plugin.exceptions.UnknownPluginError: Unknown version source: vcs error: subprocess-exited-with-error ``` Have anyone had this, or a similar, issue before?17:44:00
@k900:0upti.meK900 You need to also add hatch-vcs 17:46:44
@k900:0upti.meK900Probably17:46:45
@delroth:delroth.net@delroth:delroth.net
In reply to @gaivs:matrix.org
Hello! I'm having some odd problems with the cattrs package.

To reproduce, I use `nix flake init --template github:nix-community/poetry2nix`, then `poetry add cattrs`. When I build, I get the `No module named 'hatchling'` error, so I add an override for cattrs with the hatchling package.

When I try to build after this, I get this error:

```
hatchling.plugin.exceptions.UnknownPluginError: Unknown version source: vcs
error: subprocess-exited-with-error
```

Have anyone had this, or a similar, issue before?
add hatch-vcs to the override as well
17:46:49
@gaivs:matrix.orggaivsPerfect, thank you! 17:48:11
@julius:mtx.liftm.deˈt͡sɛːzaɐ̯ joined the room.22:40:45
@julius:mtx.liftm.deˈt͡sɛːzaɐ̯

It seems to me that poetry2nix doesn't properly support scripts at the top level? I'm wondering if that's known/reported/irrelevant/a bad idea/…

Say I've got a project set up like this:

nix flake init --template github:nix-community/poetry2nix
echo 'def main(): print("foo")' >foo.py
echo -e '\n[tool.poetry.scripts]\nbar = "foo:main"' >>pyproject.toml
poetry install

Then I can execute

poetry run bar

and it'll print foo.
But If I execute

nix shell -c bar

That fails with ModuleNotFoundError: No module named 'foo'.
Looking around, foo.py isn't included in result for nix build ., but it does appear in a -source folder in the store. Can I somehow execute top level scripts?

23:23:11
21 Nov 2023
@julius:mtx.liftm.deˈt͡sɛːzaɐ̯Looked around a bit in the source to find out what controls which .py files are included. Found mkPoetryScriptsPackage. Works as expected. :)06:55:03

Show newer messages


Back to Room ListRoom Version: 6