sqlalchemy: python 3_12

This commit is contained in:
Anton Bolshakov 2023-12-03 13:57:04 +08:00
parent 8018c5e0ef
commit 1ff6a028eb
No known key found for this signature in database
GPG key ID: 32BDCED870788F04
12 changed files with 339 additions and 0 deletions

View file

@ -0,0 +1,2 @@
DIST future-0.18.3-tests.patch.xz 2736 BLAKE2B 55f9f233fb65f006d2055adf8b5d5b3ab00b4cd9b9f5a78d09b3fa2c1e347ef2d8370569fa5374968bf3e84b4fcbc220ad8da1cc2b32da57c46d36050ba1440a SHA512 c18434bc6efe88381aed8c86ed494352a2749c5680a52f62ae043bec70e3adb0163f91a971daa04134508d59172fe2e71ebbf694a74afce060b7fa1e7c385810
DIST future-0.18.3.tar.gz 840896 BLAKE2B 13172c639b0eee80581133a2d46b9fa3a38fb9c47ea6eecc8f0715782536be5965bbd153d6a6dda49d8fa9cfea29231c6cc60a4b3b3a6c0cc5406f02c494a425 SHA512 6de56a5aa5c5dd56a0dc5a6732c753530f9868036bd97e9d355f9ee6e1305e266a60c167de779cba93f09b5b3fae615193074caba2afe857ca7ea944532ef910

View file

@ -0,0 +1,29 @@
From ca1362a4250b7124d9ae03506eb80a767f06e282 Mon Sep 17 00:00:00 2001
From: Arthur Zamarin <arthurzam@gentoo.org>
Date: Fri, 20 Aug 2021 10:15:59 +0300
Subject: [PATCH] Fix for Python3.10
Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
---
src/future/moves/test/support.py | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/src/future/moves/test/support.py b/src/future/moves/test/support.py
index e9aa0f4..4ae2ffd 100644
--- a/src/future/moves/test/support.py
+++ b/src/future/moves/test/support.py
@@ -3,6 +3,11 @@ from future.standard_library import suspend_hooks
from future.utils import PY3
if PY3:
+ try:
+ from test.support.os_helper import *
+ from test.support.warnings_helper import *
+ except ImportError:
+ pass
from test.support import *
else:
__future_module__ = True
--
2.33.0

View file

@ -0,0 +1,22 @@
diff --git a/tests/test_future/test_urllib_toplevel.py b/tests/test_future/test_urllib_toplevel.py
index 68bc4c9..923b2e8 100644
--- a/tests/test_future/test_urllib_toplevel.py
+++ b/tests/test_future/test_urllib_toplevel.py
@@ -120,7 +120,7 @@ class urlopen_FileTests(unittest.TestCase):
finally:
f.close()
self.pathname = support.TESTFN
- self.returned_obj = urlopen("file:%s" % self.pathname)
+ self.returned_obj = urlopen("file:%s" % urllib_parse.quote(self.pathname))
def tearDown(self):
"""Shut down the open object"""
@@ -167,7 +167,7 @@ class urlopen_FileTests(unittest.TestCase):
self.assertIsInstance(self.returned_obj.info(), email_message.Message)
def test_geturl(self):
- self.assertEqual(self.returned_obj.geturl(), self.pathname)
+ self.assertEqual(self.returned_obj.geturl(), urllib_parse.quote(self.pathname))
def test_getcode(self):
self.assertIsNone(self.returned_obj.getcode())

View file

@ -0,0 +1,65 @@
From edda349a2d4fffa6c7f277483ccb40a66c0795b9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= <miro@hroncok.cz>
Date: Mon, 10 Feb 2020 23:17:28 +0100
Subject: [PATCH] Test fixes for Python 3.9
Fixes https://github.com/PythonCharmers/python-future/issues/540
Fixes https://github.com/PythonCharmers/python-future/issues/541
---
src/future/moves/_dummy_thread.py | 2 +-
src/future/standard_library/__init__.py | 2 +-
tests/test_future/test_standard_library.py | 1 -
tests/test_future/test_urllib_toplevel.py | 2 --
4 files changed, 2 insertions(+), 5 deletions(-)
diff --git a/src/future/moves/_dummy_thread.py b/src/future/moves/_dummy_thread.py
index 688d249b..cc2fc891 100644
--- a/src/future/moves/_dummy_thread.py
+++ b/src/future/moves/_dummy_thread.py
@@ -2,7 +2,7 @@
from future.utils import PY3
if PY3:
- from _dummy_thread import *
+ from _thread import *
else:
__future_module__ = True
from dummy_thread import *
diff --git a/src/future/standard_library/__init__.py b/src/future/standard_library/__init__.py
index cff02f95..3e8da8a6 100644
--- a/src/future/standard_library/__init__.py
+++ b/src/future/standard_library/__init__.py
@@ -125,7 +125,7 @@
# 'Tkinter': 'tkinter',
'_winreg': 'winreg',
'thread': '_thread',
- 'dummy_thread': '_dummy_thread',
+ 'dummy_thread': '_thread',
# 'anydbm': 'dbm', # causes infinite import loop
# 'whichdb': 'dbm', # causes infinite import loop
# anydbm and whichdb are handled by fix_imports2
diff --git a/tests/test_future/test_standard_library.py b/tests/test_future/test_standard_library.py
index 3ac5d2d7..8ab27a27 100644
--- a/tests/test_future/test_standard_library.py
+++ b/tests/test_future/test_standard_library.py
@@ -422,7 +422,6 @@ def test_urllib_imports_install_hooks(self):
def test_underscore_prefixed_modules(self):
import _thread
- import _dummy_thread
import _markupbase
self.assertTrue(True)
diff --git a/tests/test_future/test_urllib_toplevel.py b/tests/test_future/test_urllib_toplevel.py
index 11e77201..25f4ca82 100644
--- a/tests/test_future/test_urllib_toplevel.py
+++ b/tests/test_future/test_urllib_toplevel.py
@@ -781,8 +781,6 @@ def test_unquoting(self):
"%s" % result)
self.assertRaises((TypeError, AttributeError), urllib_parse.unquote, None)
self.assertRaises((TypeError, AttributeError), urllib_parse.unquote, ())
- with support.check_warnings(('', BytesWarning), quiet=True):
- self.assertRaises((TypeError, AttributeError), urllib_parse.unquote, bytes(b''))
def test_unquoting_badpercent(self):
# Test unquoting on bad percent-escapes

View file

@ -0,0 +1,46 @@
# Copyright 1999-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
DISTUTILS_USE_PEP517=setuptools
PYTHON_COMPAT=( python3_{9..12} pypy3 )
inherit distutils-r1 pypi
DESCRIPTION="Easy, clean, reliable Python 2/3 compatibility"
HOMEPAGE="
https://python-future.org/
https://github.com/PythonCharmers/python-future/
https://pypi.org/project/future/
"
SRC_URI+=" https://dev.gentoo.org/~sam/distfiles/${CATEGORY}/${PN}/${PN}-0.18.3-tests.patch.xz"
LICENSE="MIT"
SLOT="0"
KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux"
BDEPEND="
test? (
$(python_gen_cond_dep '
dev-python/numpy[${PYTHON_USEDEP}]
' 'python*')
)
"
PATCHES=(
"${WORKDIR}"/${PN}-0.18.3-tests.patch
"${FILESDIR}"/${PN}-0.18.2-py39.patch
"${FILESDIR}"/${PN}-0.18.2-py39-fileurl.patch
"${FILESDIR}"/${PN}-0.18.2-py3.10.patch
)
EPYTEST_DESELECT=(
# tests requiring network access
tests/test_future/test_requests.py
tests/test_future/test_standard_library.py::TestStandardLibraryReorganization::test_moves_urllib_request_http
tests/test_future/test_standard_library.py::TestStandardLibraryReorganization::test_urllib_request_http
)
distutils_enable_tests pytest
distutils_enable_sphinx docs dev-python/sphinx-bootstrap-theme

View file

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<maintainer type="project">
<email>python@gentoo.org</email>
<name>Python</name>
</maintainer>
<stabilize-allarches/>
<upstream>
<remote-id type="pypi">future</remote-id>
<remote-id type="github">PythonCharmers/python-future</remote-id>
</upstream>
</pkgmetadata>

View file

@ -0,0 +1 @@
DIST ldap3-2.9.1.tar.gz 974013 BLAKE2B a75219403e68705b10c06e692f4f188575a4ae38c86f15ceb6d2c674e74ac44ce0f53e3ec6bf66e8413007589293e2db95497de7b0317066b36105940beb11bf SHA512 bf07ebca9a53a8c225bc3106d3bd45eb26557c6e5a3d6d45a7f8c149d938ad43825eed0d406a57b93e2e675ed7aa262828f022ab82eb683f0e3029e3ad823106

View file

@ -0,0 +1,23 @@
# Copyright 1999-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
DISTUTILS_USE_PEP517=setuptools
PYTHON_COMPAT=( python3_{9..12} pypy3 )
inherit distutils-r1
DESCRIPTION="A strictly RFC 4511 conforming LDAP V3 pure Python client"
HOMEPAGE="
https://github.com/cannatag/ldap3/
https://pypi.org/project/ldap3/"
SRC_URI="https://github.com/cannatag/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
LICENSE="LGPL-3"
SLOT="0"
KEYWORDS="amd64 ~arm64 ~ppc64 ~riscv x86"
# tests require a ldap server and extra configuration
RESTRICT="test"
RDEPEND=">=dev-python/pyasn1-0.4.8[${PYTHON_USEDEP}]"

View file

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<maintainer type="project">
<email>python@gentoo.org</email>
<name>Python</name>
</maintainer>
<longdescription lang="en">
ldap3 is a strictly RFC 4511 conforming LDAP V3 pure Python client. The same codebase works with Python, Python 3, PyPy and PyPy3.
This project was formerly named python3-ldap. The name has been changed to avoid confusion with the python-ldap library.
</longdescription>
<stabilize-allarches/>
<upstream>
<remote-id type="pypi">ldap3</remote-id>
<remote-id type="github">cannatag/ldap3</remote-id>
</upstream>
</pkgmetadata>

View file

@ -0,0 +1 @@
DIST SQLAlchemy-1.4.50.tar.gz 8517526 BLAKE2B 835ed762b2b399167c9eb52400689619db33d30431241bfb0410a79d0e34104aec972e883c4159f9a69a754a60e1daffc6256ba74f02bc7dabf994c6752c8ae1 SHA512 d484c2673e67b0c45f05d2af20f930f274ea8e83ca41e2bd1c08723f564af58424b78be2ee507612fec6fc095dc215f75f52dfad68a98bcbf1774e150d956a29

View file

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<maintainer type="project">
<email>python@gentoo.org</email>
<name>Python</name>
</maintainer>
<upstream>
<remote-id type="pypi">SQLAlchemy</remote-id>
<remote-id type="github">sqlalchemy/sqlalchemy</remote-id>
<bugs-to>https://github.com/sqlalchemy/sqlalchemy/issues</bugs-to>
</upstream>
</pkgmetadata>

View file

@ -0,0 +1,107 @@
# Copyright 1999-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
DISTUTILS_EXT=1
DISTUTILS_USE_PEP517=setuptools
PYTHON_COMPAT=( pypy3 python3_{10..12} )
PYTHON_REQ_USE="sqlite?"
inherit distutils-r1 optfeature pypi
MY_PN="SQLAlchemy"
DESCRIPTION="Python SQL toolkit and Object Relational Mapper"
HOMEPAGE="
https://www.sqlalchemy.org/
https://pypi.org/project/SQLAlchemy/
https://github.com/sqlalchemy/sqlalchemy/
"
SRC_URI="$(pypi_sdist_url --no-normalize "${MY_PN}")"
S="${WORKDIR}/${MY_PN}-${PV}"
LICENSE="MIT"
SLOT="0"
KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~loong ~m68k ~mips ~ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x64-solaris"
IUSE="examples +sqlite test"
BDEPEND="
test? (
$(python_gen_impl_dep sqlite)
)
"
distutils_enable_tests pytest
EPYTEST_IGNORE=(
# hardcode call counts specific to Python versions
test/aaa_profiling
)
src_prepare() {
sed -i -e '/greenlet/d' setup.cfg || die
distutils-r1_src_prepare
}
python_test() {
local EPYTEST_DESELECT=(
# warning tests are unreliable
test/base/test_warnings.py
# TODO
'test/orm/test_cache_key.py::EmbeddedSubqTest::test_cache_key_gen[memory-_exclusions1]'
# deprecations
test/engine/test_parseconnect.py::TestRegNewDBAPI::test_wrapper_hooks
test/engine/test_parseconnect.py::URLTest::test_component_set
test/engine/test_parseconnect.py::URLTest::test_password_custom_obj
test/engine/test_parseconnect.py::URLTest::test_update_query_dict
test/engine/test_parseconnect.py::URLTest::test_update_query_string
)
local sqlite_version=$(sqlite3 --version | cut -d' ' -f1)
[[ ${EPYTHON} == pypy3 ]] && EPYTEST_DESELECT+=(
test/ext/test_associationproxy.py::ProxyHybridTest::test_msg_fails_on_cls_access
# https://github.com/sqlalchemy/sqlalchemy/issues/8762
test/orm/test_query.py::YieldTest_sqlite+pysqlite_${sqlite_version//./_}::test_yield_per_close_on_interrupted_iteration_legacy
)
if ! has_version "dev-python/greenlet[${PYTHON_USEDEP}]"; then
EPYTEST_DESELECT+=(
test/ext/asyncio/test_engine_py3k.py::TextSyncDBAPI::test_sync_driver_execution
test/ext/asyncio/test_engine_py3k.py::TextSyncDBAPI::test_sync_driver_run_sync
"test/engine/test_pool.py::PoolEventsTest::test_checkin_event_gc[False-True]"
"test/engine/test_pool.py::PoolEventsTest::test_checkin_event_gc[True-True]"
"test/engine/test_pool.py::QueuePoolTest::test_userspace_disconnectionerror_weakref_finalizer[True-_exclusions0]"
)
fi
# upstream's test suite is horribly hacky; it relies on disabling
# the warnings plugin and turning warnings into errors; this also
# means that any DeprecationWarnings from third-party plugins cause
# everything to explode
local -x PYTEST_DISABLE_PLUGIN_AUTOLOAD=1
local -x PYTEST_PLUGINS=
# upstream automagically depends on xdist when it is importable
# note that we can't use xdist because it causes nodes to randomly
# crash on init
if has_version "dev-python/pytest-xdist[${PYTHON_USEDEP}]"; then
PYTEST_PLUGINS+=xdist.plugin
fi
epytest
}
python_install_all() {
if use examples; then
docompress -x "/usr/share/doc/${PF}/examples"
dodoc -r examples
fi
distutils-r1_python_install_all
}
pkg_postinst() {
optfeature "asyncio support" dev-python/greenlet
optfeature "MySQL support" \
dev-python/mysqlclient \
dev-python/pymysql
optfeature "postgresql support" dev-python/psycopg:2
}