dev-python/appdirs: force usage of distutils instead of setuptools
authorTim Harder <radhermit@gentoo.org>
Wed, 25 Jan 2017 07:20:15 +0000 (02:20 -0500)
committerTim Harder <radhermit@gentoo.org>
Wed, 25 Jan 2017 07:23:20 +0000 (02:23 -0500)
In order to break a cyclic dependency with setuptools since appdirs is
required by setuptools and isn't vendored anymore.

dev-python/appdirs/appdirs-1.4.0-r1.ebuild [new file with mode: 0644]
dev-python/appdirs/files/appdirs-1.4.0-distutils.patch [new file with mode: 0644]

diff --git a/dev-python/appdirs/appdirs-1.4.0-r1.ebuild b/dev-python/appdirs/appdirs-1.4.0-r1.ebuild
new file mode 100644 (file)
index 0000000..fc2827a
--- /dev/null
@@ -0,0 +1,30 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=6
+
+PYTHON_COMPAT=( python2_7 python3_{4,5} pypy pypy3 )
+
+inherit distutils-r1
+
+DESCRIPTION="Module for determining appropriate platform-specific dirs"
+HOMEPAGE="https://github.com/ActiveState/appdirs"
+SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
+IUSE=""
+
+# api.doctests is missing in the dist zipfile
+# and the 'internal' doctest does nothing
+RESTRICT=test
+
+PATCHES=( "${FILESDIR}"/${P}-distutils.patch )
+
+python_test() {
+       cd test || die
+       "${PYTHON}" test.py \
+               || die "Tests fail with ${EPYTHON}"
+}
diff --git a/dev-python/appdirs/files/appdirs-1.4.0-distutils.patch b/dev-python/appdirs/files/appdirs-1.4.0-distutils.patch
new file mode 100644 (file)
index 0000000..eb0cf82
--- /dev/null
@@ -0,0 +1,22 @@
+Force setup.py to use distutils in order to break setuptools cyclic dependency.
+
+--- appdirs-1.4.0/setup.py
++++ appdirs-1.4.0/setup.py
+@@ -2,7 +2,7 @@
+ import sys
+ import os
+ import os.path
+-from setuptools import setup
++from distutils.core import setup
+ import appdirs
+ tests_require = []
+@@ -38,8 +38,6 @@
+         Programming Language :: Python :: 3.2
+         Topic :: Software Development :: Libraries :: Python Modules
+         """.split('\n') if c.strip()],
+-    test_suite='test.test_api',
+-    tests_require=tests_require,
+     keywords='application directory log cache user',
+     author='Trent Mick',
+     author_email='trentm@gmail.com',