Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
portage python module documentation
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
bstaletic
Apprentice
Apprentice


Joined: 05 Apr 2014
Posts: 253

PostPosted: Tue Apr 02, 2024 6:17 am    Post subject: portage python module documentation Reply with quote

I have seen some nifty python scripts here and there, depending on import portage.
I would like to learn more about the portage python interface, but I can't find the documentation for it.

EDIT: Formatting cleanup.


Last edited by bstaletic on Tue Apr 02, 2024 10:04 am; edited 1 time in total
Back to top
View user's profile Send private message
Banana
Veteran
Veteran


Joined: 21 May 2004
Posts: 1393
Location: Germany

PostPosted: Tue Apr 02, 2024 6:29 am    Post subject: Reply with quote

I do not know if this the official docs, but those are a good start:

https://packages.gentoo.org/packages/sys-apps/portage
https://dev.gentoo.org/~zmedico/portage/doc/api/
_________________
My personal space
My delta-labs.org snippets do expire

PFL - Portage file list - find which package a file or command belongs to.
Back to top
View user's profile Send private message
fedeliallalinea
Administrator
Administrator


Joined: 08 Mar 2003
Posts: 30925
Location: here

PostPosted: Tue Apr 02, 2024 6:31 am    Post subject: Reply with quote

The python portage api lack of good documentation.
You can start with https://www.funtoo.org/Portage_API and https://dev.gentoo.org/~zmedico/portage/doc/api/.
_________________
Questions are guaranteed in life; Answers aren't.
Back to top
View user's profile Send private message
bstaletic
Apprentice
Apprentice


Joined: 05 Apr 2014
Posts: 253

PostPosted: Tue Apr 02, 2024 10:08 am    Post subject: Reply with quote

Thanks to both of you!

That API doc by zmedico will be useful, but it seems more a reference rather than a comprehensive documentation.
The funtoo page looks very interesting!
Back to top
View user's profile Send private message
Genone
Retired Dev
Retired Dev


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

PostPosted: Tue Apr 02, 2024 2:26 pm    Post subject: Reply with quote

The API doc is just auto-generated from the sources and code comments, not much in terms of actual documentation. In particular you'll have a hard time figuring out how the different components interact with each other and how to properly use them.

The Funtoo page on the other hand just covers some very basic functions, and also looks quite outdated (referencing what I was using 15+ years ago when the python codebase consisted of basically just two huge files). Not sure the examples there still work without additional initialization code. Unfortunately the modularization that has happened since to improve performance and maintainability also made it difficult to find the proper entry points to get started. Back in the day you could just open emerge, locate the action you were interested in and look for the individual classes/functions in portage.py.
Back to top
View user's profile Send private message
bstaletic
Apprentice
Apprentice


Joined: 05 Apr 2014
Posts: 253

PostPosted: Tue Apr 02, 2024 6:17 pm    Post subject: Reply with quote

Genone wrote:
The API doc is just auto-generated from the sources and code comments, not much in terms of actual documentation. In particular you'll have a hard time figuring out how the different components interact with each other and how to properly use them.


That much was painfully obvious.

Genone wrote:
The Funtoo page on the other hand just covers some very basic functions, and also looks quite outdated (referencing what I was using 15+ years ago when the python codebase consisted of basically just two huge files). Not sure the examples there still work without additional initialization code.


The things from the Funtoo page work fine, as far as I can tell, based on what I have tried today.
It was enough for what I wanted to do. I'm sure that's just scratching the surface.
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