ipsw-parser: pkgcheck fixes

This commit is contained in:
Anton Bolshakov 2024-07-14 22:29:42 +08:00
parent 74a19f4b4f
commit 4ddc4b8afe
No known key found for this signature in database
GPG key ID: 32BDCED870788F04
17 changed files with 262 additions and 22 deletions

View file

@ -13,6 +13,6 @@ HOMEPAGE="https://github.com/andrivet/python-asn1"
LICENSE="MIT"
SLOT="0"
KEYWORDS="amd64 ~arm64 x86"
KEYWORDS="amd64 arm64 x86"
REQUIRED_USE="${PYTHON_REQUIRED_USE}"

View file

@ -0,0 +1 @@
DIST cached-property-1.5.2.tar.gz 12244 BLAKE2B 26981dcfa51925741962c60ad8659a165af6d7f242f4abd392932aac20e966ad6c1763a25184bbabdeb5bd75f8063a430c41f0241afdee8013ffcb437b3ff7da SHA512 626d98a8891a70d858269859cf4e49416464c836d073c1331c21033a4cd9e0e47dc89b53bf393375439992f4993972517dc3cdcbb2cc6f8286f282d3c973e600

View file

@ -0,0 +1,30 @@
# Copyright 1999-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
DISTUTILS_USE_PEP517=setuptools
PYTHON_COMPAT=( python3_{10..12} )
PYPI_NO_NORMALIZE=1
inherit distutils-r1 pypi
DESCRIPTION="A cached-property for decorating methods in classes"
HOMEPAGE="https://github.com/pydanny/cached-property"
LICENSE="BSD"
SLOT="0"
KEYWORDS="~amd64 ~arm64 ~ppc64 ~riscv ~x86"
BDEPEND="test? ( dev-python/freezegun[${PYTHON_USEDEP}] )"
distutils_enable_tests pytest
DOCS=( {HISTORY,README}.rst )
PATCHES=(
# bug 638250
"${FILESDIR}"/${PN}-1.5.1-test-failure.patch
# @asyncio.coroutine removed in py3.11
"${FILESDIR}"/${PN}-1.5.2-python311.patch
)

View file

@ -0,0 +1,10 @@
--- a/tests/test_cached_property.py
+++ b/tests/test_cached_property.py
@@ -191,6 +191,7 @@
self.assert_cached(check, 2)
self.assert_cached(check, 2)
+ @unittest.skip("Gentoo Bug #638250")
def test_threads_ttl_expiry(self):
Check = CheckFactory(self.cached_property_factory(ttl=100000), threadsafe=True)
check = Check()

View file

