Blob Blame History Raw
%global modname tahrir_api

Name:             python-tahrir-api
Version:          0.5.1
Release:          1%{?dist}
Summary:          An API for interacting with the Tahrir database

Group:            Development/Languages
License:          GPLv3+
URL:              http://pypi.python.org/pypi/tahrir-api
Source0:          http://pypi.python.org/packages/source/t/tahrir-api/tahrir-api-%{version}.tar.gz

BuildArch:        noarch

BuildRequires:    python2-devel
BuildRequires:    python-setuptools
BuildRequires:    python-pygments
BuildRequires:    python-zope-sqlalchemy
BuildRequires:    python-simplejson
BuildRequires:    python-httplib2
BuildRequires:    python-webob1.2
BuildRequires:    python-nose
BuildRequires:    python-alembic
BuildRequires:    python-arrow

Requires:       python-pygments
Requires:       python-zope-sqlalchemy
Requires:       python-simplejson
Requires:       python-httplib2
Requires:       python-webob1.2
Requires:       python-alembic
Requires:       python-arrow

# These 3 are just deps of python-arrow that are missing from
# python-arrow-0.4.2-1.  They can be removed in the future.
BuildRequires:      python-chai
BuildRequires:      python-dateutil
BuildRequires:      python-six
Requires:           python-chai
Requires:           python-dateutil
Requires:           python-six


%if 0%{?fedora}
BuildRequires:  python-mako >= 0.3.6
Requires:       python-mako >= 0.3.6
BuildRequires:  python-paste-deploy
Requires:       python-paste-deploy
BuildRequires:  python-sqlalchemy >= 0.7
Requires:       python-sqlalchemy >= 0.7
BuildRequires:  python-zope-interface
Requires:       python-zope-interface
%else if 0%{?rhel} && 0%{?rhel} <= 6
BuildRequires:  python-mako0.4 >= 0.3.6
Requires:       python-mako0.4 >= 0.3.6
BuildRequires:  python-paste-deploy1.5
Requires:       python-paste-deploy1.5
BuildRequires:  python-sqlalchemy0.7
Requires:       python-sqlalchemy0.7
BuildRequires:  python-zope-interface4
Requires:       python-zope-interface4
BuildRequires:  python-ordereddict
Requires:       python-ordereddict
%endif

%description
API for interacting with the Tahrir database Based on the `Tahrir
<https://github.com/fedora-infra/tahrir>`_ database model.

There are two classes that can be used in this module. The first is
TahrirDatabase class located in tahrir_api.dbapi and the second is the database
model located in tahrir_api.model. The TahrirDatabase class is a high level way
to interact with the database. The model is used for a slightly more low level
way of interacting with the database. It allows for custom interactions with
the database without having to use the TahrirDatabase class.

%prep
%setup -q -n tahrir-api-%{version}

# Remove upstream egg-info so that it gets rebuilt.
rm -rf *.egg-info
sed -i -e "s|__requires__ = 'SQLAlchemy>=0.7.0'|__requires__ = ['WebOb>=1.2', 'SQLAlchemy>=0.7.0', 'PasteDeploy>=1.5.0', 'zope.interface>=3.8.0', 'Mako>=0.3.6']; import pkg_resources|" setup.py

%build
%{__python} setup.py build

%install
%{__python} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT
awk 'NR==3{print "import __main__; __main__.__requires__ = __requires__ = [\"WebOb>=1.2\", \"SQLAlchemy>=0.7.0\", \"PasteDeploy>=1.5.0\", \"zope.interface>=3.8.0\", \"Mako>=0.3.6\"]; import pkg_resources"}3' %{buildroot}/%{_bindir}/initialize_tahrir_db > tempfile
install -p -m755 tempfile %{buildroot}/%{_bindir}/initialize_tahrir_db

# DB upgrade/downgrade scripts
%{__mkdir_p} %{buildroot}%{_datadir}/%{modname}/
%{__cp} alembic.ini %{buildroot}%{_datadir}/%{modname}/alembic.ini
%{__cp} -r alembic/ %{buildroot}%{_datadir}/%{modname}/alembic/

%check
%{__python} setup.py test

%files
%doc README.rst LICENSE

%{python_sitelib}/%{modname}
%{python_sitelib}/%{modname}-%{version}*
%{_datadir}/%{modname}/
%{_bindir}/initialize_tahrir_db

%changelog
* Mon Feb 24 2014 Ralph Bean <rbean@redhat.com> - 0.5.1-1
- Standardize arguments to the add_invitation api.

* Tue Dec 17 2013 Ralph Bean <rbean@redhat.com> - 0.5.0-4
- Convert awk to sed to fight weirdness.

* Tue Dec 17 2013 Ralph Bean <rbean@redhat.com> - 0.5.0-3
- Adjust setuptools line in prep section.

* Tue Dec 17 2013 Ralph Bean <rbean@redhat.com> - 0.5.0-2
- Add temporary requires to get around broken python-arrow.

* Tue Dec 17 2013 Ralph Bean <rbean@redhat.com> - 0.5.0-1
- Latest upstream with new authorization table.
- Use UTC time everywhere.
- New invitation manipulation API methods.
- New dep on python-arrow

* Mon Nov 18 2013 Ralph Bean <rbean@redhat.com> - 0.4.2-2
- Direct requires on python-alembic.

* Mon Nov 18 2013 Ralph Bean <rbean@redhat.com> - 0.4.2-1
- Latest upstream with packaging bugfixes.

* Mon Nov 18 2013 Ralph Bean <rbean@redhat.com> - 0.4.1-2
- Add BR on python-alembic.

* Mon Nov 18 2013 Ralph Bean <rbean@redhat.com> - 0.4.1-1
- Latest upstream
- Correct fedmsg schema.
- New calculation of tied rank.

* Fri Oct 25 2013 Ralph Bean <rbean@redhat.com> - 0.4.0-1
- Latest upstream.
- Keep track of logins.
- Return leaderboard as an ordereddict

* Mon Aug 26 2013 Ralph Bean <rbean@redhat.com> - 0.3.0-1
- Latest upstream.
- Allow a notification callback to be used for different events.
- Add a column to the DB to cache the rank of users.
- Add routines to calculate the rank of users.

* Tue Jul 30 2013 Ralph Bean <rbean@redhat.com> - 0.2.8-1
- Latest upstream, more enhancements.

* Wed Jul 17 2013 Ralph Bean <rbean@redhat.com> - 0.2.7-1
- Latest upstream, simplified badge id.
- Bugfixes.

* Tue Jul 16 2013 Ralph Bean <rbean@redhat.com> - 0.2.6-1
- Latest upstream, more enhancements.

* Wed Jul 10 2013 Ralph Bean <rbean@redhat.com> - 0.2.5-1
- Latest upstream, uniquifies the nickname field.

* Wed Jul 03 2013 Ralph Bean <rbean@redhat.com> - 0.2.4-1
- Latest upstream with some new get_all_... methods.

* Wed Jun 26 2013 Ralph Bean <rbean@redhat.com> - 0.2.3-2
- Remove old patch.

* Wed Jun 26 2013 Ralph Bean <rbean@redhat.com> - 0.2.3-1
- Latest upstream with fixes to the model.

* Sun Jun 23 2013 Ralph Bean <rbean@redhat.com> - 0.2.2-1
- Add alembic upgrade scripts.
- Add check section with tests.

* Sun Jun 23 2013 Ralph Bean <rbean@redhat.com> - 0.2.1-1
- Bugfix - stop leaking sqlalchemy sessions.
- API enhancement - can query for user by username, id, or email now.

* Thu Jun 20 2013 Ralph Bean <rbean@redhat.com> - 0.2.0-1
- API enhancements.

* Thu Jun 13 2013 Ralph Bean <rbean@redhat.com> - 0.1.8-6
- Use paste-deploy1.5 forward compat package.
- Use zope-interface4 forward compat package.

* Thu Jun 13 2013 Ralph Bean <rbean@redhat.com> - 0.1.8-5
- Added dep on zope.interface.

* Thu Jun 13 2013 Ralph Bean <rbean@redhat.com> - 0.1.8-4
- Conditional mako0.4 requirement for epel6.

* Thu Jun 13 2013 Ralph Bean <rbean@redhat.com> - 0.1.8-3
- More epel6 fixes.

* Thu Jun 13 2013 Ralph Bean <rbean@redhat.com> - 0.1.8-2
- Conditionalize sqlalchemy forward compat package for epel6.

* Fri Jun 07 2013 Ralph Bean <rbean@redhat.com> - 0.1.8-1
- New Invitations API.
- Bugfixes to other API functions.
- Relicense to GPLv3+

* Mon Mar 11 2013 Ralph Bean <rbean@redhat.com> - 0.1.7-3
- Force version of python-webob

* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.1.7-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild

* Mon Jul 23 2012 rossdylan <rdelinge@redhat.com> 0.1.7-1
- Lots of misc bug fixes
- consolidated the 2 models back into a single version
- expanded the api to include more ways of interacting with the database
- Removed MySQL-python dependancy since tahrir-api is db agnostic
* Sat Jul 21 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.1.3.4-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
* Wed Jun 13 2012 rossdylan <rdelinge@redhat.com> 0.1.3.1-1
- initial package for Fedora