!rWxyQqNqMUDLECdsIf:blad.is

Poetry2nix

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

Load older messages


SenderMessageTime
19 Nov 2023
@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
@julius:mtx.liftm.deˈt͡sɛːzaɐ̯ Or maybe it doesn't. Tried to apply mkPoetryScriptsPackage to a real thing, which needs overrides, which isn't supported. I also can't seem to mix scripts inside and outside of the package folder. :/ 23:51:53
22 Nov 2023
@kranzes:matrix.org@kranzes:matrix.org is it just me or does mkPoetryScriptsPackage not add the dependencies to the PYTHONPATH or whatever it's called 00:53:04
@kranzes:matrix.org@kranzes:matrix.orgmkPoetryApplication works but the binary in mkPoetryScriptsPackage with "No module named 'requests'"00:53:34
@ppenguin:matrix.orgppenguin I'm in the midst of fixing the "fallout" from removal of poetry2nix from nixpkgs for my xls2latex package, but I'm getting a bit confused (partly because of multi-layered flakes/shells). So now I have this flake, aiming to achieve the "sweet spot" of being compatible with non-flake usage (fetchFromGithub) and having the necessary flake outputs to do seamless development on it (repo devShell) and inclusion in user deployments, preferrably via overlay so the user can call it as a normal pkgs.xls2latex.

