kontron / python-ipmi

A pure python IPMI library
GNU Lesser General Public License v2.1
187 stars 75 forks source link

an issue creating ebuild for your library #142

Closed Toluk closed 1 year ago

Toluk commented 1 year ago

Hello.

I am using your library in a project and decided to make a Gentoo ebuild for it.

EAPI=8

PYTHON_COMPAT=( python3_{7..11} )
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="GNU LGPL 2.1"
SLOT="0"
KEYWORDS="~amd64"

DEPEND="dev-python/future[${PYTHON_USEDEP}]
        dev-python/pytest[${PYTHON_USEDEP}]"
RDEPEND="${DEPEND}"
BDEPEND=""

python_prepare() {
    sed -e "s/find_packages(exclude=\"test\")/find_packages(exclude=[\"tests\", \"tests.*\"])/" \
        -i setup.py || die
}

The problem is that i could not make it work without the last part with python_prepare() {...} May be you should change "packages=find_packages(exclude="test")" to the above. I am not that good at this, so may be the ebuild should be different.

hthiery commented 1 year ago

could you please test this:

diff --git a/setup.py b/setup.py
index abfe805..886e414 100644
--- a/setup.py
+++ b/setup.py
@@ -46,7 +46,7 @@ setup(name=name,
       download_url='https://github.com/kontron/python-ipmi/tarball/' + version,
       author='Michael Walle, Heiko Thiery',
       author_email='michael.walle@kontron.com, heiko.thiery@kontron.com',
-      packages=find_packages(exclude="test"),
+      packages=find_packages(exclude=['tests*']),
       license='LGPLv2+',
       platforms=["any"],
       classifiers=[
Toluk commented 1 year ago

Hello again.

I've added your changes as a PATCH and removed the sed part. On an empty nspawn container: ebuild python-ipmi-0.5.3.ebuild clean install merge finished with no errors and

# python3
>>> import pyipmi
>>>

seems to work just fine I think your change is valid and can be pushed in. A new pin(tag) would be nice.

setup-test.patch:

--- a/setup.py
+++ b/setup.py
@@ -46,7 +46,7 @@ setup(name=name,
       download_url='https://github.com/kontron/python-ipmi/tarball/' + version,
       author='Michael Walle, Heiko Thiery',
       author_email='michael.walle@kontron.com, heiko.thiery@kontron.com',
-      packages=find_packages(exclude="test"),
+      packages=find_packages(exclude=['tests*']),
       license='LGPLv2+',
       platforms=["any"],
       classifiers=[

temporary python-ipmi-0.5.3.ebuild:

EAPI=8

PYTHON_COMPAT=( python3_{7..11} )
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="GNU LGPL 2.1"
SLOT="0"
KEYWORDS="~amd64"

DEPEND="dev-python/future[${PYTHON_USEDEP}]
        dev-python/pytest[${PYTHON_USEDEP}]"
RDEPEND="${DEPEND}"
BDEPEND=""

PATCHES=("long address here/setup-test.patch")
hthiery commented 1 year ago

fixed and tagged new version 0.5.4