*/*: Clean PYTHON_COMPAT of obsolete impls
[gentoo.git] / dev-python / sqlalchemy / sqlalchemy-1.3.11.ebuild
1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=7
5
6 PYTHON_COMPAT=( python2_7 python3_{6,7,8} pypy3 )
7 PYTHON_REQ_USE="sqlite?"
8
9 inherit distutils-r1 eutils flag-o-matic
10
11 MY_PN="SQLAlchemy"
12 MY_P="${MY_PN}-${PV/_beta/b}"
13
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"
17
18 LICENSE="MIT"
19 SLOT="0"
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"
22
23 REQUIRED_USE="test? ( sqlite )"
24
25 DEPEND="
26         dev-python/setuptools[${PYTHON_USEDEP}]
27         test? ( dev-python/mock[${PYTHON_USEDEP}] )"
28
29 S="${WORKDIR}/${MY_P}"
30
31 distutils_enable_tests pytest
32
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
37 }
38
39 python_compile() {
40         if ! python_is_python3; then
41                 local CFLAGS=${CFLAGS}
42                 append-cflags -fno-strict-aliasing
43         fi
44         distutils-r1_python_compile
45 }
46
47 python_install_all() {
48         use doc && HTML_DOCS=( doc/. )
49         use examples && dodoc -r examples
50
51         distutils-r1_python_install_all
52 }
53
54 pkg_postinst() {
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
58 }