Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
SOLVED rename ebuild to comply with python naming policy
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
jang0
Tux's lil' helper
Tux's lil' helper


Joined: 09 Nov 2020
Posts: 75

PostPosted: Sat Aug 24, 2024 10:15 pm    Post subject: SOLVED rename ebuild to comply with python naming policy Reply with quote

Hello! I'm trying to create an ebuild for dev-python/pandoc-fignos-2.4.0, it looks as this:
Code:

EAPI=8

DISTUTILS_USE_PEP517=setuptools
PYTHON_COMPAT=( pypy3 python3_{10..13} )

inherit distutils-r1 pypi

DESCRIPTION="A pandoc filter for numbering figures and their references when converting markdown to other formats"
HOMEPAGE="
    https://github.com/tomduck/${PN}
    https://pypi.org/project/${PN}
"
#SRC_URI=""

LICENSE="GPL-3"
SLOT="0"
KEYWORDS="~amd64"

Trying to create the manifest I get the following error:
Code:

$pkgdev manifest
...
 * failed fetching file: pandoc_fignos-2.4.0.tar.gz, uri: https://files.pythonhosted.org/packages/source/p/pandoc-fignos/pandoc_fignos-2.4.0.tar.gz
 * failed fetching files for package dev-python/pandoc-fignos::yango
pkgdev manifest: error: failed fetching required distfiles

This error is due to Python package naming policy
I attempt by specifying:
Code:

SRC_URI="
    https://files.pythonhosted.org/packages/source/p/pandoc-fignos/${P}.tar.gz           
      -> pandoc_fignos-${PV}.tar.gz
"

But I couldn't properly rename it to change hyphen "-" to underscore "_", the file keeps naming as pandoc-fignos-2.4.0
Code:

#ebuild pandoc-fignos-2.4.0.ebuild clean test install
Forcing test.
 * 2.4.0.tar.gz BLAKE2B SHA512 size ;-) ...                                               [ ok ]
>>> Unpacking source...
>>> Unpacking 2.4.0.tar.gz to /var/tmp/portage/dev-python/pandoc-fignos-2.4.0/work
>>> Source unpacked in /var/tmp/portage/dev-python/pandoc-fignos-2.4.0/work
 * ERROR: dev-python/pandoc-fignos-2.4.0::yango failed (prepare phase):
 *   The source directory '/var/tmp/portage/dev-python/pandoc-fignos-2.4.0/work/pandoc_fignos-2.4.0' doesn't exist
 *
 * Call stack:
 *            ebuild.sh, line  784:  Called __ebuild_main 'prepare'
 *   phase-functions.sh, line 1073:  Called __dyn_prepare
 *   phase-functions.sh, line  400:  Called die
 * The specific snippet of code:
 *         die "The source directory '${S}' doesn't exist"
...

How can I properly rename downloaded file from pandoc-fignos-2.4.0 to pandoc_fignos-2.4.0? What I'm missing?


Last edited by jang0 on Sun Aug 25, 2024 5:20 pm; edited 1 time in total
Back to top
View user's profile Send private message
salahx
Guru
Guru


Joined: 12 Mar 2005
Posts: 556

PostPosted: Sat Aug 24, 2024 10:43 pm    Post subject: Reply with quote

There's a couple of functions in pypi.eclass to help you: See https://devmanual.gentoo.org/eclass-reference/pypi.eclass/index.html . The EXAMPLE on the page should help.
Back to top
View user's profile Send private message
grknight
Retired Dev
Retired Dev


Joined: 20 Feb 2015
Posts: 1910

PostPosted: Sun Aug 25, 2024 12:04 am    Post subject: Reply with quote

jang0 wrote:
This error is due to Python package naming policy
I attempt by specifying:
Code:

SRC_URI="
    https://files.pythonhosted.org/packages/source/p/pandoc-fignos/${P}.tar.gz           
      -> pandoc_fignos-${PV}.tar.gz
"

IIRC, file renames must be on the same line. A new line indicates a new file.
Back to top
View user's profile Send private message
eschwartz
Developer
Developer


Joined: 29 Oct 2023
Posts: 214

PostPosted: Sun Aug 25, 2024 3:47 am    Post subject: Reply with quote

PYPI_NO_NORMALIZE maybe?
Back to top
View user's profile Send private message
jang0
Tux's lil' helper
Tux's lil' helper


Joined: 09 Nov 2020
Posts: 75

PostPosted: Sun Aug 25, 2024 5:19 pm    Post subject: Reply with quote

salahx wrote:
There's a couple of functions in pypi.eclass to help you: See https://devmanual.gentoo.org/eclass-reference/pypi.eclass/index.html . The EXAMPLE on the page should help.


It functioned by adding the following line:
Code:

S=${WORKDIR}/${P}


Thank you!
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