1 |
commit: 55ad2c470cdb16e51311882f641f41c808f9f86e |
2 |
Author: Michał Górny <mgorny <AT> gentoo <DOT> org> |
3 |
AuthorDate: Tue Apr 5 07:01:42 2022 +0000 |
4 |
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org> |
5 |
CommitDate: Tue Apr 5 07:52:55 2022 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=55ad2c47 |
7 |
|
8 |
dev-python/pymongo: Bump to 4.1.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-4.1.0.ebuild | 117 ++++++++++++++++++++++++++++++++ |
14 |
2 files changed, 118 insertions(+) |
15 |
|
16 |
diff --git a/dev-python/pymongo/Manifest b/dev-python/pymongo/Manifest |
17 |
index f242f4cc2a25..c3403015f705 100644 |
18 |
--- a/dev-python/pymongo/Manifest |
19 |
+++ b/dev-python/pymongo/Manifest |
20 |
@@ -1,2 +1,3 @@ |
21 |
DIST mongo-python-driver-4.0.1.tar.gz 1030722 BLAKE2B b820901a433ffa2e82db0ef3c014aaa1e7d53bbc3ab94a5432fcb713d9789cbbf411a4ad5085ef3896cbf2aeff6d0e79f3f7bd5936d3aa615080a0421d8818c2 SHA512 1aead66d21c032e6d42b3aa408b0193bcac6a5a293ecfc513fadb634c574dccdcd351c693352f23cfe577c73fec901cdc2aa635dfe9afe8d9108ed917f55b53b |
22 |
DIST mongo-python-driver-4.0.2.tar.gz 1027101 BLAKE2B d95eea08e09101f1db5df5dcbd5d843273ebd0c63b228420748a1663620ea18e05853372e876abc8b6480238de2b035c4e5a3c9f9b7c206228870a66e5d5f053 SHA512 eacb24d110de645a70b16b4d11f7a6b019f741fba2222f8ecee47d9f638fd71e579d3a46f5f539bc89d1ea53ddf0b72745b667a0f05479bb4b53ed72fb075b5b |
23 |
+DIST mongo-python-driver-4.1.0.tar.gz 1069416 BLAKE2B ea7d81e405f4db4ec0e03591909541f5452f516d359e42fc6fde74435899353f4718b7dbfe3dc1802e79c9277fcfe6203ecd33a5e2ad2682c604b9de44c46c7c SHA512 558d321a335742fc3399e9f5cb4917605353f55a1912f9fa34ac46f6107ed6522f952dc9ef584f4cbe1ffcfc600b49963a4bdf606146c38b94379bbb6a382202 |
24 |
|
25 |
diff --git a/dev-python/pymongo/pymongo-4.1.0.ebuild b/dev-python/pymongo/pymongo-4.1.0.ebuild |
26 |
new file mode 100644 |
27 |
index 000000000000..0a91e8ab7cdf |
28 |
--- /dev/null |
29 |
+++ b/dev-python/pymongo/pymongo-4.1.0.ebuild |
30 |
@@ -0,0 +1,117 @@ |
31 |
+# Copyright 1999-2022 Gentoo Authors |
32 |
+# Distributed under the terms of the GNU General Public License v2 |
33 |
+ |
34 |
+EAPI=8 |
35 |
+ |
36 |
+DISTUTILS_USE_PEP517=setuptools |
37 |
+PYTHON_COMPAT=( python3_{8..10} ) |
38 |
+ |
39 |
+inherit check-reqs distutils-r1 |
40 |
+ |
41 |
+MY_P=mongo-python-driver-${PV} |
42 |
+DESCRIPTION="Python driver for MongoDB" |
43 |
+HOMEPAGE="https://github.com/mongodb/mongo-python-driver https://pypi.org/project/pymongo/" |
44 |
+SRC_URI=" |
45 |
+ https://github.com/mongodb/mongo-python-driver/archive/${PV}.tar.gz |
46 |
+ -> ${MY_P}.tar.gz" |
47 |
+S=${WORKDIR}/${MY_P} |
48 |
+ |
49 |
+LICENSE="Apache-2.0" |
50 |
+SLOT="0" |
51 |
+KEYWORDS="~amd64 ~arm64 ~hppa ~riscv ~x86" |
52 |
+IUSE="doc kerberos" |
53 |
+ |
54 |
+RDEPEND=" |
55 |
+ kerberos? ( dev-python/pykerberos[${PYTHON_USEDEP}] ) |
56 |
+" |
57 |
+BDEPEND=" |
58 |
+ test? ( |
59 |
+ >=dev-db/mongodb-2.6.0 |
60 |
+ ) |
61 |
+" |
62 |
+ |
63 |
+distutils_enable_sphinx doc |
64 |
+distutils_enable_tests unittest |
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 |
85 |
+ rm test/test_srv_polling.py || die |
86 |
+ sed -e 's:test_connection_timeout_ms_propagates_to_DNS_resolver:_&:' \ |
87 |
+ -e 's:test_service_name_from_kwargs:_&:' \ |
88 |
+ -e 's:test_srv_max_hosts_kwarg:_&:' \ |
89 |
+ -i test/test_client.py || die |
90 |
+ sed -e '/SRV_SCHEME/s:_HAVE_DNSPYTHON:False:' \ |
91 |
+ -i test/test_uri_spec.py || die |
92 |
+ distutils-r1_src_prepare |
93 |
+} |
94 |
+ |
95 |
+python_test() { |
96 |
+ # Yes, we need TCP/IP for that... |
97 |
+ local DB_IP=127.0.0.1 |
98 |
+ local DB_PORT=27000 |
99 |
+ |
100 |
+ export DB_IP DB_PORT |
101 |
+ |
102 |
+ local dbpath=${TMPDIR}/mongo.db |
103 |
+ local logpath=${TMPDIR}/mongod.log |
104 |
+ |
105 |
+ # Now, the hard part: we need to find a free port for mongod. |
106 |
+ # We're just trying to run it random port numbers and check the log |
107 |
+ # for bind errors. It shall be noted that 'mongod --fork' does not |
108 |
+ # return failure when it fails to bind. |
109 |
+ |
110 |
+ mkdir -p "${dbpath}" || die |
111 |
+ while true; do |
112 |
+ ebegin "Trying to start mongod on port ${DB_PORT}" |
113 |
+ |
114 |
+ LC_ALL=C \ |
115 |
+ mongod --dbpath "${dbpath}" --nojournal \ |
116 |
+ --bind_ip ${DB_IP} --port ${DB_PORT} \ |
117 |
+ --unixSocketPrefix "${TMPDIR}" \ |
118 |
+ --logpath "${logpath}" --fork \ |
119 |
+ && sleep 2 |
120 |
+ |
121 |
+ # Now we need to check if the server actually started... |
122 |
+ if [[ ${?} -eq 0 && -S "${TMPDIR}"/mongodb-${DB_PORT}.sock ]]; then |
123 |
+ # yay! |
124 |
+ eend 0 |
125 |
+ break |
126 |
+ elif grep -q 'Address already in use' "${logpath}"; then |
127 |
+ # ay, someone took our port! |
128 |
+ eend 1 |
129 |
+ : $(( DB_PORT += 1 )) |
130 |
+ continue |
131 |
+ else |
132 |
+ eend 1 |
133 |
+ eerror "Unable to start mongod for tests. See the server log:" |
134 |
+ eerror " ${logpath}" |
135 |
+ die "Unable to start mongod for tests." |
136 |
+ fi |
137 |
+ done |
138 |
+ |
139 |
+ local failed |
140 |
+ DB_PORT2=$(( DB_PORT + 1 )) DB_PORT3=$(( DB_PORT + 2 )) esetup.py test || failed=1 |
141 |
+ |
142 |
+ mongod --dbpath "${dbpath}" --shutdown || die |
143 |
+ |
144 |
+ [[ ${failed} ]] && die "Tests fail with ${EPYTHON}" |
145 |
+ |
146 |
+ rm -rf "${dbpath}" || die |
147 |
+} |