Poetry2nix | 305 Members | |
| https://github.com/nix-community/poetry2nix | 55 Servers |
| Sender | Message | Time |
|---|---|---|
| 23 Jan 2022 | ||
| 23:44:23 | ||
| Hello all! I am very new to this so apologies in advance if I ask something very dumb. I want to install lmdb bindings for python. However if i create a simple poetry pyproject.toml only with that dependancy the build fails. I understand why. It's because there is a very dumb line in there (https://github.com/jnwatson/py-lmdb/blob/master/setup.py#L117-L119) which tries to access /usr/bin/patch. That obviously does not exist on NixOS. I am trying to make this work but I am kind of struggling. If I was to build the package imperative stylez I would install lmdb and then export LMDB_FORCE_SYSTEM before calling setup.py. I know how do the former (I think) from extraPackages in mkPoetryEnv but I do not know how do the latter. I cannot find an option to add a bash script before the build. Appreciate any help you can give me. Thx | 23:52:27 | |
| 24 Jan 2022 | ||
| never mind I am dumb sorry for the distrurbance all. And thanks to all devs for the cool work!!!! | 00:05:23 | |
In reply to @magisa:matrix.org i'm also beginner so my advice may not lead you to solution. But if i faced this problem, in first place i would look into implementation of this module in As i understand, for poetry2nix you can define override, which will apply changes to default derivation parameters right before building | 07:24:56 | |
| As you can see, environment variables are defined as simple attribute in argument set for buildPythonPackage (which is also used inside poetry2nix) | 07:29:34 | |
| I am trying to install packages with poetry but running into permission errors. ~/Projects/nix-poetry(branch:dev*)(nix-shell)$ poetry add flask Skipping virtualenv creation, as specified in config file. Using version ^2.0.2 for Flask Updating dependencies Resolving dependencies... (0.6s) Writing lock file Package operations: 5 installs, 5 updates, 0 removals • Installing markupsafe (2.0.1): Failed EnvCommandError Command ['/nix/store/5w2swv66p5sl140my96vcipzi2vfrcxq-python3-3.8.12-env/bin/python3.8', '-m', 'pip', 'install', '--no-deps', '/Users/christopher.chalcraft/Library/Caches/pypoetry/artifacts/cd/11/54/fd481eec49cddc06876e526483e7ee8675d0910fed2aa7668a9fc88e62/MarkupSafe-2.0.1-cp38-cp38-macosx_10_9_x86_64.whl'] errored with the following return code 1, and output: Processing /Users/christopher.chalcraft/Library/Caches/pypoetry/artifacts/cd/11/54/fd481eec49cddc06876e526483e7ee8675d0910fed2aa7668a9fc88e62/MarkupSafe-2.0.1-cp38-cp38-macosx_10_9_x86_64.whl Installing collected packages: MarkupSafe ERROR: Could not install packages due to an OSError: [Errno 13] Permission denied: '/nix/store/5w2swv66p5sl140my96vcipzi2vfrcxq-python3-3.8.12-env/lib/python3.8/site-packages/markupsafe' Check the permissions. I have a shell.nix that looks like this: { pkgs ? import <nixpkgs> {} }: with import <nixpkgs> {}; let pythonEnv = python38.withPackages (ps: with ps; [ flake8 black pynvim ipython python-language-server.override { pylint = null; } pip poetry ]); in pkgs.mkShell { buildInputs = with pkgs; [ pythonEnv ]; } | 08:16:27 | |
| That's not a poetry2nix question | 08:16:51 | |
| That's just a general issue with Nix shells and things that try to install things | 08:17:09 | |
| You basically have to pick a side | 08:17:19 | |
| Either you let Poetry manage everything or you let Nix manage everything | 08:17:32 | |
| You can't mix the two | 08:17:36 | |
In reply to @k900:0upti.meokay. Sorry. I was using poetry2nix so I was just in the mindset. | 08:18:35 | |
In reply to @k900:0upti.meI was trying to follow this video of using poetry and nix - https://www.youtube.com/watch?v=TbIHRHy7_JM | 08:19:32 | |
In reply to @cchalc:matrix.orgconsider this line Skipping virtualenv creation, as specified in config file. | 08:22:09 | |
In reply to @cchalc:matrix.orgHe creates a shell.nix to install poetry and use it. But you are right that there is nothing else besides python3 and poetry | 08:22:35 | |
| In video poetry uses virtualenv placed inside home directory, not side packages | 08:22:40 | |
| * In video poetry uses virtualenv placed inside home directory, not site-packages | 08:22:57 | |
try to exec poetry config --listand look for virtualenvs.create. If it false, consider documentation https://python-poetry.org/docs/configuration/ | 08:24:36 | |
| If you manage to allow poetry create venv, then all should be according to video | 08:25:23 | |
In reply to @mou_bugtracker:matrix.orgokay thank you. I will give it a shot. | 08:26:00 | |
| * If you manage to allow poetry create venv, then all should go according to video | 08:28:19 | |
Can we use pyproject.toml build tool metadata to detect which one is used for dependency (if such dependency fetched in form of source), and include this tools in build dependencies? | 17:11:13 | |
In reply to @mou_bugtracker:matrix.orgThat's already being done, but only for local path dependencies | 17:12:12 | |
| Since doing that for remote dependencies would be IFD | 17:12:27 | |
| IFD? sorry, i'm not aware of acronym or idiom | 17:13:57 | |
| Import From Derivation | 17:15:08 | |
| https://nixos.wiki/wiki/Import_From_Derivation | 17:15:10 | |
| It's problematic because you're interleaving evaluation and building | 17:15:55 | |
| You're essentially evaluating a bit, pausing the whole evaluation for building something, and then using the build result for evaluation | 17:16:32 | |
| 25 Jan 2022 | ||
| adisbladis: as promised i made a small document on my solution for building with missed poetry build tool. I'm not insisting on this is appropriate structure or content to include in repository, but it's contains information i really like to get when encountered such problem. Feel free to use it (or not use at all) whatever way you like. Suggestions from everyone else also welcome. Text may contains many grammatical mistakes, so i'm really appreciate if anyone point them out. https://gist.github.com/mou/a4f137718861082bf7da08f1176d141b | 17:22:10 | |