nix-community / poetry2nix

Convert poetry projects to nix automagically [maintainer=]
MIT License
892 stars 451 forks source link

Private Python package documentation is wrong #1678

Open oni303 opened 6 months ago

oni303 commented 6 months ago

Describe the issue

The documentation regarding "Using private Python package repositories with authentication" has some mistakes and does not lead to a working setup after fixing the obvious one.

Additional context

I am trying to build a flake from a poetry package that needs a few private packages which are hosted on a gitlab server that requires authentication. After following the steps in the documentation, gitlab still returns error 401 Unauthorized. The netrc file is extra-sandbox-paths is used by nix, as I get a "file not found" if I miss-spell it. I noticed, that the env-vars file in my sandbox states declare -x NETRC="". Does anyone have an idea how to use poetry2nix with private repositories?

my changes

nix.conf

extra-sandbox-paths /etc/nix/netrc
trusted-users <username>

should be

extra-sandbox-paths = /etc/nix/netrc
trusted-users = <username>

otherwise nix daemon crashes with a "illegal configuration line" error

netrc

on this one I am less certain but I think:

machine https://example.org

should be

machine example.org
heimalne commented 4 months ago

Could you create a first PR on the documentation fixes. Both your points are valid.

If you haven't done so, you still have to pass in the path to the netrc file via the nix-build command and you could try passing the extra-sandbox-path again explictly:

nix-build -I NETRC=/etc/nix/netrc --option extra-sandbox-paths /etc/nix/netrc ...
vonjackets commented 3 weeks ago

Has there been any movement/work on this issue? I've been attemping to use the netrc method to build a flake that'll containerize a python dev environment, but poetry2nix continuously ignores my netrc settings and elects to read from files.pythonhosted.org anyway.

heimalne commented 1 week ago

Not that i know of.