4be5e34f6b40b2359a10d85142109ebf03a00bd7
[gentoo.git] / dev-python / autopep8 / autopep8-1.4.3.ebuild
1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=6
5
6 PYTHON_COMPAT=( python{2_7,3_6} pypy3 )
7 PYTHON_REQ_USE="threads(+)"
8
9 inherit distutils-r1
10
11 DESCRIPTION="Automatically formats Python code to conform to the PEP 8 style guide"
12 HOMEPAGE="https://github.com/hhatto/autopep8 https://pypi.org/project/autopep8/"
13 if [[ ${PV} == *9999* ]]; then
14         EGIT_REPO_URI="https://github.com/hhatto/${PN}.git"
15         inherit git-r3
16 else
17         SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
18         KEYWORDS="amd64 ~arm64 x86 ~amd64-linux ~x86-linux"
19 fi
20
21 LICENSE="MIT"
22 SLOT="0"
23 IUSE="test"
24 RESTRICT="!test? ( test )"
25
26 RDEPEND="
27         >=dev-python/pep8-1.5.7[${PYTHON_USEDEP}]
28         >=dev-python/pycodestyle-2.3[${PYTHON_USEDEP}]"
29
30 DEPEND="
31         dev-python/setuptools[${PYTHON_USEDEP}]
32         test? (
33                 ${RDEPEND}
34                 >=dev-python/pydiff-0.1.2[${PYTHON_USEDEP}]
35         )"
36
37 python_prepare_all() {
38         # Prevent UnicodeDecodeError with LANG=C
39         sed -e "/é/d" -i MANIFEST.in || die
40         distutils-r1_python_prepare_all
41 }
42
43 python_test() {
44         esetup.py test
45 }