summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Gilbert <floppym@gentoo.org>2017-01-30 23:39:38 -0500
committerMike Gilbert <floppym@gentoo.org>2017-01-30 23:44:00 -0500
commit63207c8570eafab4e274685d9c62c0f19dd21a23 (patch)
tree60c7c7b660e74f6f530f21fd2f7db6f5479700d9 /dev-python/packaging
parentdev-python/pyparsing: force distutils to avoid circular dep with setuptools (diff)
downloadgentoo-63207c8570eafab4e274685d9c62c0f19dd21a23.tar.gz
gentoo-63207c8570eafab4e274685d9c62c0f19dd21a23.tar.bz2
gentoo-63207c8570eafab4e274685d9c62c0f19dd21a23.zip
dev-python/packaging: force distutils
Package-Manager: Portage-2.3.3_p42_p433273, Repoman-2.3.1_p35_p433273
Diffstat (limited to 'dev-python/packaging')
-rw-r--r--dev-python/packaging/files/packaging-16.8-distutils.patch14
-rw-r--r--dev-python/packaging/packaging-16.8.ebuild30
2 files changed, 38 insertions, 6 deletions
diff --git a/dev-python/packaging/files/packaging-16.8-distutils.patch b/dev-python/packaging/files/packaging-16.8-distutils.patch
new file mode 100644
index 000000000000..84bbb618a6fe
--- /dev/null
+++ b/dev-python/packaging/files/packaging-16.8-distutils.patch
@@ -0,0 +1,14 @@
+--- a/setup.py
++++ b/setup.py
+@@ -13,10 +13,7 @@ import re
+ # dependency when projects attempt to unbundle stuff from setuptools and pip.
+ # Though we don't really support that, it makes things easier if we do this and
+ # should hopefully cause less issues for end users.
+-try:
+- from setuptools import setup
+-except ImportError:
+- from distutils.core import setup
++from distutils.core import setup
+
+
+ base_dir = os.path.dirname(__file__)
diff --git a/dev-python/packaging/packaging-16.8.ebuild b/dev-python/packaging/packaging-16.8.ebuild
index 993971dce94e..0a554239f142 100644
--- a/dev-python/packaging/packaging-16.8.ebuild
+++ b/dev-python/packaging/packaging-16.8.ebuild
@@ -17,18 +17,36 @@ LICENSE="|| ( Apache-2.0 BSD-2 )"
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~ppc-aix ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~amd64-linux ~arm-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
IUSE="test"
-RDEPEND=""
-DEPEND="${RDEPEND}
+RDEPEND="
+ >=dev-python/pyparsing-2.1.10[${PYTHON_USEDEP}]
+ dev-python/six[${PYTHON_USEDEP}]
+"
+DEPEND="
test? (
dev-python/pretend[${PYTHON_USEDEP}]
dev-python/pytest[${PYTHON_USEDEP}]
)
"
-PDEPEND="
- dev-python/pyparsing[${PYTHON_USEDEP}]
- dev-python/six[${PYTHON_USEDEP}]
-"
+
+PATCHES=(
+ "${FILESDIR}/${PN}-16.8-distutils.patch"
+)
python_test() {
py.test --capture=no --strict -v || die
}
+
+pkg_preinst() {
+ # https://bugs.gentoo.org/585146
+ cd "${HOME}" || die
+
+ _cleanup() {
+ local pyver=$("${PYTHON}" -c "from distutils.sysconfig import get_python_version; print(get_python_version())")
+ local egginfo="${ROOT%/}$(python_get_sitedir)/${P}-py${pyver}.egg-info"
+ if [[ -d ${egginfo} ]]; then
+ echo rm -r "${egginfo}"
+ rm -r "${egginfo}" || die "Failed to remove egg-info directory"
+ fi
+ }
+ python_foreach_impl _cleanup
+}