# Copyright 1999-2017 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$

EAPI=8
PYTHON_COMPAT=( python3_{9..12} )
DISTUTILS_USE_PEP517=setuptools
DISTUTILS_SINGLE_IMPL=1

MY_PN="engineering_notation"

inherit distutils-r1

DESCRIPTION="Easy engineering notation using python"
HOMEPAGE="https://github.com/yaqwsx/KiKit"
if [[ ${PV} == "9999" ]] ; then
        EGIT_REPO_URI="https://github.com/slightlynybbled/${MY_PN}.git"
        KEYWORDS=""
        inherit git-r3
else
        KEYWORDS="~amd64 ~x86"
	SRC_URI="https://github.com/slightlynybbled/${MY_PN}/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz"
	S="${WORKDIR}/${MY_PN}-${PV}"
fi

LICENSE="MIT"
SLOT="0"
IUSE=""
RESTRICT="test"

REQUIRED_USE="${PYTHON_REQUIRED_USE}"

RDEPEND="$(python_gen_cond_dep '
		dev-python/flake8[${PYTHON_USEDEP}]
		dev-python/pytest[${PYTHON_USEDEP}]
	')"

DEPEND="${RDEPEND}"

src_prepare() {
	sed "s@engineering_notation/version.py@$S/$MY_PN/version.py@" \
		-i "${S}/setup.py" || die

	default
}