!rWxyQqNqMUDLECdsIf:blad.is

Poetry2nix

339 Members
https://github.com/nix-community/poetry2nix67 Servers

Load older messages


SenderMessageTime
19 Jul 2024
@truh:matrix.orgtruh Can you start your app with poetry run something? Because that makes working with poetry2nix a fair bit easier. 13:07:24
@truh:matrix.orgtruhah nevermind, that's not the problem here13:07:57
@oven_spinout988:matrix.orgoven_spinout988 truh: The environment with nix develop works as expected.
It is when I do a nix build and want to use the application as "standalone" app
13:10:36
@truh:matrix.orgtruh maybe you need to add [tool.poetry.packages] to your pyproject.toml 13:10:37
@oven_spinout988:matrix.orgoven_spinout988
In reply to @truh:matrix.org
maybe you need to add [tool.poetry.packages] to your pyproject.toml
I will give it a try
13:11:10
@oven_spinout988:matrix.orgoven_spinout988
In reply to @oven_spinout988:matrix.org
I will give it a try

I am not sure if it is a lead or not.
Changing a part of my pyproject.toml made some changes and it is not yelling anymore about the bin module. It is yelling about an other :

[tool.poetry]
name = "test"
version = "0.0.0"
description = "Test."
authors = ["x"]
license = "BSD-3-Clause"
repository = "https://github.com/"
homepage = "https://example.com"
documentation = "https://example.com/docs/main/"

readme = "README.md"

classifiers = [
  'License :: OSI Approved :: BSD License',
  'Operating System :: POSIX :: Linux',
]

packages = [
  { include = "test" },
  { include = "bin" },
  { include = "test" },
  { include = "default", from = "test" },
]
 [..]

Produces :

Traceback (most recent call last):
  File "/nix/store/8835sd6kck0f1ljzvlpp2igzb87v9dnr-python3.12-test-0.0.0/bin/.start-wrapped", line 6, in <module>
    from bin.start import main
  File "/nix/store/8835sd6kck0f1ljzvlpp2igzb87v9dnr-python3.12-test-0.0.0/lib/python3.12/site-packages/bin/start.py", line 5, in <module>
    from test.default import get_homedir
ModuleNotFoundError: No module named 'test.default'

The application is working fine with debian. From the documentation of poetry, it looks like specifying packages disable the auto-detection feature.

13:39:27
@oven_spinout988:matrix.orgoven_spinout988
In reply to @oven_spinout988:matrix.org
I will give it a try
*

I am not sure if it is a lead or not.
Changing a part of my pyproject.toml made some changes and it is not yelling anymore about the bin module. It is yelling about an other :

[tool.poetry]
name = "test"
version = "0.0.0"
description = "Test."
authors = ["x"]
license = "BSD-3-Clause"
repository = "https://github.com/"
homepage = "https://example.com"
documentation = "https://example.com/docs/main/"

readme = "README.md"

classifiers = [
  'License :: OSI Approved :: BSD License',
  'Operating System :: POSIX :: Linux',
]

packages = [
  { include = "test" },
  { include = "bin" },
  { include = "default", from = "test" },
]
 [..]

Produces :

Traceback (most recent call last):
  File "/nix/store/8835sd6kck0f1ljzvlpp2igzb87v9dnr-python3.12-test-0.0.0/bin/.start-wrapped", line 6, in <module>
    from bin.start import main
  File "/nix/store/8835sd6kck0f1ljzvlpp2igzb87v9dnr-python3.12-test-0.0.0/lib/python3.12/site-packages/bin/start.py", line 5, in <module>
    from test.default import get_homedir
ModuleNotFoundError: No module named 'test.default'

The application is working fine with debian. From the documentation of poetry, it looks like specifying packages disable the auto-detection feature.

13:39:46
@truh:matrix.orgtruh { include = "default", from = "test" }, is pretty likely wrong. Tests I usually also don't specify as package 13:41:41
@truh:matrix.orgtruhoh, test is not a folder with unit tests but application code?13:43:07
@oven_spinout988:matrix.orgoven_spinout988
In reply to @truh:matrix.org
oh, test is not a folder with unit tests but application code?
Yes. I think name is not well chosen ˆˆ
13:44:32
@truh:matrix.orgtruh I'd still remove { include = "default", from = "test" }, 13:45:28
@truh:matrix.orgtruh For ModuleNotFoundError: No module named 'test.default', { include = "test" }, you be good enough 13:46:01
@tyberius_prime:matrix.orgTyberiusPrime (smilodon inopinatus)
      raise FileNotFoundError(msg)
  FileNotFoundError: Forced include not found: /build/cirrocumulus-1.1.57/build
  error: subprocess-exited-with-error```

why do you try me so?
13:47:12
@truh:matrix.orgtruh * For ModuleNotFoundError: No module named 'test.default', { include = "test" }, should be good enough 13:47:22
@tyberius_prime:matrix.orgTyberiusPrime (smilodon inopinatus)I have literally fixed 7548 python package builds this week.13:47:25
@tyberius_prime:matrix.orgTyberiusPrime (smilodon inopinatus) *
      raise FileNotFoundError(msg)
  FileNotFoundError: Forced include not found: /build/cirrocumulus-1.1.57/build
  error: subprocess-exited-with-error
```
why do you try me so?
13:47:33
@tyberius_prime:matrix.orgTyberiusPrime (smilodon inopinatus) *
      raise FileNotFoundError(msg)
  FileNotFoundError: Forced include not found: /build/cirrocumulus-1.1.57/build
  error: subprocess-exited-with-error
