!rWxyQqNqMUDLECdsIf:blad.is

Poetry2nix

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

Load older messages


SenderMessageTime
24 Jan 2022
@cchalc:matrix.orgcchalc
In reply to @k900:0upti.me
That's just a general issue with Nix shells and things that try to install things
okay. Sorry. I was using poetry2nix so I was just in the mindset.
08:18:35
@cchalc:matrix.orgcchalc
In reply to @k900:0upti.me
Either you let Poetry manage everything or you let Nix manage everything
I was trying to follow this video of using poetry and nix - https://www.youtube.com/watch?v=TbIHRHy7_JM
08:19:32
@mou_bugtracker:matrix.orgmou
In reply to @cchalc:matrix.org
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
];
}
consider this line
Skipping virtualenv creation, as specified in config file.
08:22:09
@cchalc:matrix.orgcchalc
In reply to @cchalc:matrix.org
I was trying to follow this video of using poetry and nix - https://www.youtube.com/watch?v=TbIHRHy7_JM
He 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
@mou_bugtracker:matrix.orgmouIn video poetry uses virtualenv placed inside home directory, not side packages08:22:40
@mou_bugtracker:matrix.orgmou * In video poetry uses virtualenv placed inside home directory, not site-packages08:22:57
@mou_bugtracker:matrix.orgmou try to exec poetry config --listand look for virtualenvs.create. If it false, consider documentation https://python-poetry.org/docs/configuration/ 08:24:36
@mou_bugtracker:matrix.orgmouIf you manage to allow poetry create venv, then all should be according to video08:25:23
@cchalc:matrix.orgcchalc
In reply to @mou_bugtracker:matrix.org
If you manage to allow poetry create venv, then all should be according to video
okay thank you. I will give it a shot.
08:26:00
@mou_bugtracker:matrix.orgmou * If you manage to allow poetry create venv, then all should go according to video08:28:19
@mou_bugtracker:matrix.orgmou 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
@adis:blad.isadisbladis
In reply to @mou_bugtracker:matrix.org
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?
That's already being done, but only for local path dependencies
17:12:12
@adis:blad.isadisbladisSince doing that for remote dependencies would be IFD17:12:27
@mou_bugtracker:matrix.orgmouIFD? sorry, i'm not aware of acronym or idiom17:13:57
@adis:blad.isadisbladisImport From Derivation17:15:08
@adis:blad.isadisbladishttps://nixos.wiki/wiki/Import_From_Derivation17:15:10
@adis:blad.isadisbladisIt's problematic because you're interleaving evaluation and building17:15:55
@adis:blad.isadisbladisYou're essentially evaluating a bit, pausing the whole evaluation for building something, and then using the build result for evaluation17:16:32
25 Jan 2022
@mou_bugtracker:matrix.orgmou

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
@mou_bugtracker:matrix.orgmouAlso i can fix whatever way you suggest and prepare PR if needed17:23:10
@adis:blad.isadisbladis
In reply to @mou_bugtracker:matrix.org
Also i can fix whatever way you suggest and prepare PR if needed
I don't really have much feedback except that it looks great!
Please PR this 👍️
22:59:36
26 Jan 2022
@mou_bugtracker:matrix.orgmou
In reply to @adis:blad.is
I don't really have much feedback except that it looks great!
Please PR this 👍️
How to name file and where to put it? In root? I have doubts about in-lining it in README
06:12:03
@adis:blad.isadisbladis
In reply to @mou_bugtracker:matrix.org
How to name file and where to put it? In root? I have doubts about in-lining it in README
Could you create a docs directory? I'll try to set up github actions to publish it.
06:16:14
@akiiino:matrix.orgakiiino joined the room.15:31:14
@akiiino:matrix.orgakiiino

Hey folks! I'm at my wits end here, trying to use Nix to manage my python project in any capacity. I have two questions: a specific one and a general one:

  • specific: I have set up a basic mkPoetryEnv in shell.nix, but when I try to actually start the shell, all I get is error: Missing suitable source/wheel file entry for tensorflow. Couldn't figure out what could cause this, so I'm stuck.
  • general: Is poetry2nix even the right tool for what I want to do? So my setup right now (without nix) is: I have a couple of repos I work in and edit; so I have a pyproject.toml that lists them as dependencies by local paths, plus some more dependencies just from pip. Some of these dependencies come from a private pypi server, which is also listed in pyproject.toml. Can poetry2nix handle this relatively simple usecase?
    -- complication 1: can I add some packages without including them in the pyproject.toml? e.g. I don't really want Jupyter to affect the dependency resolution process.
    -- complication 2: what if I also want to add some non-python packages to the environment (say, tmux)?

Sorry for the wall of text, just really frustrated so far with how little of Nix is documented properly and how untransparent the whole ecosystem in general is 🙃

15:40:03
@akiiino:matrix.orgakiiino *

Hey folks! I'm at my wits' end here, trying to use Nix to manage my python project in any capacity. I have two questions: a specific one and a general one:

  • specific: I have set up a basic mkPoetryEnv in shell.nix, but when I try to actually start the shell, all I get iserror: Missing suitable source/wheel file entry for tensorflow. Couldn't figure out what could cause this, so I'm stuck.
  • general: Is poetry2nix even the right tool for what I want to do? So my setup right now (without nix) is: I have a couple of repos I work in and edit; so I have a pyproject.toml that lists them as dependencies by local paths, plus some more dependencies just from pip. Some of these dependencies come from a private pypi server, which is also listed in pyproject.toml. Can poetry2nix handle this relatively simple usecase?
    -- complication 1: can I add some packages without including them in the pyproject.toml? e.g. I don't really want Jupyter to affect the dependency resolution process.
    -- complication 2: what if I also want to add some non-python packages to the environment (say, tmux)?

Sorry for the wall of text, just really frustrated so far with how little of Nix is documented properly and how untransparent the whole ecosystem in general is 🙃

15:45:29
@k900:0upti.meK900Not sure what to tell you about your tensorflow problem, but I can tell you that tensorflow packaging is horrible, even by python standards 15:51:09
@k900:0upti.meK900 Re: your general question - everything you described should be possible, but you probably want Jupyter to be a dev dependency in Poetry instead 15:51:54
@akiiino:matrix.orgakiiinoYeah, I figured. Tensorflow sucks in general, but I gotta stick with it for reasons beyond my control 🤷15:52:12
@k900:0upti.meK900Otherwise you'll mix two dependency trees and then Fun will happen 15:52:16

Show newer messages


Back to Room ListRoom Version: 6