@ -0,0 +1,142 @@
From 297031687679762849dedeaf24aa3a19116f095b Mon Sep 17 00:00:00 2001
From: Petr Viktorin <encukou@gmail.com>
Date: Thu, 2 Dec 2021 11:26:20 +0100
Subject: [PATCH 1/2] Don't use asyncio.coroutinefunction if it's not available
Python 3.11 drops the deprecated @asyncio.coroutine and
asyncio.iscoroutinefunction.
Using a wrapper with @asyncio.coroutine in __get__ wasn't
necessary (the future from asyncio.ensure_future is awaitable,
and the wrapper doesn't do anything asynchronous), so the
logic can be simplified to just call asyncio.ensure_future
(to schedule the task and store the result when it's
available).
Tests for @asyncio.coroutine are skipped on 3.11+.
An unnecessary call to asyncio.coroutine in tests is
removed: it's not necessary to call this for `async def`
functions.
---
cached_property.py | 24 +++++++++++-------------
conftest.py | 6 +++++-
tests/test_async_cached_property.py | 3 +--
3 files changed, 17 insertions(+), 16 deletions(-)
diff --git a/cached_property.py b/cached_property.py
index 3135871..254739c 100644
--- a/cached_property.py
+++ b/cached_property.py
@@ -13,6 +13,12 @@
import asyncio
except (ImportError, SyntaxError):
asyncio = None
+try:
+ iscoroutinefunction = asyncio.iscoroutinefunction
+except AttributeError:
+ # Python 3.11: @asyncio.coroutine was removed
+ from inspect import iscoroutinefunction
+
class cached_property(object):
@@ -30,22 +36,14 @@ def __get__(self, obj, cls):
if obj is None:
return self
- if asyncio and asyncio.iscoroutinefunction(self.func):
- return self._wrap_in_coroutine(obj)
+ if asyncio and iscoroutinefunction(self.func):
+ value = asyncio.ensure_future(self.func(obj))
+ else:
+ value = self.func(obj)
- value = obj.__dict__[self.func.__name__] = self.func(obj)
+ obj.__dict__[self.func.__name__] = value
return value
- def _wrap_in_coroutine(self, obj):
- @wraps(obj)
- @asyncio.coroutine
- def wrapper():
- future = asyncio.ensure_future(self.func(obj))
- obj.__dict__[self.func.__name__] = future
- return future
-
- return wrapper()
-
class threaded_cached_property(object):
"""
diff --git a/conftest.py b/conftest.py
index 0563f64..1c4b618 100644
--- a/conftest.py
+++ b/conftest.py
@@ -7,13 +7,17 @@
# Whether the async and await keywords work
has_async_await = sys.version_info[0] == 3 and sys.version_info[1] >= 5
+# Whether "from asyncio import coroutine" *fails*
+version_info = sys.version_info
+dropped_asyncio_coroutine = version_info[0] == 3 and version_info[1] >= 11
+
print("conftest.py", has_asyncio, has_async_await)
collect_ignore = []
-if not has_asyncio:
+if not has_asyncio or dropped_asyncio_coroutine:
collect_ignore.append("tests/test_coroutine_cached_property.py")
if not has_async_await:
diff --git a/tests/test_async_cached_property.py b/tests/test_async_cached_property.py
index 4ba84f3..d61cc28 100644
--- a/tests/test_async_cached_property.py
+++ b/tests/test_async_cached_property.py
@@ -9,8 +9,7 @@
def unittest_run_loop(f):
def wrapper(*args, **kwargs):
- coro = asyncio.coroutine(f)
- future = coro(*args, **kwargs)
+ future = f(*args, **kwargs)
loop = asyncio.get_event_loop()
loop.run_until_complete(future)
From 9b210d12fa73c91743378ba4a966417846e7ea9a Mon Sep 17 00:00:00 2001
From: Petr Viktorin <encukou@gmail.com>
Date: Thu, 2 Dec 2021 11:44:18 +0100
Subject: [PATCH 2/2] Restore compatibility with python 2.7
This is still necessary according to the Contributing Guidelines.
---
cached_property.py | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/cached_property.py b/cached_property.py
index 254739c..944e2f5 100644
--- a/cached_property.py
+++ b/cached_property.py
@@ -13,12 +13,12 @@
import asyncio
except (ImportError, SyntaxError):
asyncio = None
-try:
- iscoroutinefunction = asyncio.iscoroutinefunction
-except AttributeError:
- # Python 3.11: @asyncio.coroutine was removed
- from inspect import iscoroutinefunction
-
+if asyncio:
+ try:
+ iscoroutinefunction = asyncio.iscoroutinefunction
+ except AttributeError:
+ # Python 3.11: @asyncio.coroutine was removed
+ from inspect import iscoroutinefunction
class cached_property(object):

View file

@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<maintainer type="person">
<email>spiderx@spiderx.dp.ua</email>
<name>Vladimir Pavljuchenkov</name>
</maintainer>
<maintainer type="project">
<email>proxy-maint@gentoo.org</email>
<name>Proxy Maintainers</name>
</maintainer>
<longdescription lang="en">
This package provides a decorator for caching properties in classes to
make caching of time or computational expensive properties quick and easy
</longdescription>
<upstream>
<remote-id type="github">pydanny/cached-property</remote-id>
<remote-id type="pypi">cached-property</remote-id>
</upstream>
</pkgmetadata>

View file

@ -1,2 +1,2 @@
DIST ipsw-parser-1.2.1.tar.gz 46788 BLAKE2B 2d9b13ea5b941655c95ad6f5c45786574e1189b2684fda3b7bea314e15a0976894c44a09f65e4b656c75455b37162d423ea534161e785e683f08fd05de082e3c SHA512 be2a7c0920fb192aeaa698fe8cb42dfab2250654e6fd691e88228855a028b922f69da9360f9838197daa42bbcb8d69adb1f546657924832f1c3ce8be27baa759
DIST ipsw_parser-1.2.0.tar.gz 46738 BLAKE2B f8ad0dfceca700ff071fd5dc1fc9e8fd137a19d94ca00a6e5c7e050b84a4f41504b114a31b21682db6eb1178c45099bd537758301b4800da4a4f7d0216ae8beb SHA512 847355a39e59bcacc56d6d58662f272a5ada1ef716de5258cc026e9c797f7d79f1f566cf47185e042dc83cb8126be6aa60b1682b3f8109b9ff16c194ef028233
DIST ipsw_parser-1.3.1.tar.gz 51596 BLAKE2B c3800d0ad6b8bc2dee87ed36b6c4c5584149a9474e2d62e21da04d4824913d974f3ac9f4906ae4682c93d76e2db61579c89508d992fa0ad6cb0a084514753919 SHA512 d3c31480ecc15eaf87282f84268297765ec4629d95adf8d9e78e580e5761b8451ab421fc9d9897c09a1ecc23300301bee36e11d705d639228f50c4c4fe9be7e4

View file

@ -16,7 +16,6 @@ HOMEPAGE="https://github.com/doronz88/ipsw_parser"
LICENSE="GPL-3+"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE=""
RDEPEND=">=dev-python/construct-2.9.29[${PYTHON_USEDEP}]
dev-python/click[${PYTHON_USEDEP}]

View file

@ -1,8 +1,10 @@
# Copyright 1999-2023 Gentoo Authors
# Copyright 1999-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
#PYPI_NO_NORMALIZE=1
#PYPI_PN=${PN/_/-}
DISTUTILS_USE_PEP517=setuptools
PYTHON_COMPAT=( python3_{10..12} )
@ -14,21 +16,15 @@ HOMEPAGE="https://github.com/doronz88/ipsw_parser"
LICENSE="GPL-3+"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE=""
RDEPEND=">=dev-python/construct-2.9.29[${PYTHON_USEDEP}]
dev-python/click[${PYTHON_USEDEP}]
dev-python/coloredlogs[${PYTHON_USEDEP}]
dev-python/cached-property[${PYTHON_USEDEP}]
dev-python/plumbum[${PYTHON_USEDEP}]
>=dev-python/pyimg4-0.7[${PYTHON_USEDEP}]
>=dev-python/pyimg4-0.8.5[${PYTHON_USEDEP}]
"
DEPEND="${RDEPEND}"
REQUIRED_USE="${PYTHON_REQUIRED_USE}"
#distutils_enable_tests pytest
src_prepare(){
sed -i -e 's|rpcclient|ipsw_parser|g' pyproject.toml || die
eapply_user
}

View file

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<maintainer type="person">
<email>unknown@pentoo.ch</email>
<name>Author Unknown</name>
</maintainer>
<upstream>
<remote-id type="github">doronz88/ipsw_parser</remote-id>
<remote-id type="pypi">ipsw-parser</remote-id>
</upstream>
</pkgmetadata>

View file

@ -1 +1 @@
DIST pyimg4-0.8.tar.gz 13967 BLAKE2B c7948280099078906c70003fe16657352e2ea2fa4de447f05b91984668b9f62d4435ae97093a745e524e91d53e271fc69fa31b04f3c43e306f5f3242cf21bc89 SHA512 4d4c035cc9102707b5caea8ee6865e7bd5b6092280ade7e015fe0f5831624c666d00ff9f3538bce5f67b73117e667fdbee28c1a7512f7c72815b3c5bbe0f5838
DIST pyimg4-0.8.5.tar.gz 14861 BLAKE2B 0b755baaca989f6af7a80afb1fd2db9ee57c11d18abb43e1e3ec7e2a5aecad85781eb406800573277d4222868cf8d00ee21369953944603f12170134c331b50b SHA512 a0bfdd74f45cb800c485de0ed0ec31f7388423e58bce5222d72ece7a5191e51ef69f6a691f97ca6925c71b15c3fa9c411aede7fa502c1c6e1de6cca5b37602c8

View file

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<maintainer type="person">
<email>unknown@pentoo.ch</email>
<name>Author Unknown</name>
</maintainer>
<upstream>
<remote-id type="github">m1stadev/PyIMG4</remote-id>
<remote-id type="pypi">pyimg4</remote-id>
</upstream>
</pkgmetadata>

View file

@ -1,9 +1,9 @@
# Copyright 1999-2023 Gentoo Authors
# Copyright 1999-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
DISTUTILS_USE_PEP517=poetry
DISTUTILS_USE_PEP517=
PYTHON_COMPAT=( python3_{10..12} )
inherit distutils-r1 pypi
@ -13,8 +13,7 @@ HOMEPAGE="https://github.com/m1stadev/PyIMG4"
LICENSE="MIT"
SLOT="0"
KEYWORDS="~amd64 ~arm64 ~x86"
IUSE=""
KEYWORDS="amd64 arm64 x86"
RDEPEND=">=dev-python/asn1-2.7.0[${PYTHON_USEDEP}]
>=dev-python/click-8.1.7[${PYTHON_USEDEP}]

View file

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<maintainer type="person">
<email>unknown@pentoo.ch</email>
<name>Author Unknown</name>
</maintainer>
<upstream>
<remote-id type="github">ydkhatri/pyliblzfse</remote-id>
<remote-id type="pypi">pyliblzfse</remote-id>
</upstream>
</pkgmetadata>

View file

@ -14,9 +14,7 @@ HOMEPAGE="https://github.com/ydkhatri/pyliblzfse"
LICENSE="MIT"
SLOT="0"
KEYWORDS="amd64 ~arm64 x86"
IUSE=""
KEYWORDS="amd64 arm64 x86"
RDEPEND=""
DEPEND="${RDEPEND}"
REQUIRED_USE="${PYTHON_REQUIRED_USE}"

View file

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<maintainer type="person">
<email>unknown@pentoo.ch</email>
<name>Author Unknown</name>
</maintainer>
<upstream>
<remote-id type="pypi">pylzss</remote-id>
</upstream>
</pkgmetadata>

View file

@ -14,9 +14,7 @@ HOMEPAGE="https://pypi.org/project/pylzss/"
LICENSE="GPL-3"
SLOT="0"
KEYWORDS="amd64 ~arm64 x86"
IUSE=""
KEYWORDS="amd64 arm64 x86"
RDEPEND=""
DEPEND="${RDEPEND}"
REQUIRED_USE="${PYTHON_REQUIRED_USE}"