summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam James <sam@gentoo.org>2021-12-08 00:35:08 +0000
committerSam James <sam@gentoo.org>2021-12-08 00:39:13 +0000
commit20edee675a7688b6c022160112a098a0fe828b0d (patch)
tree04db4b9c6088dd79c8faf05a010cf71376865f20 /dev-python/sqlalchemy
parentmedia-libs/netpbm: fix compilation with hardened clang (diff)
downloadgentoo-20edee675a7688b6c022160112a098a0fe828b0d.tar.gz
gentoo-20edee675a7688b6c022160112a098a0fe828b0d.tar.bz2
gentoo-20edee675a7688b6c022160112a098a0fe828b0d.zip
dev-python/sqlalchemy: disable greenlet dependency conditionally
We should try pull it in on arches where it's possible but we shouldn't hard require it given most things work fine without it. Some applications do need it though, so do this conditionally so they can depend on it rather than ending up being broken by depcleans or requiring people to put it in world files. Closes: https://bugs.gentoo.org/828482 Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'dev-python/sqlalchemy')
-rw-r--r--dev-python/sqlalchemy/files/sqlalchemy-1.4.27-drop-greenlet.patch49
-rw-r--r--dev-python/sqlalchemy/sqlalchemy-1.4.27-r3.ebuild (renamed from dev-python/sqlalchemy/sqlalchemy-1.4.27-r2.ebuild)12
2 files changed, 59 insertions, 2 deletions
diff --git a/dev-python/sqlalchemy/files/sqlalchemy-1.4.27-drop-greenlet.patch b/dev-python/sqlalchemy/files/sqlalchemy-1.4.27-drop-greenlet.patch
new file mode 100644
index 000000000000..07184b843c9e
--- /dev/null
+++ b/dev-python/sqlalchemy/files/sqlalchemy-1.4.27-drop-greenlet.patch
@@ -0,0 +1,49 @@
+Not available on all arches we support and is only needed for
+a few consumers.
+
+https://bugs.gentoo.org/828482
+
+From: Sam James <sam@gentoo.org>
+Date: Wed, 8 Dec 2021 00:31:01 +0000
+Subject: [PATCH] Drop greenlet dependency
+
+--- a/setup.cfg
++++ b/setup.cfg
+@@ -36,11 +36,8 @@ package_dir =
+ =lib
+ install_requires =
+ importlib-metadata;python_version<"3.8"
+- greenlet != 0.4.17;python_version>='3' and (platform_machine=='aarch64' or (platform_machine=='ppc64le' or (platform_machine=='x86_64' or (platform_machine=='amd64' or (platform_machine=='AMD64' or (platform_machine=='win32' or platform_machine=='WIN32'))))))
+
+ [options.extras_require]
+-asyncio =
+- greenlet!=0.4.17;python_version>="3"
+ mypy =
+ mypy >= 0.910;python_version>="3"
+ sqlalchemy2-stubs
+diff --git a/setup.cfg b/setup.cfg
+index b7f69e9..91993f7 100644
+--- a/setup.cfg
++++ b/setup.cfg
+@@ -57,7 +57,6 @@ oracle =
+ postgresql = psycopg2>=2.7
+ postgresql_pg8000 = pg8000>=1.16.6
+ postgresql_asyncpg =
+- %(asyncio)s
+ asyncpg;python_version>="3"
+ postgresql_psycopg2binary = psycopg2-binary
+ postgresql_psycopg2cffi = psycopg2cffi
+@@ -65,13 +64,10 @@ pymysql =
+ pymysql;python_version>="3"
+ pymysql<1;python_version<"3"
+ aiomysql =
+- %(asyncio)s
+ aiomysql;python_version>="3"
+ asyncmy =
+- %(asyncio)s
+ asyncmy>=0.2.3;python_version>="3"
+ aiosqlite =
+- %(asyncio)s
+ aiosqlite;python_version>="3"
+ typing_extensions!=3.10.0.1
+ sqlcipher =
diff --git a/dev-python/sqlalchemy/sqlalchemy-1.4.27-r2.ebuild b/dev-python/sqlalchemy/sqlalchemy-1.4.27-r3.ebuild
index 24bcfe77ce84..21f126d011c4 100644
--- a/dev-python/sqlalchemy/sqlalchemy-1.4.27-r2.ebuild
+++ b/dev-python/sqlalchemy/sqlalchemy-1.4.27-r3.ebuild
@@ -19,10 +19,10 @@ S="${WORKDIR}/${MY_P}"
LICENSE="MIT"
SLOT="0"
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x64-solaris"
-IUSE="examples +sqlite test"
+IUSE="asyncio examples +sqlite test"
# greenlet for bug #823794
-RDEPEND="virtual/python-greenlet[${PYTHON_USEDEP}]"
+RDEPEND="asyncio? ( virtual/python-greenlet[${PYTHON_USEDEP}] )"
BDEPEND="
test? (
$(python_gen_impl_dep sqlite)
@@ -36,6 +36,14 @@ EPYTEST_IGNORE=(
test/aaa_profiling
)
+src_prepare() {
+ if ! use asyncio ; then
+ eapply "${FILESDIR}"/${PN}-1.4.27-drop-greenlet.patch
+ fi
+
+ distutils-r1_src_prepare
+}
+
python_install_all() {
if use examples; then
docompress -x "/usr/share/doc/${PF}/examples"