summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2021-05-04 15:44:21 +0200
committerMichał Górny <mgorny@gentoo.org>2021-05-04 15:58:56 +0200
commitaccaf23a4f8ba3e2eb315d975910521b0fd4ffe2 (patch)
treee0ed39af71e46864323e473ff1b736886e7848bd
parentdev-python/rq: Remove old (py3.7) (diff)
downloadgentoo-accaf23a4f8ba3e2eb315d975910521b0fd4ffe2.tar.gz
gentoo-accaf23a4f8ba3e2eb315d975910521b0fd4ffe2.tar.bz2
gentoo-accaf23a4f8ba3e2eb315d975910521b0fd4ffe2.zip
dev-python/mongoengine: Bump to 0.23.1
Signed-off-by: Michał Górny <mgorny@gentoo.org>
-rw-r--r--dev-python/mongoengine/Manifest1
-rw-r--r--dev-python/mongoengine/mongoengine-0.23.1.ebuild80
2 files changed, 81 insertions, 0 deletions
diff --git a/dev-python/mongoengine/Manifest b/dev-python/mongoengine/Manifest
index 8a117c06ee6e..03b6415746c5 100644
--- a/dev-python/mongoengine/Manifest
+++ b/dev-python/mongoengine/Manifest
@@ -1 +1,2 @@
DIST mongoengine-0.23.0.tar.gz 322731 BLAKE2B 5aa01b59193fa118d9b9c2110d6ec401090bff768b5b2e5d9c5fea4bcb5ae6714c62d4ff664c3ab24c600d912f90287a8ac77313bc8c50e13c6d191baef69e49 SHA512 9dbc45ebf3d367a829947f404a3979236be7ef0fc39611046e2815b6ab83bdb2ada3db8b6d1f4bec6301677f5b727cc2570bb732050e2ff865da49a5ba63d0aa
+DIST mongoengine-0.23.1.tar.gz 324881 BLAKE2B f6856d432f34c19f9d32aa7fe340c5a09db6976802f5ce320e9722b942f80a1c38a725eab882780104fa379abe212319802f9dd4b405da41454bda84a5d57eb4 SHA512 fcd2ff1df3e2b28bc4cba67cad71a1856e9f94d4d2ecb731a5cce2f1c5e9abc163be37b7db518dfaa54a0ef7f664ac49b621a0554961aa7e13686ff608ef132a
diff --git a/dev-python/mongoengine/mongoengine-0.23.1.ebuild b/dev-python/mongoengine/mongoengine-0.23.1.ebuild
new file mode 100644
index 000000000000..f4d6a34f196a
--- /dev/null
+++ b/dev-python/mongoengine/mongoengine-0.23.1.ebuild
@@ -0,0 +1,80 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+PYTHON_COMPAT=( python3_{7..9} )
+inherit distutils-r1
+
+DESCRIPTION="A Python Object-Document-Mapper for working with MongoDB"
+HOMEPAGE="https://github.com/MongoEngine/mongoengine/"
+SRC_URI="https://github.com/MongoEngine/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~amd64"
+
+RDEPEND="dev-python/blinker[${PYTHON_USEDEP}]
+ dev-python/pillow[${PYTHON_USEDEP}]
+ dev-python/pymongo[${PYTHON_USEDEP}]"
+BDEPEND="
+ test? (
+ dev-db/mongodb
+ dev-python/mongomock[${PYTHON_USEDEP}]
+ )"
+
+distutils_enable_tests pytest
+
+src_prepare() {
+ # TODO: investigate
+ sed -e 's:test_covered_index:_&:' \
+ -i tests/document/test_indexes.py || die
+ # no $eval
+ sed -e 's:test_exec_js_field_sub:_&:' \
+ -e 's:test_exec_js_query:_&:' \
+ -e 's:test_item_frequencies_normalize:_&:' \
+ -e 's:test_item_frequencies_with_0_values:_&:' \
+ -e 's:test_item_frequencies_with_False_values:_&:' \
+ -e 's:test_item_frequencies_with_null_embedded:_&:' \
+ -i tests/queryset/test_queryset.py || die
+ # TODO: investigate (wrong order? bad comparison?)
+ sed -e 's:test_distinct_ListField_EmbeddedDocumentField:_&:' \
+ -i tests/queryset/test_queryset.py || die
+
+ distutils-r1_src_prepare
+}
+
+python_test() {
+ local dbpath=${TMPDIR}/mongo.db
+ local logpath=${TMPDIR}/mongod.log
+
+ mkdir -p "${dbpath}" || die
+ ebegin "Trying to start mongod on port ${DB_PORT}"
+
+ LC_ALL=C \
+ mongod --dbpath "${dbpath}" --nojournal \
+ --bind_ip 127.0.0.1 --port 27017 \
+ --unixSocketPrefix "${TMPDIR}" \
+ --logpath "${logpath}" --fork || die
+ sleep 2
+
+ # Now we need to check if the server actually started...
+ if [[ -S "${TMPDIR}"/mongodb-27017.sock ]]; then
+ # yay!
+ eend 0
+ else
+ eend 1
+ eerror "Unable to start mongod for tests. See the server log:"
+ eerror " ${logpath}"
+ die "Unable to start mongod for tests."
+ fi
+
+ local failed
+ nonfatal epytest || failed=1
+
+ mongod --dbpath "${dbpath}" --shutdown || die
+
+ [[ ${failed} ]] && die "Tests fail with ${EPYTHON}"
+
+ rm -rf "${dbpath}" || die
+}