Gentoo Archives: gentoo-commits

From: "Michał Górny" <mgorny@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-python/pymongo/
Date: Fri, 31 Jul 2020 06:21:17
Message-Id: 1596176464.7f3c3659de493ddcdac269c811ef2c87ee6fc237.mgorny@gentoo
1 commit: 7f3c3659de493ddcdac269c811ef2c87ee6fc237
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Fri Jul 31 05:50:42 2020 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Fri Jul 31 06:21:04 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7f3c3659
7
8 dev-python/pymongo: Bump to 3.11.0
9
10 Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
11
12 dev-python/pymongo/Manifest | 1 +
13 dev-python/pymongo/pymongo-3.11.0.ebuild | 112 +++++++++++++++++++++++++++++++
14 2 files changed, 113 insertions(+)
15
16 diff --git a/dev-python/pymongo/Manifest b/dev-python/pymongo/Manifest
17 index 4dc1c029ef9..6f8dcf99ef1 100644
18 --- a/dev-python/pymongo/Manifest
19 +++ b/dev-python/pymongo/Manifest
20 @@ -1 +1,2 @@
21 DIST pymongo-3.10.1.tar.gz 715892 BLAKE2B df1f8ae34366ea9de633be7e1ca103a2bc704a18a9b23cb1fbdbc8d116e939d4d5462e18a076149d93dcb8ada9f4737ed2d61b08803b546dce89dca4b2416689 SHA512 5a73ac17ef6f6783a573facd90879dbefa0c95d69123bc67c1a6af0987cb5786f637b8fa81a6810387acc34829a4cde33b848ac0f7b08f7d07faa90a8e13b595
22 +DIST pymongo-3.11.0.tar.gz 771691 BLAKE2B 5ae5b78caac335656c1005666c5633882da517c512bbfdb0df2c4569ec5060fa9623a23f48ffcf0c6ab2cdc69f6534f36ef18c929047bbb22cfbe9055a0881b7 SHA512 4f8a185013cbb3c07774d3c6aecc9e97dabb4ba55176fa8a51e17bcdb7cbbebaacd16304e580b4c6aeb26aad964401249313b59dde3c5c248c4496d64d18b22c
23
24 diff --git a/dev-python/pymongo/pymongo-3.11.0.ebuild b/dev-python/pymongo/pymongo-3.11.0.ebuild
25 new file mode 100644
26 index 00000000000..9c6cc95462f
27 --- /dev/null
28 +++ b/dev-python/pymongo/pymongo-3.11.0.ebuild
29 @@ -0,0 +1,112 @@
30 +# Copyright 1999-2020 Gentoo Authors
31 +# Distributed under the terms of the GNU General Public License v2
32 +
33 +EAPI=7
34 +
35 +PYTHON_COMPAT=( python2_7 python3_{6..9} )
36 +inherit check-reqs distutils-r1
37 +
38 +DESCRIPTION="Python driver for MongoDB"
39 +HOMEPAGE="https://github.com/mongodb/mongo-python-driver https://pypi.org/project/pymongo/"
40 +SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
41 +
42 +LICENSE="Apache-2.0"
43 +SLOT="0"
44 +KEYWORDS="~amd64 ~arm64 ~hppa ~x86"
45 +IUSE="doc kerberos test"
46 +RESTRICT="!test? ( test )"
47 +
48 +RDEPEND="
49 + kerberos? ( dev-python/pykerberos[${PYTHON_USEDEP}] )
50 +"
51 +BDEPEND="
52 + test? (
53 + >=dev-db/mongodb-2.6.0
54 + dev-python/nose[${PYTHON_USEDEP}]
55 + )
56 +"
57 +DISTUTILS_IN_SOURCE_BUILD=1
58 +
59 +distutils_enable_sphinx doc
60 +
61 +reqcheck() {
62 + if use test; then
63 + # During the tests, database size reaches 1.5G.
64 + local CHECKREQS_DISK_BUILD=1536M
65 +
66 + check-reqs_${1}
67 + fi
68 +}
69 +
70 +pkg_pretend() {
71 + reqcheck pkg_pretend
72 +}
73 +
74 +pkg_setup() {
75 + reqcheck pkg_setup
76 +}
77 +
78 +src_prepare() {
79 + # network-sandbox probably
80 + rm test/test_srv_polling.py || die
81 + sed -e 's:test_connection_timeout_ms_propagates_to_DNS_resolver:_&:' \
82 + -i test/test_client.py || die
83 + # relies on exact exception message
84 + sed -e 's:abstract methods:abstract:' \
85 + -i test/test_custom_types.py || die
86 + distutils-r1_src_prepare
87 +}
88 +
89 +python_test() {
90 + # Yes, we need TCP/IP for that...
91 + local DB_IP=127.0.0.1
92 + local DB_PORT=27000
93 +
94 + export DB_IP DB_PORT
95 +
96 + local dbpath=${TMPDIR}/mongo.db
97 + local logpath=${TMPDIR}/mongod.log
98 +
99 + # Now, the hard part: we need to find a free port for mongod.
100 + # We're just trying to run it random port numbers and check the log
101 + # for bind errors. It shall be noted that 'mongod --fork' does not
102 + # return failure when it fails to bind.
103 +
104 + mkdir -p "${dbpath}" || die
105 + while true; do
106 + ebegin "Trying to start mongod on port ${DB_PORT}"
107 +
108 + LC_ALL=C \
109 + mongod --dbpath "${dbpath}" --nojournal \
110 + --bind_ip ${DB_IP} --port ${DB_PORT} \
111 + --unixSocketPrefix "${TMPDIR}" \
112 + --logpath "${logpath}" --fork \
113 + && sleep 2
114 +
115 + # Now we need to check if the server actually started...
116 + if [[ ${?} -eq 0 && -S "${TMPDIR}"/mongodb-${DB_PORT}.sock ]]; then
117 + # yay!
118 + eend 0
119 + break
120 + elif grep -q 'Address already in use' "${logpath}"; then
121 + # ay, someone took our port!
122 + eend 1
123 + : $(( DB_PORT += 1 ))
124 + continue
125 + else
126 + eend 1
127 + eerror "Unable to start mongod for tests. See the server log:"
128 + eerror " ${logpath}"
129 + die "Unable to start mongod for tests."
130 + fi
131 + done
132 +
133 + local failed
134 + DB_PORT2=$(( DB_PORT + 1 )) DB_PORT3=$(( DB_PORT + 2 )) esetup.py test || failed=1
135 +
136 + mongod --dbpath "${dbpath}" --shutdown || die
137 +
138 + [[ ${failed} ]] && die "Tests fail with ${EPYTHON}"
139 +
140 + rm -rf "${dbpath}" || die
141 +}