Log In
Log In
Places
All Projects
Status Monitor
Collapse sidebar
matrix-synapse
python-mongodict
python-mongodict.spec
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File python-mongodict.spec of Package python-mongodict
%if 0%{?fedora} %global with_python3 1 %endif %global unmangled_name mongodict %global github_user turicas Summary: MongoDB-backed Python dict-like interface Name: python-%{unmangled_name} Version: 0.3.1 Release: 1%{?dist} Source0: https://github.com/%{github_user}/%{unmangled_name}/archive/%{version}/%{unmangled_name}-%{version}.tar.gz Patch0: python-mongodict-0.3.1-newer-pymongo.patch License: GPL3 Group: Development/Libraries Prefix: %{_prefix} BuildArch: noarch Vendor: Álvaro Justen <alvarojusten@gmail.com> Url: https://github.com/turicas/mongodict/ BuildRequires: python2-devel BuildRequires: python-setuptools BuildRequires: python-nose BuildRequires: python-coverage BuildRequires: python-pymongo %if 0%{?with_python3} BuildRequires: python-tools BuildRequires: python3-devel BuildRequires: python3-setuptools BuildRequires: python3-nose BuildRequires: python3-coverage BuildRequires: python3-pymongo %endif BuildRequires: mongodb-server Requires: python-pymongo %description So you are storing some key-values in a dict but your data became huge than your memory or you want to persist it on the disk? Then mongodict is for you! As it uses MongoDB to store the data, you get all cool MongoDB things, like shardings and replicas. It uses the `pickle` module available on Python standard library to serialize/deserialize data and store everything as bson.Binary in MongoDB. You can also provide another codec (serializer/deserializer). %if 0%{?with_python3} %package -n python3-%{unmangled_name} Summary: MongoDB-backed Python dict-like interface Group: Development/Libraries Requires: python3-pymongo %description -n python3-%{unmangled_name} So you are storing some key-values in a dict but your data became huge than your memory or you want to persist it on the disk? Then mongodict is for you! As it uses MongoDB to store the data, you get all cool MongoDB things, like shardings and replicas. It uses the `pickle` module available on Python standard library to serialize/deserialize data and store everything as bson.Binary in MongoDB. You can also provide another codec (serializer/deserializer). This package contains python3 version of this module. %endif %prep %setup -n %{unmangled_name}-%{version} %patch0 -p1 %if 0%{?with_python3} rm -rf %{py3dir} cp -a . %{py3dir} %endif %build %{__python2} setup.py build %if 0%{?with_python3} pushd %{py3dir} %{__python3} setup.py build popd %endif %install %{__python2} setup.py install \ --skip-build \ -O2 \ --root=$RPM_BUILD_ROOT \ --record=INSTALLED_FILES_PY2 %if 0%{?with_python3} pushd %{py3dir} %{__python3} setup.py install \ --skip-build \ -O2 \ --root=$RPM_BUILD_ROOT \ --record="%{_builddir}/%{buildsubdir}/INSTALLED_FILES_PY3" popd %endif %check MONGOPORT=$[ 33000 + $RANDOM % 1000 ] MONGODIR="`mktemp -d \"%{_builddir}/%{buildsubdir}/mongodb.XXXXXXXXXX\"`" cat > "$MONGODIR/mongod.conf" << EOF bind_ip = 127.0.0.1 port = $MONGOPORT fork = true pidfilepath = $MONGODIR/mongod.pid logpath = $MONGODIR/mongod.log unixSocketPrefix = $MONGODIR dbpath = $MONGODIR EOF /usr/bin/mongod -f "$MONGODIR/mongod.conf" --setParameter failIndexKeyTooLong=false run cleanup() { test -f "$MONGODIR/mongod.pid" && kill "`cat \"$MONGODIR/mongod.pid\"`" } trap cleanup EXIT %{__sed} -i "s/27017/$MONGOPORT/g" tests/*.py py_ver="`%{__python2} -c 'import sys; print(\"%d.%d\" % (sys.version_info.major, sys.version_info.minor))'`" "nosetests-$py_ver" \ -dvs --with-coverage \ --cover-package mongodict \ tests/test_*.py %if 0%{?with_python3} pushd %{py3dir} %{__sed} -i "s/27017/$MONGOPORT/g" tests/*.py py_ver="`%{__python3} -c 'import sys; print(\"%d.%d\" % (sys.version_info.major, sys.version_info.minor))'`" "nosetests-$py_ver" \ -dvs --with-coverage \ --cover-package mongodict \ tests/test_*.py popd %endif %clean rm -rf $RPM_BUILD_ROOT %files -f INSTALLED_FILES_PY2 %defattr(-,root,root) %files -n python3-%{unmangled_name} -f INSTALLED_FILES_PY3 %defattr(-,root,root)
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Contact
Support
@OBShq
The Open Build Service is an
openSUSE project
.
Log In
Places
Places
All Projects
Status Monitor