```
why do you try me so?
13:47:36
@tyberius_prime:matrix.orgTyberiusPrime (smilodon inopinatus) *
      raise FileNotFoundError(msg)
  FileNotFoundError: Forced include not found: /build/cirrocumulus-1.1.57/build
  error: subprocess-exited-with-error

why do you try me so?

13:47:42
@tyberius_prime:matrix.orgTyberiusPrime (smilodon inopinatus)but that one has me utterly stumped.13:47:48
@truh:matrix.orgtruhI wish there weren't so many python packages13:47:50
@oven_spinout988:matrix.orgoven_spinout988
In reply to @truh:matrix.org
For ModuleNotFoundError: No module named 'test.default', { include = "test" }, should be good enough
            Traceback (most recent call last):
              File "/nix/store/mbkyadwnalw99bbvcdfgw4gsjhpzxcgx-python3.12-test-0.0.0/bin/.start-wrapped", line 6, in <module>
                from bin.start import main
              File "/nix/store/mbkyadwnalw99bbvcdfgw4gsjhpzxcgx-python3.12-test-0.0.0/lib/python3.12/site-packages/bin/start.py", line 5, in <module>
                from test.default import get_homedir
            ModuleNotFoundError: No module named 'test.default'

Still the same error with : packages = [{ include = "test" }, { include = "bin" }]

13:48:27
@tyberius_prime:matrix.orgTyberiusPrime (smilodon inopinatus)
In reply to @tyberius_prime:matrix.org
but that one has me utterly stumped.
but I could do a wheel, so shrugh
13:52:20
@truh:matrix.orgtruh

what's that for

            ] ++ pkgs.lib.mapAttrsToList
              (name: value:
                pkgs.writers.writePython3Bin "${name}" { flakeIgnore = [ "E401" "E501" ]; } ''
                  import sys, importlib
                  mod, attr = "${value}".split(":", 1)
                  sys.exit(getattr(importlib.import_module(mod), attr)())
                ''
              )
              (builtins.fromTOML (builtins.readFile ./pyproject.toml)).tool.poetry.scripts;

mkPoetryApplication should create bins for the scripts

13:52:56
@oven_spinout988:matrix.orgoven_spinout988
In reply to @truh:matrix.org

what's that for

            ] ++ pkgs.lib.mapAttrsToList
              (name: value:
                pkgs.writers.writePython3Bin "${name}" { flakeIgnore = [ "E401" "E501" ]; } ''
                  import sys, importlib
                  mod, attr = "${value}".split(":", 1)
                  sys.exit(getattr(importlib.import_module(mod), attr)())
                ''
              )
              (builtins.fromTOML (builtins.readFile ./pyproject.toml)).tool.poetry.scripts;

mkPoetryApplication should create bins for the scripts

Found it in a Github issue. And it was efficient at the time I tested it to remove the bin error.
For what I can remember.

Without this part, I get the following error :

Traceback (most recent call last):
              File "/nix/store/mpn2dgz63imrk5j91ifk3y2nsq5mk9a2-python3.12-test-0.0.0/bin/.start-wrapped", line 6, in <module>
                from bin.start import main
            ModuleNotFoundError: No module named 'bin'
13:56:20
@oven_spinout988:matrix.orgoven_spinout988
In reply to @truh:matrix.org

what's that for

            ] ++ pkgs.lib.mapAttrsToList
              (name: value:
                pkgs.writers.writePython3Bin "${name}" { flakeIgnore = [ "E401" "E501" ]; } ''
                  import sys, importlib
                  mod, attr = "${value}".split(":", 1)
                  sys.exit(getattr(importlib.import_module(mod), attr)())
                ''
              )
              (builtins.fromTOML (builtins.readFile ./pyproject.toml)).tool.poetry.scripts;

mkPoetryApplication should create bins for the scripts

* Found it in a Github issue. And it was efficient at the time I tested it to remove the bin error.
For what I can remember.
13:58:40
@oven_spinout988:matrix.orgoven_spinout988 *

Found it in a Github issue. And it was efficient at the time I tested it to remove the bin error.
For what I can remember.

I removed it and sill get the error about test.default missing.

13:59:39
@oven_spinout988:matrix.orgoven_spinout988 *

Found it in a Github issue. And it was efficient at the time I tested it to remove the bin error.
For what I can remember.

EDIT truh :
I removed it and sill get the error about test.default missing.

13:59:55
@truh:matrix.orgtruhI think you can remove the other buildinputs in mkPoetryApplication too14:01:32
@truh:matrix.orgtruhmaybe pkgs.python3 screws the pythonpath or something14:01:48
@oven_spinout988:matrix.orgoven_spinout988

I just set it at the minimum level :

          testApp = mkPoetryApplication {
            projectDir = ./.;
            overrides = p2n-overrides;

            dependencies = [
              pkgs.redis
              pkgs.ffmpeg
            ];

          };

With the package inside the pyproject.toml, I have this error :

            Traceback (most recent call last):
              File "/nix/store/lbidxwnsm93j6v79hyrl0yvjylbdjd2w-python3.12-test-0.0.0/bin/.start-wrapped", line 6, in <module>
                from bin.start import main
              File "/nix/store/lbidxwnsm93j6v79hyrl0yvjylbdjd2w-python3.12-test-0.0.0/lib/python3.12/site-packages/bin/start.py", line 5, in <module>
                from test.default import get_homedir
            ModuleNotFoundError: No module named 'test.default'

And without :

            Traceback (most recent call last):
              File "/nix/store/ghhaa833nn30ck2y7w8nlq3nx5izvypj-python3.12-test-0.0.0/bin/.start-wrapped", line 6, in <module>
                from bin.start import main
            ModuleNotFoundError: No module named 'bin'
14:08:57

Show newer messages


Back to Room ListRoom Version: 6