sys-process/glances: 3.1.4.1-r1 amd64 stable, bug #720368
[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="https://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 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 BDEPEND="
26         test? (
27                 dev-python/mock[${PYTHON_USEDEP}]
28                 dev-python/pytest-xdist[${PYTHON_USEDEP}]
29         )
30 "
31
32 S="${WORKDIR}/${MY_P}"
33
34 distutils_enable_tests pytest
35
36 python_prepare_all() {
37         local PATCHES=(
38                 "${FILESDIR}"/sqlalchemy-pytest-deprecation.patch
39         )
40         # Disable tests hardcoding function call counts specific to Python versions.
41         rm -r test/aaa_profiling || die
42         distutils-r1_python_prepare_all
43 }
44
45 python_compile() {
46         if ! python_is_python3; then
47                 local CFLAGS=${CFLAGS}
48                 append-cflags -fno-strict-aliasing
49         fi
50         distutils-r1_python_compile
51 }
52
53 python_install_all() {
54         use doc && HTML_DOCS=( doc/. )
55         use examples && dodoc -r examples
56
57         distutils-r1_python_install_all
58 }
59
60 pkg_postinst() {
61         optfeature "MySQL support" dev-python/mysql-python dev-python/mysql-connector-python
62         optfeature "mssql support" dev-python/pymssql
63         optfeature "postgresql support" dev-python/psycopg:2
64 }