blob: 76ac562e5f73228f201a206197cb135b22c640f5 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
|
# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
PYTHON_COMPAT=( python3_{7,8,9,10,11} )
DISTUTILS_USE_PEP517=setuptools
DOCS_BUILDER="mkdocs"
DOCS_DEPEND="dev-python/mkdocs-material"
inherit databases distutils-r1 docs optfeature
DESCRIPTION="Async database support for Python"
HOMEPAGE="
https://www.encode.io/databases/
https://github.com/encode/databases
"
SRC_URI="https://github.com/encode/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz"
LICENSE="BSD"
SLOT="0"
KEYWORDS="~amd64 ~x86"
RDEPEND="<=dev-python/sqlalchemy-1.4.41[${PYTHON_USEDEP}]"
BDEPEND="test? (
dev-python/aiomysql[${PYTHON_USEDEP}]
dev-python/aiopg[${PYTHON_USEDEP}]
dev-python/aiosqlite[${PYTHON_USEDEP}]
dev-python/async-timeout[${PYTHON_USEDEP}]
dev-python/asyncmy[${PYTHON_USEDEP}]
dev-python/asyncpg[${PYTHON_USEDEP}]
dev-python/psycopg:2[${PYTHON_USEDEP}]
dev-python/pymysql[${PYTHON_USEDEP}]
dev-python/sqlalchemy[sqlite,${PYTHON_USEDEP}]
dev-python/starlette[${PYTHON_USEDEP}]
)"
distutils_enable_tests pytest
EEPYTEST_DESELECT=(
tests/test_connection_options.py::test_mysql_pool_size
tests/test_connection_options.py::test_mysql_explicit_pool_size
tests/test_connection_options.py::test_mysql_ssl
tests/test_connection_options.py::test_mysql_explicit_ssl
tests/test_connection_options.py::test_mysql_pool_recycle
tests/test_databases.py
tests/test_integration.py::test_integration
)
python_prepare_all() {
# fix tests
#sed -i -e '/databases.backends.mysql/d' tests/test_connection_options.py || die
distutils-r1_python_prepare_all
}
src_test() {
local databases=(
"sqlite:///testsuite"
"sqlite+aiosqlite:///testsuite"
"mysql://root@127.0.0.1:3333/testsuite"
"mysql+aiomysql://root@127.0.0.1:3333/testsuite"
"mysql+asyncmy://root@127.0.0.1:3333/testsuite"
"postgresql://postgres@127.0.0.1:65432/"
"postgresql+aiopg://postgres@127.0.0.1:65432/"
"postgresql+asyncpg://postgres@127.0.0.1:65432/"
)
local -x TEST_DATABASE_URLS=$(printf "%s," "${databases[@]}")
TEST_DATABASE_URLS=${TEST_DATABASE_URLS::-1}
emysql --start 3333
epostgres --start 65432
ebegin "Creating mysql database 'testsuite'"
mysql --user=root --socket=$(emysql --get-sockfile) --silent \
--execute="CREATE DATABASE testsuite;"
eend $? || emysql --die "Creating mysql database failed"
distutils-r1_src_test
emysql --stop
epostgres--stop
}
pkg_postinst() {
optfeature "fancy logs" dev-python/click
optfeature "mysql support" dev-python/pymysql
optfeature "mysql+aiomysql support" dev-python/aiomysql
optfeature "mysql+asyncmy support" dev-python/asyncmy
optfeature "postgresql support" dev-python/psycopg:2
optfeature "postgresql+asyncpg support" dev-python/asyncpg
optfeature "postgresql+aiopg support" dev-python/aiopg
optfeature "sqlite+aiosqlite support" dev-python/aiosqlite
}
|