Now I'm looking for advice:
  1. whether the current flake structure is "best practice" for this case (notably defining the repo's package attr xls2latex via callPackage in let .. in and directly refering to it for the different flake outputs),

  2. secondly I get a strange errorr message in a consuming flake (see next)

14:32:25
@ppenguin:matrix.orgppenguin In a consumer of the mentioned flake:
`nix
{
description = "Complete self-contained pandoc(omatic) flake with templates etc.";

inputs = {
flake-utils.url = "github:numtide/flake-utils";
xls2latex = {
url = "github:ppenguin/xls2latex/fix-external-poetry2nix";
inputs.nixpkgs.follows = "nixpkgs";
};
};

outputs = inputs@{ self, nixpkgs, flake-utils, xls2latex }:

flake-utils.lib.eachDefaultSystem (system:
let
# pkgs = nixpkgs.legacyPackages.${system};
pkgs = import nixpkgs { overlays = [ (import xls2latex {}).overlays.xls2latex ]; inherit system; };
in
{
devShells.default = import ./nix/pandoc-shell.nix { inherit pkgs; };
}
);
}
but I get an error:
error: function 'anonymous lambda' called without required argument 'lib'

at /nix/store/5iviv2i2c2fkb5frjc1apkrymvzhpldc-source/default.nix:1:1:
`
14:36:49
@ppenguin:matrix.orgppenguin In a consumer of the mentioned flake:
`nix
{
description = "Complete self-contained pandoc(omatic) flake with templates etc.";

inputs = {
flake-utils.url = "github:numtide/flake-utils";
xls2latex = {
url = "github:ppenguin/xls2latex/fix-external-poetry2nix";
inputs.nixpkgs.follows = "nixpkgs";
};
};

outputs = inputs@{ self, nixpkgs, flake-utils, xls2latex }:

flake-utils.lib.eachDefaultSystem (system:
let
# pkgs = nixpkgs.legacyPackages.${system};
pkgs = import nixpkgs { overlays = [ (import xls2latex {}).overlays.xls2latex ]; inherit system; };
in
{
devShells.default = import ./nix/pandoc-shell.nix { inherit pkgs; };
}
);
}
but I get an error:
```
       error: function 'anonymous lambda' called without required argument 'lib'
       at /nix/store/5iviv2i2c2fkb5frjc1apkrymvzhpldc-source/default.nix:1:1:
14:37:01
@ppenguin:matrix.orgppenguin In a consumer of the mentioned flake:
`nix
{
description = "Complete self-contained pandoc(omatic) flake with templates etc.";

inputs = {
flake-utils.url = "github:numtide/flake-utils";
xls2latex = {
url = "github:ppenguin/xls2latex/fix-external-poetry2nix";
inputs.nixpkgs.follows = "nixpkgs";
};
};

outputs = inputs@{ self, nixpkgs, flake-utils, xls2latex }:

flake-utils.lib.eachDefaultSystem (system:
let
# pkgs = nixpkgs.legacyPackages.${system};
pkgs = import nixpkgs { overlays = [ (import xls2latex {}).overlays.xls2latex ]; inherit system; };
in
{
devShells.default = import ./nix/pandoc-shell.nix { inherit pkgs; };
}
);
}
`
but I get an error:

       error: function 'anonymous lambda' called without required argument 'lib'
       at /nix/store/5iviv2i2c2fkb5frjc1apkrymvzhpldc-source/default.nix:1:1:
14:37:22
@ppenguin:matrix.orgppenguin In a consumer of the mentioned flake:
`nix
{
description = "Complete self-contained pandoc(omatic) flake with templates etc.";

inputs = {
flake-utils.url = "github:numtide/flake-utils";
xls2latex = {
url = "github:ppenguin/xls2latex/fix-external-poetry2nix";
inputs.nixpkgs.follows = "nixpkgs";
};
};

outputs = inputs@{ self, nixpkgs, flake-utils, xls2latex }:

flake-utils.lib.eachDefaultSystem (system:
let
# pkgs = nixpkgs.legacyPackages.${system};
pkgs = import nixpkgs { overlays = [ (import xls2latex {}).overlays.xls2latex ]; inherit system; };
in
{
devShells.default = import ./nix/pandoc-shell.nix { inherit pkgs; };
}
);
}
`

but I get an error:

error: function 'anonymous lambda' called without required argument 'lib'
       at /nix/store/5iviv2i2c2fkb5frjc1apkrymvzhpldc-source/default.nix:1:1:
14:37:32
@ppenguin:matrix.orgppenguin In a consumer of the mentioned flake:

`nix
{
description = "Complete self-contained pandoc(omatic) flake with templates etc.";

inputs = {
flake-utils.url = "github:numtide/flake-utils";
xls2latex = {
url = "github:ppenguin/xls2latex/fix-external-poetry2nix";
inputs.nixpkgs.follows = "nixpkgs";
};
};

outputs = inputs@{ self, nixpkgs, flake-utils, xls2latex }:

flake-utils.lib.eachDefaultSystem (system:
let
# pkgs = nixpkgs.legacyPackages.${system};
pkgs = import nixpkgs { overlays = [ (import xls2latex {}).overlays.xls2latex ]; inherit system; };
in
{
devShells.default = import ./nix/pandoc-shell.nix { inherit pkgs; };
}
);
}
`

but I get an error:

error: function 'anonymous lambda' called without required argument 'lib'
       at /nix/store/5iviv2i2c2fkb5frjc1apkrymvzhpldc-source/default.nix:1:1:
14:37:57
@ppenguin:matrix.orgppenguin In a consumer of the mentioned flake:

`nix
{
description = "Complete self-contained pandoc(omatic) flake with templates etc.";

inputs = {
flake-utils.url = "github:numtide/flake-utils";
xls2latex = {
url = "github:ppenguin/xls2latex/fix-external-poetry2nix";
inputs.nixpkgs.follows = "nixpkgs";
};
};

outputs = inputs@{ self, nixpkgs, flake-utils, xls2latex }:

flake-utils.lib.eachDefaultSystem (system:
let
# pkgs = nixpkgs.legacyPackages.${system};
pkgs = import nixpkgs { overlays = [ (import xls2latex {}).overlays.xls2latex ]; inherit system; };
in
{
devShells.default = import ./nix/pandoc-shell.nix { inherit pkgs; };
}
);
}
`
14:38:30
@ppenguin:matrix.orgppenguin In a consumer of the mentioned flake:

`
{
description = "Complete self-contained pandoc(omatic) flake with templates etc.";

inputs = {
flake-utils.url = "github:numtide/flake-utils";
xls2latex = {
url = "github:ppenguin/xls2latex/fix-external-poetry2nix";
inputs.nixpkgs.follows = "nixpkgs";
};
};

outputs = inputs@{ self, nixpkgs, flake-utils, xls2latex }:

flake-utils.lib.eachDefaultSystem (system:
let
# pkgs = nixpkgs.legacyPackages.${system};
pkgs = import nixpkgs { overlays = [ (import xls2latex {}).overlays.xls2latex ]; inherit system; };
in
{
devShells.default = import ./nix/pandoc-shell.nix { inherit pkgs; };
}
);
}
`
14:38:41
@ppenguin:matrix.orgppenguin In a consumer of the mentioned flake:

`
{
description = "Complete self-contained pandoc(omatic) flake with templates etc.";

inputs = {
flake-utils.url = "github:numtide/flake-utils";
xls2latex = {
url = "github:ppenguin/xls2latex/fix-external-poetry2nix";
inputs.nixpkgs.follows = "nixpkgs";
};
};

outputs = inputs@{ self, nixpkgs, flake-utils, xls2latex }:

flake-utils.lib.eachDefaultSystem (system:
let
# pkgs = nixpkgs.legacyPackages.${system};
pkgs = import nixpkgs { overlays = [ (import xls2latex {}).overlays.xls2latex ]; inherit system; };
in
{
devShells.default = import ./nix/pandoc-shell.nix { inherit pkgs; };
}
);
}

`
14:39:04
@ppenguin:matrix.orgppenguin In a consumer of the mentioned flake:

flake
14:39:36
@ppenguin:matrix.orgppenguin In a consumer of the mentioned flake:

`nix
{
description = "Complete self-contained pandoc(omatic) flake with templates etc.";

inputs = {
flake-utils.url = "github:numtide/flake-utils";
xls2latex = {
url = "github:ppenguin/xls2latex/fix-external-poetry2nix";
inputs.nixpkgs.follows = "nixpkgs";
};
};

outputs = inputs@{ self, nixpkgs, flake-utils, xls2latex }:

flake-utils.lib.eachDefaultSystem (system:
let
# pkgs = nixpkgs.legacyPackages.${system};
pkgs = import nixpkgs { overlays = [ (import xls2latex {}).overlays.xls2latex ]; inherit system; };
in
{
devShells.default = import ./nix/pandoc-shell.nix { inherit pkgs; };
}
);
}

`
14:40:24
@ppenguin:matrix.orgppenguin In a consumer of the mentioned flake:

`nix
{
description = "Complete self-contained pandoc(omatic) flake with templates etc.";
...
outputs = inputs@{ self, nixpkgs, flake-utils, xls2latex }:

flake-utils.lib.eachDefaultSystem (system:
let
# pkgs = nixpkgs.legacyPackages.${system};
pkgs = import nixpkgs { overlays = [ (import xls2latex {}).overlays.xls2latex ]; inherit system; };
in
{
devShells.default = import ./nix/pandoc-shell.nix { inherit pkgs; };
}
);
}

`
14:41:02
@ppenguin:matrix.orgppenguin In a consumer of the mentioned flake:

`nix

{
description = "Complete self-contained pandoc(omatic) flake with templates etc.";
...
outputs = inputs@{ self, nixpkgs, flake-utils, xls2latex }:

flake-utils.lib.eachDefaultSystem (system:
let
# pkgs = nixpkgs.legacyPackages.${system};
pkgs = import nixpkgs { overlays = [ (import xls2latex {}).overlays.xls2latex ]; inherit system; };
in
{
devShells.default = import ./nix/pandoc-shell.nix { inherit pkgs; };
}
);
}

`
14:41:17
@ppenguin:matrix.orgppenguin In a consumer of the mentioned flake:

`nix

{
description = "Complete self-contained pandoc(omatic) flake with templates etc.";
...
outputs = inputs@{ self, nixpkgs, flake-utils, xls2latex }:

flake-utils.lib.eachDefaultSystem (system:
let
# pkgs = nixpkgs.legacyPackages.${system};
pkgs = import nixpkgs { overlays = [ (import xls2latex {}).overlays.xls2latex ]; inherit system; };
in
{
devShells.default = import ./nix/pandoc-shell.nix { inherit pkgs; };
}
);
}
`
14:41:30
@ppenguin:matrix.orgppenguin In a consumer of the mentioned flake:

{
  description = "Complete self-contained pandoc(omatic) flake with templates etc.";
   ...
  outputs = inputs@{ self, nixpkgs, flake-utils, xls2latex }:
    flake-utils.lib.eachDefaultSystem (system:
      let
        pkgs = import nixpkgs { overlays = [ (import xls2latex {}).overlays.xls2latex ]; inherit system; };
      in
        {
          devShells.default = import ./nix/pandoc-shell.nix { inherit pkgs; };
        }
    );
}
14:41:50

Show newer messages


Back to Room ListRoom Version: 6