| 7 Nov 2023 |
adisbladis | Far from complete but taking a bit of a shape:
https://github.com/adisbladis/pdm2nix
https://adisbladis.github.io/pdm2nix/ | 03:42:45 |
| @softinio:matrix.org changed their profile picture. | 17:56:37 |
| @fractivore:cyberia.club joined the room. | 19:14:30 |
@fractivore:cyberia.club | Hello, so I'm trying to build this project: https://github.com/blacklanternsecurity/bbot using poetry2nix | 19:16:18 |
@fractivore:cyberia.club | I tried using the flake with nix flake init --template github:nix-community/poetry2nix | 19:17:11 |
@fractivore:cyberia.club | Then, nix build | 19:17:19 |
@fractivore:cyberia.club | My memory usage spiked and I had to SIGINT the process. I closed all my open applications and tried running nix build again, and now I'm getting:
error: builder for '/nix/store/pnl61k9cn2g7n3cfwysxcb36bqvq5d8i-python3.11-wordninja-2.0.0.drv' failed with exit code 2;
last 10 log lines:
> File "<frozen importlib._bootstrap>", line 1204, in _gcd_import
> File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
> File "<frozen importlib._bootstrap>", line 1126, in _find_and_load_unlocked
> File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
> 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 'setuptools'
| 19:19:07 |
K900 | That's normal | 19:19:51 |
K900 | Well, not really normal but | 19:19:54 |
K900 | https://github.com/nix-community/poetry2nix/blob/master/docs/edgecases.md | 19:20:02 |
@fractivore:cyberia.club | ohhh alright, excellent | 19:21:49 |
@fractivore:cyberia.club | okay, so I tried modifying the flake.nix that was previously generated, to include:
packages = {
myapp = mkPoetryApplication { projectDir = self;
overrides = poetry2nix.defaultPoetryOverrides.extend
(self: super: {
wordninja = super.wordninja.overridePythonAttrs
(
old: {
buildInputs = (old.buildInputs or [ ]) ++ [ super.setuptools ];
}
);
});
};
default = self.packages.${system}.myapp;
};
| 19:30:20 |
@fractivore:cyberia.club | I got:
error: attribute 'defaultPoetryOverrides' missing | 19:31:16 |
K900 | The flake template is slightly wrong | 19:32:10 |
K900 | I think | 19:32:11 |
K900 | Actually no it's not | 19:32:35 |
K900 | You should update the line | 19:32:38 |
K900 | inherit (poetry2nix.lib.mkPoetry2Nix { inherit pkgs; }) mkPoetryApplication; to inherit (poetry2nix.lib.mkPoetry2Nix { inherit pkgs; }) mkPoetryApplication defaultPoetryOverrides; | 19:32:47 |
K900 | And then use defaultPoetryOverrides instead of poetry2nix.defaultPoetryOverrides | 19:32:57 |
@fractivore:cyberia.club | hmm, okay, I tried that, and now I'm getting:
> ModuleNotFoundError: No module named 'poetry' I know that's the same form as before and it said to work through them one after the other, but is that really right? This is poetry2nix after all | 19:37:20 |
K900 | Yes | 19:37:29 |
K900 | It's one of your dependencies | 19:37:35 |
K900 | Not your primary project | 19:37:39 |
K900 | And we don't inject poetry into things unconditionally | 19:37:48 |
@fractivore:cyberia.club | hmm, okay, I guess that makes sense | 19:38:15 |
@fractivore:cyberia.club | I'm working through them one by one. One other question, what does the "git tree is dirty" warning mean? | 19:46:49 |
ToxicFrog | You have changes that haven't been committed to git, and it's using the changed versions of the files | 20:02:54 |
ToxicFrog | Basically "don't forget to commit your changes once you get this working" | 20:03:07 |
@fractivore:cyberia.club | ahh, ok, thanks | 20:07:06 |
@fractivore:cyberia.club | I worked through several of those overrides, but now I'm getting this error:
error: builder for '/nix/store/pkifnw3bdlg37rv5ss184m2xvdlp6jb8-python3.11-bbot-1.0.3.drv' failed with exit code 1;
last 10 log lines:
> patch.activate()
> File "/nix/store/n9ix258chw1nm40bk8lr2kp4jw8lllhk-python3.11-poetry-dynamic-versioning-0.21.5/lib/python3.11/site-packages/poetry_dynamic_versi
oning/patch.py", line 52, in activate
> _apply_patches()
> File "/nix/store/n9ix258chw1nm40bk8lr2kp4jw8lllhk-python3.11-poetry-dynamic-versioning-0.21.5/lib/python3.11/site-packages/poetry_dynamic_versi
oning/patch.py", line 43, in _apply_patches
> _patch_poetry_create(factory_mod)
> File "/nix/store/n9ix258chw1nm40bk8lr2kp4jw8lllhk-python3.11-poetry-dynamic-versioning-0.21.5/lib/python3.11/site-packages/poetry_dynamic_versi
oning/patch.py", line 14, in _patch_poetry_create
> from poetry.core.semver.version import Version as PoetryVersion
> ModuleNotFoundError: No module named 'poetry.core.semver'
>
> ERROR Backend 'poetry_dynamic_versioning.backend' is not available.
| 20:26:36 |