Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Can anyone check my very short dev-python/td-watson 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
crocket
Guru
Guru


Joined: 29 Apr 2017
Posts: 558

PostPosted: Sat Apr 29, 2017 2:23 pm    Post subject: Can anyone check my very short dev-python/td-watson ebuild? Reply with quote

This is the first ebuild that I ever wrote. I put it in my local overlay, built it, and installed it successfully.

Code:
EAPI=6

PYTHON_COMPAT=( python2_7 python{3_4,3_5,3_6} )
inherit distutils-r1

DESCRIPTION="A wonderful CLI to track your time!"
HOMEPAGE="https://github.com/TailorDev/Watson"
SRC_URI="mirror://pypi/${P:0:1}/${PN}/${P}.tar.gz"

LICENSE="MIT"
SLOT="0"
KEYWORDS="~amd64"

RDEPEND="
   =dev-python/arrow-0*[${PYTHON_USEDEP}]
   =dev-python/click-6*[${PYTHON_USEDEP}]
   =dev-python/requests-2*[${PYTHON_USEDEP}]"
DEPEND=""


Because I merely copied some fragments from other python ebuilds, I don't know what the following line means.

Code:
SRC_URI="mirror://pypi/${P:0:1}/${PN}/${P}.tar.gz"


How is

Code:
mirror://pypi


possible? Although I know bash a bit, I really don't understand

Code:
${P:0:1}


Based on requirements.txt, I wrote

Code:
RDEPEND="
   =dev-python/arrow-0*[${PYTHON_USEDEP}]
   =dev-python/click-6*[${PYTHON_USEDEP}]
   =dev-python/requests-2*[${PYTHON_USEDEP}]"
DEPEND=""


But, I don't know whether I got dependencies right because I haven't built dev-python/td-watson in a clean gentoo system.
Is there a way to cheaply and cleanly establish a clean gentoo system every time?
Back to top
View user's profile Send private message
Hu
Administrator
Administrator


Joined: 06 Mar 2007
Posts: 21918

PostPosted: Sat Apr 29, 2017 4:39 pm    Post subject: Reply with quote

mirror:// is a magic protocol that Portage resolves as a list of URLs, where the list chosen depends on the "host" passed to mirror://. In this case, it will pick mirrors associated with PyPI. I believe this list is maintained in /usr/portage/profiles/thirdpartymirrors.

${P:0:1} is a bash substitution. Starting at offset 0, it copies up to 1 character from $P to the output. Try it on a shell variable whose value you know, like $HOME or $USER. Use values other than 0 or 1 to see what happens.
Back to top
View user's profile Send private message
crocket
Guru
Guru


Joined: 29 Apr 2017
Posts: 558

PostPosted: Sat Apr 29, 2017 11:53 pm    Post subject: Reply with quote

Hu wrote:
mirror:// is a magic protocol that Portage resolves as a list of URLs, where the list chosen depends on the "host" passed to mirror://. In this case, it will pick mirrors associated with PyPI. I believe this list is maintained in /usr/portage/profiles/thirdpartymirrors.

${P:0:1} is a bash substitution. Starting at offset 0, it copies up to 1 character from $P to the output. Try it on a shell variable whose value you know, like $HOME or $USER. Use values other than 0 or 1 to see what happens.


Thanks. How do I know I got dependencies right?
Back to top
View user's profile Send private message
Hu
Administrator
Administrator


Joined: 06 Mar 2007
Posts: 21918

PostPosted: Sun Apr 30, 2017 12:22 am    Post subject: Reply with quote

You could inspect all the files to see exactly what Python modules they require, then verify that all such modules are provided by packages that are listed in your RDEPEND (or are provided by packages that are part of @system).

You could punt and let users report missing dependencies if/when they are found.
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