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