public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: dev-python/jaraco-context/, dev-python/jaraco-context/files/
@ 2020-07-20 16:39 Michał Górny
  0 siblings, 0 replies; 2+ messages in thread
From: Michał Górny @ 2020-07-20 16:39 UTC (permalink / raw
  To: gentoo-commits

commit:     272c9a97d4c10666fd03d380fd47817d15edbe15
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Mon Jul 20 16:33:33 2020 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Mon Jul 20 16:33:33 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=272c9a97

dev-python/jaraco-context: New dep of dev-python/cheroot

Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>

 dev-python/jaraco-context/Manifest                 |  1 +
 .../files/jaraco-context-3.0.0-useless-deps.patch  | 62 ++++++++++++++++++++++
 .../jaraco-context/jaraco-context-3.0.0.ebuild     | 47 ++++++++++++++++
 dev-python/jaraco-context/metadata.xml             |  8 +++
 4 files changed, 118 insertions(+)

diff --git a/dev-python/jaraco-context/Manifest b/dev-python/jaraco-context/Manifest
new file mode 100644
index 00000000000..521629f10e5
--- /dev/null
+++ b/dev-python/jaraco-context/Manifest
@@ -0,0 +1 @@
+DIST jaraco.context-3.0.0.tar.gz 12901 BLAKE2B b0a18d8799de211c9827a708302798372dff06767fbac08f4bff8ed48e1dde4cca8d3896a3c4dccd186efdc4d80ffe2b972a05e8f351ec53dcd0c7dec45cfcea SHA512 fd48a9af65edea3212c194758ba1a8fc2d7efc35f7eaec959a7f327ad46d1bf15f295af29d62726f813d35baaeaff35bc3fcd6e27a0e0f272232772e1cb87c17

diff --git a/dev-python/jaraco-context/files/jaraco-context-3.0.0-useless-deps.patch b/dev-python/jaraco-context/files/jaraco-context-3.0.0-useless-deps.patch
new file mode 100644
index 00000000000..3b69581ab2b
--- /dev/null
+++ b/dev-python/jaraco-context/files/jaraco-context-3.0.0-useless-deps.patch
@@ -0,0 +1,62 @@
+From e3a1f344c296f9d6193f4bf2ac1e0cdafcddce0e Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org>
+Date: Mon, 20 Jul 2020 18:11:31 +0200
+Subject: [PATCH] Make jaraco.apt & yg.lockfile imports optional
+
+Handle missing jaraco.apt & yg.lockfile modules more gracefully,
+delaying the error until dependency_context is actually used.  These
+two modules are only used by the dependency_context, and this context
+can only work on apt-based systems, so there is no point in forcing
+the extraneous dependencies on systems that do not use apt where
+jaraco.context is being installed for other context managers.
+---
+ jaraco/context.py | 19 ++++++++++++++++---
+ 1 file changed, 16 insertions(+), 3 deletions(-)
+
+diff --git a/jaraco/context.py b/jaraco/context.py
+index 0b5b1bc..13dfdf6 100644
+--- a/jaraco/context.py
++++ b/jaraco/context.py
+@@ -13,8 +13,15 @@ try:
+ except Exception:
+     import contextlib as contextlib2
+ 
+-import jaraco.apt
+-import yg.lockfile
++try:
++    import jaraco.apt as apt
++except ImportError:
++    apt = None
++
++try:
++    import yg.lockfile
++except ImportError:
++    yg = None
+ 
+ 
+ __metaclass__ = type
+@@ -131,6 +138,12 @@ def dependency_context(package_names, aggressively_remove=False):
+     """
+     installed_packages = []
+     log = logging.getLogger(__name__)
++    if apt is None:
++        log.error("jaraco.apt not found installed")
++        raise ImportError("jaraco.apt not found installed")
++    if yg is None:
++        log.error("yg.lockfile not found installed")
++        raise ImportError("yg.lockfile not found installed")
+     try:
+         if not package_names:
+             logging.debug('No packages requested')
+@@ -144,7 +157,7 @@ def dependency_context(package_names, aggressively_remove=False):
+                 stderr=subprocess.STDOUT,
+             )
+             log.debug('Aptitude output:\n%s', output)
+-            installed_packages = jaraco.apt.parse_new_packages(
++            installed_packages = apt.parse_new_packages(
+                 output, include_automatic=aggressively_remove
+             )
+             if not installed_packages:
+-- 
+2.27.0
+

diff --git a/dev-python/jaraco-context/jaraco-context-3.0.0.ebuild b/dev-python/jaraco-context/jaraco-context-3.0.0.ebuild
new file mode 100644
index 00000000000..552d8a941c0
--- /dev/null
+++ b/dev-python/jaraco-context/jaraco-context-3.0.0.ebuild
@@ -0,0 +1,47 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+# upstream uses bad template
+DISTUTILS_USE_SETUPTOOLS=manual
+PYTHON_COMPAT=( python3_{6..9} pypy3 )
+
+inherit distutils-r1
+
+MY_PN="${PN/-/.}"
+DESCRIPTION="Context managers by jaraco"
+HOMEPAGE="https://github.com/jaraco/jaraco.context"
+SRC_URI="mirror://pypi/${PN:0:1}/${MY_PN}/${MY_PN}-${PV}.tar.gz"
+S="${WORKDIR}/${MY_PN}-${PV}"
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+
+RDEPEND="
+	>=dev-python/namespace-jaraco-2[${PYTHON_USEDEP}]
+"
+BDEPEND="
+	dev-python/setuptools[${PYTHON_USEDEP}]
+	dev-python/setuptools_scm[${PYTHON_USEDEP}]
+"
+
+distutils_enable_tests pytest
+
+PATCHES=(
+	"${FILESDIR}"/${P}-useless-deps.patch
+)
+
+python_prepare_all() {
+	# used only for apt support that's irrelevant to Gentoo
+	sed -i -e '/jaraco\.apt/d' -e '/yg\.lockfile/d' setup.cfg || die
+	# pytest plugins
+	sed -i -e 's:--flake8 --black --cov::' pytest.ini || die
+	distutils-r1_python_prepare_all
+}
+
+python_install() {
+	rm "${BUILD_DIR}"/lib/jaraco/__init__.py || die
+	distutils-r1_python_install
+}

diff --git a/dev-python/jaraco-context/metadata.xml b/dev-python/jaraco-context/metadata.xml
new file mode 100644
index 00000000000..7f4f33c6dbc
--- /dev/null
+++ b/dev-python/jaraco-context/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+	<maintainer type="project">
+		<email>python@gentoo.org</email>
+		<name>Python</name>
+	</maintainer>
+</pkgmetadata>


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-python/jaraco-context/, dev-python/jaraco-context/files/
@ 2021-03-02  8:33 Michał Górny
  0 siblings, 0 replies; 2+ messages in thread
From: Michał Górny @ 2021-03-02  8:33 UTC (permalink / raw
  To: gentoo-commits

commit:     828c737b37c0d6a026a4ecde277e3ad12ccb75b1
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Tue Mar  2 08:31:58 2021 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Tue Mar  2 08:31:58 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=828c737b

dev-python/jaraco-context: Remove old

Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>

 dev-python/jaraco-context/Manifest                 |  1 -
 .../files/jaraco-context-3.0.0-useless-deps.patch  | 62 ----------------------
 .../jaraco-context/jaraco-context-3.0.0-r1.ebuild  | 41 --------------
 3 files changed, 104 deletions(-)

diff --git a/dev-python/jaraco-context/Manifest b/dev-python/jaraco-context/Manifest
index 3e3330b3017..a1dc974d4ca 100644
--- a/dev-python/jaraco-context/Manifest
+++ b/dev-python/jaraco-context/Manifest
@@ -1,2 +1 @@
-DIST jaraco.context-3.0.0.tar.gz 12901 BLAKE2B b0a18d8799de211c9827a708302798372dff06767fbac08f4bff8ed48e1dde4cca8d3896a3c4dccd186efdc4d80ffe2b972a05e8f351ec53dcd0c7dec45cfcea SHA512 fd48a9af65edea3212c194758ba1a8fc2d7efc35f7eaec959a7f327ad46d1bf15f295af29d62726f813d35baaeaff35bc3fcd6e27a0e0f272232772e1cb87c17
 DIST jaraco.context-4.0.0.tar.gz 11257 BLAKE2B 38faeb6036ebd2fc6cea9f29dc7fbd89b0ea60819e280e36c8c4f0f90e9ba2552524bfc0f3fc16601cd43276d19e166d9de4107ced885f88dea11efbe0a79913 SHA512 ec76e03d3d5a2148dd49159b303ee278501b9744d3e4d096d6aca516658fb04da020d1cbb1c8eb3dcb58097266e0419883d23e4064c295ced3846540177e57ee

diff --git a/dev-python/jaraco-context/files/jaraco-context-3.0.0-useless-deps.patch b/dev-python/jaraco-context/files/jaraco-context-3.0.0-useless-deps.patch
deleted file mode 100644
index 3b69581ab2b..00000000000
--- a/dev-python/jaraco-context/files/jaraco-context-3.0.0-useless-deps.patch
+++ /dev/null
@@ -1,62 +0,0 @@
-From e3a1f344c296f9d6193f4bf2ac1e0cdafcddce0e Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org>
-Date: Mon, 20 Jul 2020 18:11:31 +0200
-Subject: [PATCH] Make jaraco.apt & yg.lockfile imports optional
-
-Handle missing jaraco.apt & yg.lockfile modules more gracefully,
-delaying the error until dependency_context is actually used.  These
-two modules are only used by the dependency_context, and this context
-can only work on apt-based systems, so there is no point in forcing
-the extraneous dependencies on systems that do not use apt where
-jaraco.context is being installed for other context managers.
----
- jaraco/context.py | 19 ++++++++++++++++---
- 1 file changed, 16 insertions(+), 3 deletions(-)
-
-diff --git a/jaraco/context.py b/jaraco/context.py
-index 0b5b1bc..13dfdf6 100644
---- a/jaraco/context.py
-+++ b/jaraco/context.py
-@@ -13,8 +13,15 @@ try:
- except Exception:
-     import contextlib as contextlib2
- 
--import jaraco.apt
--import yg.lockfile
-+try:
-+    import jaraco.apt as apt
-+except ImportError:
-+    apt = None
-+
-+try:
-+    import yg.lockfile
-+except ImportError:
-+    yg = None
- 
- 
- __metaclass__ = type
-@@ -131,6 +138,12 @@ def dependency_context(package_names, aggressively_remove=False):
-     """
-     installed_packages = []
-     log = logging.getLogger(__name__)
-+    if apt is None:
-+        log.error("jaraco.apt not found installed")
-+        raise ImportError("jaraco.apt not found installed")
-+    if yg is None:
-+        log.error("yg.lockfile not found installed")
-+        raise ImportError("yg.lockfile not found installed")
-     try:
-         if not package_names:
-             logging.debug('No packages requested')
-@@ -144,7 +157,7 @@ def dependency_context(package_names, aggressively_remove=False):
-                 stderr=subprocess.STDOUT,
-             )
-             log.debug('Aptitude output:\n%s', output)
--            installed_packages = jaraco.apt.parse_new_packages(
-+            installed_packages = apt.parse_new_packages(
-                 output, include_automatic=aggressively_remove
-             )
-             if not installed_packages:
--- 
-2.27.0
-

diff --git a/dev-python/jaraco-context/jaraco-context-3.0.0-r1.ebuild b/dev-python/jaraco-context/jaraco-context-3.0.0-r1.ebuild
deleted file mode 100644
index f709277cbf5..00000000000
--- a/dev-python/jaraco-context/jaraco-context-3.0.0-r1.ebuild
+++ /dev/null
@@ -1,41 +0,0 @@
-# Copyright 1999-2020 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-PYTHON_COMPAT=( python3_{7..9} pypy3 )
-
-inherit distutils-r1
-
-MY_PN="${PN/-/.}"
-DESCRIPTION="Context managers by jaraco"
-HOMEPAGE="https://github.com/jaraco/jaraco.context"
-SRC_URI="mirror://pypi/${PN:0:1}/${MY_PN}/${MY_PN}-${PV}.tar.gz"
-S="${WORKDIR}/${MY_PN}-${PV}"
-
-LICENSE="MIT"
-SLOT="0"
-KEYWORDS="amd64 arm arm64 ~ia64 ppc ~ppc64 x86"
-
-BDEPEND="
-	dev-python/setuptools_scm[${PYTHON_USEDEP}]
-"
-
-distutils_enable_tests pytest
-
-PATCHES=(
-	"${FILESDIR}"/${P}-useless-deps.patch
-)
-
-python_prepare_all() {
-	# used only for apt support that's irrelevant to Gentoo
-	sed -i -e '/jaraco\.apt/d' -e '/yg\.lockfile/d' setup.cfg || die
-	# pytest plugins
-	sed -i -e 's:--flake8 --black --cov::' pytest.ini || die
-	distutils-r1_python_prepare_all
-}
-
-python_install() {
-	rm "${BUILD_DIR}"/lib/jaraco/__init__.py || die
-	distutils-r1_python_install
-}


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-03-02  8:33 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-07-20 16:39 [gentoo-commits] repo/gentoo:master commit in: dev-python/jaraco-context/, dev-python/jaraco-context/files/ Michał Górny
  -- strict thread matches above, loose matches on Subject: below --
2021-03-02  8:33 Michał Górny

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox