Open Toluk opened 1 week ago
do you know how to solve the problem in general?
In setup.py
except (OSError, subprocess.CalledProcessError, IOError):
try:
with open(version_py, 'r') as f:
d = dict()
exec(f.read(), d)
version = d['__version__']
except IOError:
version = 'unknown'
in my case this block of code falls into "version = 'unknown'" and breaks something in setuptools (my guess), may be for stable releases (or tags in general) just switch this try-except block for direct version value ? Imo it looks overcomplicated. May be the problem is that i dont install this package through pip. I have limited knowledge of pip installation.
I'm learning how to write them, so nothing overcomplicated so far, looked at some examples and ended up with this, and it seems to work. python-ipmi-0.5.7.ebuild
# Copyright 2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
PYTHON_COMPAT=( python3_{7..13} )
DISTUTILS_USE_PEP517=setuptools
inherit distutils-r1
DESCRIPTION="Pure Python IPMI Library"
HOMEPAGE="https://github.com/kontron/python-ipmi"
SRC_URI="https://github.com/kontron/${PN}/archive/refs/tags/${PV}.tar.gz -> ${P}.tar.gz"
LICENSE="LGPL-2.1"
SLOT="0"
KEYWORDS="~amd64"
DEPEND=""
RDEPEND="${DEPEND}"
src_prepare() {
eapply "${FILESDIR}/version2.patch"
eapply_user
}
and version2.patch
except (OSError, subprocess.CalledProcessError, IOError):
try:
with open(version_py, 'r') as f:
d = dict()
exec(f.read(), d)
version = d['__version__']
except IOError:
version = 'unknown'
metadata.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<maintainer type="person">
<email>heiko.thiery@gmail.com</email>
<name>Heiko Thiery</name>
</maintainer>
<upstream>
<remote-id type="github">kontron/python-ipmi</remote-id>
</upstream>
</pkgmetadata>
Hello.
I was trying to create a gentoo portage ebuild for this python package and encountered an issue. Which could be bypassed by such patch:
Im not sure if this is important to begin with, but decided i should report about it.