Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
trying to use pip inside an ebuild
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
mauricev
Apprentice
Apprentice


Joined: 22 Mar 2004
Posts: 202

PostPosted: Fri Apr 26, 2024 5:45 am    Post subject: trying to use pip inside an ebuild Reply with quote

I am trying to install mongodb 7.0.8. I have an ebuild for 6.x and trying to get it to work, now for 7.

Here's an excerpt

Code:
set -x
   python3 -m pip install --target ./site_scons requirements_parser; \


This command results in
Code:
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7fc70094b710>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution')': /simple/cryptography/


So it appears that within the emerge environment, the network is not available. I am assuming that emerge creates a virtual environment for pip to run in, but it apparently blocks the Internet. Or is it because pip is actually executing on the real OS?
Back to top
View user's profile Send private message
Genone
Retired Dev
Retired Dev


Joined: 14 Mar 2003
Posts: 9604
Location: beyond the rim

PostPosted: Fri Apr 26, 2024 7:23 am    Post subject: Reply with quote

Yes, by default ebuilds are isolated from network access for security and reliability reasons. Also emerge itself does not create a virtual environment, that would be the job of the ebuild/eclass if it needs that (the idea doesn't sound right to me though).

The main question though is why you'd want to call pip inside your ebuild? Dependencies should be specified by the ebuild using *DEPEND, installing them via pip will just cause a mess.


Last edited by Genone on Fri Apr 26, 2024 7:24 am; edited 1 time in total
Back to top
View user's profile Send private message
logrusx
Advocate
Advocate


Joined: 22 Feb 2018
Posts: 2366

PostPosted: Fri Apr 26, 2024 7:23 am    Post subject: Re: trying to use pip inside an ebuild Reply with quote

mauricev wrote:

So it appears that within the emerge environment, the network is not available.


Of course it isn't. This is a security hazard.

You don't need ebuilds to install python packages, either use virtual environment or install them per user and not globally.

If you still need an ebuild for something else, you need to store the necessary files somewhere and add them to SRC_URI so portage can download them for you.

Best Regards,
Georgi
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum