Skip to content
This repository has been archived by the owner on Dec 7, 2022. It is now read-only.
/ pulp Public archive

Commit

Permalink
Adds pymongo 2.7.2 and mongoengine 0.9.0
Browse files Browse the repository at this point in the history
The pymongo spec file skips tests that require a running
instance of mongodb. I manually ran the tests against a
running instance once and they all passed for me. If we
ever configure the builder with a running instance of mongodb
we can delete the --exclude list in the pymongo spec file.

Updates pulp.server.db.manage:ensure_database_indexes()
to only use the Document.ensure_indexes() method.

Removes pulp.server.db.model.queryset:update_one() which was
here for 0.7.10 compatability.

This also updates all tests to run correctly when the test
runner has mongoengine==0.9.0 and pymongo==2.7.2 installed.

Test server.managers.repo.test_cud:test_update_repo_and_plugins
is removed altogether. I don't know why it was failing after
upgrading the deps, but when I downgrade the deps back to
mongoengine 0.7.10 and pymongo 2.5.3 it passed. It's safe to
remove altogether here because it has completely been removed
and rewritten with #1931.

https://pulp.plan.io/issues/934
fixes #934
  • Loading branch information
Brian Bouterse committed Jun 26, 2015
1 parent cf67ab5 commit 333e73c
Show file tree
Hide file tree
Showing 24 changed files with 440 additions and 254 deletions.
15 changes: 13 additions & 2 deletions deps/python-mongoengine/README
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
Team owner: cduryee
Team owner: bmbouter

This is the same as the EPEL6 srpm. It is included here for building for el7, since EPEL7 does not carry python-mongoengine.
Pulp uses a vanilla version of mongoengine 0.9.0, except for one
patch which removes Pillow as a setuptools dependency. Not
having Pillow installed at runtime will disable the ImageField,
but mongoengine will operate fully otherwise. At the time I built
mongoengine 0.9.0, Pillow is not available on EL6.

python-mongoengine requires at least pymongo 2.7.1 at runtime.

The spec file was originally adapted from the spec file inside of
python-mongoengine-0.8.4-3.el7.src.rpm [0].

[0]: http://koji.fedoraproject.org/koji/buildinfo?buildID=612617
2 changes: 1 addition & 1 deletion deps/python-mongoengine/dist_list.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
el7
el6 el7 fc21 fc22
11 changes: 0 additions & 11 deletions deps/python-mongoengine/fix-requirements-pillow-instead-PIL.patch

This file was deleted.

Binary file removed deps/python-mongoengine/mongoengine-0.7.10.tar.gz
Binary file not shown.
Binary file added deps/python-mongoengine/mongoengine-0.9.0.tar.gz
Binary file not shown.
154 changes: 66 additions & 88 deletions deps/python-mongoengine/python-mongoengine.spec
Original file line number Diff line number Diff line change
@@ -1,110 +1,88 @@
%global pkgname mongoengine
Name: python-mongoengine
Version: 0.7.10
Release: 2%{?dist}
Summary: A Python Document-Object Mapper for working with MongoDB

License: MIT
URL: http://pypi.python.org/pypi/mongoengine/
Source0: http://pypi.python.org/packages/source/m/mongoengine/%{pkgname}-%{version}.tar.gz

Patch1: fix-requirements-pillow-instead-PIL.patch
BuildArch: noarch
BuildRequires: python2-devel
BuildRequires: python-setuptools
BuildRequires: python-dateutil

# python-sphinx is really old in epel6, use the compat package instead
%if 0%{?rhel} == 6
BuildRequires: python-sphinx10
%else
BuildRequires: python-sphinx
%endif
# sitelib for noarch packages, sitearch for others (remove the unneeded one)
%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")}
%{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")}

%define srcname mongoengine

Name: python-%{srcname}
Version: 0.9.0
Release: 1%{?dist}
Summary: A Python Document-Object Mapper for working with MongoDB

Group: Development/Libraries
License: MIT
URL: https://github.com/MongoEngine/mongoengine
Source0: %{srcname}-%{version}.tar.gz

Patch0: remove-Pillow-as-test-requirement.patch

BuildArch: noarch

BuildRequires: python2-devel
BuildRequires: python-setuptools
BuildRequires: python-sphinx
BuildRequires: python-dateutil
BuildRequires: python-pymongo
BuildRequires: python-pymongo-gridfs
BuildRequires: mongodb-server
BuildRequires: mongodb
BuildRequires: python-blinker
BuildRequires: python-coverage
BuildRequires: python-nose

%if 0%{?fedora} >= 18
BuildRequires: python-pymongo
BuildRequires: python-django
BuildRequires: python-pymongo-gridfs
Requires: python-pymongo
Requires: python-pymongo-gridfs
%if 0%{?rhel} == 6
BuildRequires: Django14
%else
BuildRequires: python-pymongo
BuildRequires: Django
BuildRequires: python-pymongo-gridfs
Requires: python-pymongo >= 2.1.1
Requires: python-pymongo-gridfs
BuildRequires: python-django
%endif

BuildRequires: mongodb-server
BuildRequires: python-blinker
%if 0%{?fedora} >= 19
BuildRequires: python-pillow
Requires: python-pillow
%else
Requires: python-imaging
BuildRequires: python-imaging
%endif
BuildRequires: python-coverage
BuildRequires: python-nose
Requires: python-blinker
Requires: python-pymongo >= 2.7.1
Requires: python-pymongo-gridfs >= 2.7.1
Requires: python-blinker


%description
MongoEngine is a Document-Object Mapper (think ORM,
but for document databases) for working with MongoDB
from Python. It uses a simple declarative API, similar
to the Django ORM.

MongoEngine is an ORM-like layer on top of PyMongo.

%prep
%setup -q -n %{pkgname}-%{version}

%if 0%{?fedora} >= 19
%patch1 -p1
%endif

rm -rf mongoengine.egg-info
%setup -q -n %{srcname}-%{version}
%patch0 -p1


%build
python setup.py build

# python-sphinx10 has a different binary name for sphinx-build
# set the makefile's variable for the binary when needed
%if 0%{?rhel} == 6
PYTHONPATH=$(pwd) make -C docs html SPHINXBUILD='sphinx-1.0-build'
%else
PYTHONPATH=$(pwd) make -C docs html
%endif

#PYTHONPATH=$(pwd) make -C docs html
rm -f docs/_build/html/.buildinfo
# Remove CFLAGS=... for noarch packages (unneeded)
CFLAGS="$RPM_OPT_FLAGS" %{__python} setup.py build


%install
python setup.py install --skip-build --root %{buildroot}


%check
# Pass
rm -rf $RPM_BUILD_ROOT
%{__python} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT

%clean
rm -rf $RPM_BUILD_ROOT

%files
%doc README.rst LICENSE docs/_build/html
%{python_sitelib}/%{pkgname}
%{python_sitelib}/%{pkgname}-*.egg-info

%defattr(-,root,root,-)
%doc docs AUTHORS LICENSE README.rst
# For noarch packages: sitelib
%{python_sitelib}/*
# For arch-specific packages: sitearch
# %{python_sitearch}/*

%changelog
* Mon Oct 13 2014 Chris Duryee <cduryee@redhat.com> 0.7.10-2
- new package built with tito

* Tue Oct 08 2013 Yohan Graterol <yohangraterol92@gmail.com> - 0.7.10-2
- Fix BR
* Fri Sep 13 2013 Tim Flink <tflink@fedoraproject.org> - 0.7.10-1
- adding conditional dep and makefile change for epel6 sphinx
- updating to 0.7.10

* Thu Jun 18 2015 Brian Bouterse <bbouters@redhat.com> - 0.9.0-1
- Updated to mongoengine to 0.9.0
- Created new patch to remove Pillow as a test requirement

* Wed Feb 18 2015 Yohan Graterol <yohangraterol92@gmail.com> - 0.8.4-3
- Built for EPEL7
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.8.4-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild

* Mon Aug 26 2013 Yohan Graterol <yohangraterol92@gmail.com> - 0.8.4-1
- New Version
* Mon Aug 12 2013 Yohan Graterol <yohangraterol92@gmail.com> - 0.8.3-1
- New version
* Sun Aug 04 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.7.9-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild

Expand All @@ -126,4 +104,4 @@ python setup.py install --skip-build --root %{buildroot}
- Add BuildRequires: python-coverage, python-nose

* Thu Jan 17 2013 Yohan Graterol <yohangraterol92@gmail.com> - 0.7.9-1
- Initial packaging
- Initial packaging
25 changes: 25 additions & 0 deletions deps/python-mongoengine/remove-Pillow-as-test-requirement.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
From 34ad568af4843c3baf5018e992afc1214118eb37 Mon Sep 17 00:00:00 2001
From: Brian Bouterse <bmbouter@gmail.com>
Date: Thu, 18 Jun 2015 16:15:20 -0400
Subject: [PATCH] Removing Pillow from list of tests_require in setup.py

---
setup.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/setup.py b/setup.py
index 8851978..2c39e7f 100644
--- a/setup.py
+++ b/setup.py
@@ -58,7 +58,7 @@ if sys.version_info[0] == 3:
extra_opts['packages'] = find_packages()
extra_opts['package_data'] = {"tests": ["fields/mongoengine.png", "fields/mongodb_leaf.png"]}
else:
- extra_opts['tests_require'] = ['nose', 'coverage', 'blinker', 'django>=1.4.2', 'Pillow>=2.0.0', 'jinja2>=2.6', 'python-dateutil']
+ extra_opts['tests_require'] = ['nose', 'coverage', 'blinker', 'django>=1.4.2', 'jinja2>=2.6', 'python-dateutil']

if sys.version_info[0] == 2 and sys.version_info[1] == 6:
extra_opts['tests_require'].append('unittest2')
--
1.9.3

12 changes: 12 additions & 0 deletions deps/python-pymongo/README
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
Team owner: bmbouter

Pulp currently uses a vanilla version of pymongo 2.7.2. That is
the latest Z release for the pymongo 2.7 release stream.

python-mongoengine requires at least pymongo 2.7.1 at runtime.

The spec file was originally adapted from the spec file inside of
python-pymongo-2.5.2-7.fc23.src.rpm [0]. Thanks also to dgoodwin
and Dominic in #tito for the spec file help.

[0]: http://koji.fedoraproject.org/koji/buildinfo?buildID=659860
1 change: 1 addition & 0 deletions deps/python-pymongo/dist_list.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
el6 el7 fc21 fc22
Binary file added deps/python-pymongo/pymongo-2.7.2.tar.gz
Binary file not shown.
Loading

0 comments on commit 333e73c

Please sign in to comment.