1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
6 PYTHON_COMPAT=( python2_7 python3_{6,7,8} pypy3 )
7 PYTHON_REQ_USE="sqlite?"
9 inherit distutils-r1 eutils flag-o-matic
12 MY_P="${MY_PN}-${PV/_beta/b}"
14 DESCRIPTION="Python SQL toolkit and Object Relational Mapper"
15 HOMEPAGE="http://www.sqlalchemy.org/ https://pypi.org/project/SQLAlchemy/"
16 SRC_URI="mirror://pypi/${MY_P:0:1}/${MY_PN}/${MY_P}.tar.gz"
20 KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~x64-solaris"
21 IUSE="doc examples +sqlite test"
23 REQUIRED_USE="test? ( sqlite )"
26 dev-python/setuptools[${PYTHON_USEDEP}]
27 test? ( dev-python/mock[${PYTHON_USEDEP}] )"
29 S="${WORKDIR}/${MY_P}"
31 distutils_enable_tests pytest
33 python_prepare_all() {
34 # Disable tests hardcoding function call counts specific to Python versions.
35 rm -r test/aaa_profiling || die
36 distutils-r1_python_prepare_all
40 if ! python_is_python3; then
41 local CFLAGS=${CFLAGS}
42 append-cflags -fno-strict-aliasing
44 distutils-r1_python_compile
47 python_install_all() {
48 use doc && HTML_DOCS=( doc/. )
49 use examples && dodoc -r examples
51 distutils-r1_python_install_all
55 optfeature "MySQL support" dev-python/mysql-python dev-python/mysql-connector-python
56 optfeature "mssql support" dev-python/pymssql
57 optfeature "postgresql support" dev-python/psycopg:2