diff options
Diffstat (limited to 'dev-python/pymongo')
-rw-r--r-- | dev-python/pymongo/Manifest | 2 | ||||
-rw-r--r-- | dev-python/pymongo/pymongo-4.0.2.ebuild | 117 |
2 files changed, 119 insertions, 0 deletions
diff --git a/dev-python/pymongo/Manifest b/dev-python/pymongo/Manifest index a21e84d6b847..c2f74e9dfa28 100644 --- a/dev-python/pymongo/Manifest +++ b/dev-python/pymongo/Manifest @@ -1,3 +1,5 @@ DIST mongo-python-driver-4.0.1.tar.gz 1030722 BLAKE2B b820901a433ffa2e82db0ef3c014aaa1e7d53bbc3ab94a5432fcb713d9789cbbf411a4ad5085ef3896cbf2aeff6d0e79f3f7bd5936d3aa615080a0421d8818c2 SHA512 1aead66d21c032e6d42b3aa408b0193bcac6a5a293ecfc513fadb634c574dccdcd351c693352f23cfe577c73fec901cdc2aa635dfe9afe8d9108ed917f55b53b +DIST mongo-python-driver-4.0.2.tar.gz 1027101 BLAKE2B d95eea08e09101f1db5df5dcbd5d843273ebd0c63b228420748a1663620ea18e05853372e876abc8b6480238de2b035c4e5a3c9f9b7c206228870a66e5d5f053 SHA512 eacb24d110de645a70b16b4d11f7a6b019f741fba2222f8ecee47d9f638fd71e579d3a46f5f539bc89d1ea53ddf0b72745b667a0f05479bb4b53ed72fb075b5b EBUILD pymongo-4.0.1.ebuild 2757 BLAKE2B 90fe6d42de8365992624e829541dcfbeda794a0730c2f78faa8a7d5b55e15a769ae1c05078828294ce3c5559a24a44253dda9f6fe6742f590bad274ce5fb60e7 SHA512 72cf6aaed3d38fc225210904be1335ecbbb5b5eb2940242bcfb3a7658bdcc9183faf8412042c2a68c68d658fe59e5b2fc683bf8e3cb0b8cfc35686dce027c0e9 +EBUILD pymongo-4.0.2.ebuild 2765 BLAKE2B 9e0daa5786bfcdd3997d91dc81d73edf1c3cce0c9e72a4e9e957940079b6c1d37c09f0ca9f52a02e7dd4cb36ca5ddcb0f36b8848b049dbb2f6727d44139e5230 SHA512 90c9917a2c760694bf8f82632a35c7a56974bb2a6e45d27677aacf5487ec4da55705bcf9cfe88935170bc25d69d820eba24834bc22857c2689acec1457ad2b1b MISC metadata.xml 673 BLAKE2B fb66f76592841f2647a94e24e07fafa8be2bc31583bac35dc3933a3feeea87f0c4105ab6b480bce5f2b8aeced8c113c8a3ce9714b22ff909f92eccceffa8f9a9 SHA512 9e758aa60153da583ed21bdf6addd001c560894fc6d429217405e7dfbdc673a9e22bc5a41afcc1281f7613ae1059c0824a7bba246006aa66c6eced75ab975e51 diff --git a/dev-python/pymongo/pymongo-4.0.2.ebuild b/dev-python/pymongo/pymongo-4.0.2.ebuild new file mode 100644 index 000000000000..0a91e8ab7cdf --- /dev/null +++ b/dev-python/pymongo/pymongo-4.0.2.ebuild @@ -0,0 +1,117 @@ +# Copyright 1999-2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +DISTUTILS_USE_PEP517=setuptools +PYTHON_COMPAT=( python3_{8..10} ) + +inherit check-reqs distutils-r1 + +MY_P=mongo-python-driver-${PV} +DESCRIPTION="Python driver for MongoDB" +HOMEPAGE="https://github.com/mongodb/mongo-python-driver https://pypi.org/project/pymongo/" +SRC_URI=" + https://github.com/mongodb/mongo-python-driver/archive/${PV}.tar.gz + -> ${MY_P}.tar.gz" +S=${WORKDIR}/${MY_P} + +LICENSE="Apache-2.0" +SLOT="0" +KEYWORDS="~amd64 ~arm64 ~hppa ~riscv ~x86" +IUSE="doc kerberos" + +RDEPEND=" + kerberos? ( dev-python/pykerberos[${PYTHON_USEDEP}] ) +" +BDEPEND=" + test? ( + >=dev-db/mongodb-2.6.0 + ) +" + +distutils_enable_sphinx doc +distutils_enable_tests unittest + +reqcheck() { + if use test; then + # During the tests, database size reaches 1.5G. + local CHECKREQS_DISK_BUILD=1536M + + check-reqs_${1} + fi +} + +pkg_pretend() { + reqcheck pkg_pretend +} + +pkg_setup() { + reqcheck pkg_setup +} + +src_prepare() { + # network-sandbox + rm test/test_srv_polling.py || die + sed -e 's:test_connection_timeout_ms_propagates_to_DNS_resolver:_&:' \ + -e 's:test_service_name_from_kwargs:_&:' \ + -e 's:test_srv_max_hosts_kwarg:_&:' \ + -i test/test_client.py || die + sed -e '/SRV_SCHEME/s:_HAVE_DNSPYTHON:False:' \ + -i test/test_uri_spec.py || die + distutils-r1_src_prepare +} + +python_test() { + # Yes, we need TCP/IP for that... + local DB_IP=127.0.0.1 + local DB_PORT=27000 + + export DB_IP DB_PORT + + local dbpath=${TMPDIR}/mongo.db + local logpath=${TMPDIR}/mongod.log + + # Now, the hard part: we need to find a free port for mongod. + # We're just trying to run it random port numbers and check the log + # for bind errors. It shall be noted that 'mongod --fork' does not + # return failure when it fails to bind. + + mkdir -p "${dbpath}" || die + while true; do + ebegin "Trying to start mongod on port ${DB_PORT}" + + LC_ALL=C \ + mongod --dbpath "${dbpath}" --nojournal \ + --bind_ip ${DB_IP} --port ${DB_PORT} \ + --unixSocketPrefix "${TMPDIR}" \ + --logpath "${logpath}" --fork \ + && sleep 2 + + # Now we need to check if the server actually started... + if [[ ${?} -eq 0 && -S "${TMPDIR}"/mongodb-${DB_PORT}.sock ]]; then + # yay! + eend 0 + break + elif grep -q 'Address already in use' "${logpath}"; then + # ay, someone took our port! + eend 1 + : $(( DB_PORT += 1 )) + continue + else + eend 1 + eerror "Unable to start mongod for tests. See the server log:" + eerror " ${logpath}" + die "Unable to start mongod for tests." + fi + done + + local failed + DB_PORT2=$(( DB_PORT + 1 )) DB_PORT3=$(( DB_PORT + 2 )) esetup.py test || failed=1 + + mongod --dbpath "${dbpath}" --shutdown || die + + [[ ${failed} ]] && die "Tests fail with ${EPYTHON}" + + rm -rf "${dbpath}" || die +} |