*/*: Clean PYTHON_COMPAT of obsolete impls
[gentoo.git] / dev-python / automat / automat-0.7.0.ebuild
1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=6
5 PYTHON_COMPAT=( python2_7 python3_{6,7})
6
7 inherit distutils-r1
8
9 MYPN="Automat"
10 MYP="${MYPN}-${PV}"
11
12 DESCRIPTION="Self-service finite-state machines for the programmer on the go"
13 HOMEPAGE="https://github.com/glyph/automat https://pypi.org/project/Automat/"
14 SRC_URI="mirror://pypi/${MYPN:0:1}/${MYPN}/${MYP}.tar.gz"
15
16 LICENSE="MIT"
17 SLOT="0"
18 KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-linux ~x86-linux"
19 IUSE="examples test"
20 RESTRICT="!test? ( test )"
21
22 RDEPEND="
23         dev-python/attrs[${PYTHON_USEDEP}]
24         dev-python/six[${PYTHON_USEDEP}]
25 "
26 DEPEND="
27         ${RDEPEND}
28         dev-python/setuptools_scm[${PYTHON_USEDEP}]
29         dev-python/m2r[${PYTHON_USEDEP}]
30         test? ( dev-python/pytest[${PYTHON_USEDEP}] )
31 "
32
33 S=${WORKDIR}/${MYP}
34
35 python_prepare_all() {
36         if use test ; then
37                 # Remove since this is upstream benchmarking tests
38                 rm -r benchmark || die "FAILED to remove benchmark tests"
39         fi
40         distutils-r1_python_prepare_all
41 }
42
43 python_test() {
44         PYTHONPATH="${S}/test:${BUILD_DIR}/lib" py.test -v || die "Tests failed under ${EPYTHON}"
45 }
46
47 src_install() {
48         if use examples; then
49                 docinto examples
50                 dodoc docs/examples/*.py
51         fi
52         distutils-r1_src_install
53 }
54
55 pkg_postinst() {
56         einfo "For additional visualization functionality install these optional dependencies"
57         einfo "    >=dev-python/twisted-16.1.1"
58         einfo "    media-gfx/graphviz[python]"
59 }