Skip to content

Commit

Permalink
python requirements: update readme and rpm spec to require python3
Browse files Browse the repository at this point in the history
Closes #13
  • Loading branch information
saaros committed Feb 16, 2016
1 parent 865fe1a commit fb22d31
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 28 deletions.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
*~
*.pyc
/rpm
/build/
/dist/
/kafkajournalpump.egg-info/
/rpm/
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ before_install:

python:
- "3.4"
- "3.5"

install:
- "pip install pylint pytest mock pep8 kafka-python coverage coveralls"
Expand Down
4 changes: 3 additions & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ Python/Other::

This will produce an egg file into a dist directory within the same folder.

kafkajournalpump requires Python 3.4 or newer.

Installation
============

Expand All @@ -55,7 +57,7 @@ and eventually after the setup section, you can just run::

Python/Other::

easy_install dist/kafkajournalpump-1.0.0-py2.7.egg
easy_install dist/kafkajournalpump-1.0.1-py3.4.egg

On Debian/Other systems it is recommended that you run kafkajournalpump within
a supervisord (http://supervisord.org) Process control system.
Expand Down
30 changes: 5 additions & 25 deletions kafkajournalpump.spec
Original file line number Diff line number Diff line change
@@ -1,24 +1,13 @@
%if %{?python3_sitelib:1}0
%global use_python3 1
%else
%global use_python3 0
%endif

Name: kafkajournalpump
Version: %{major_version}
Release: %{minor_version}%{?dist}
Url: http://github.com/ohmu/kafkajournalpump
Summary: Pump messages from systemd journal to Kafka
License: ASL 2.0
Source0: kafkajournalpump-rpm-src.tar.gz
%if %{use_python3}
Requires: python3-kafka, systemd-python3
BuildRequires: python3-pytest, python3-pylint
%else
Requires: python-kafka, systemd-python
BuildRequires: pytest, pylint
%endif
BuildRequires: %{requires}
BuildRequires: python3-devel, python3-pytest, python3-pylint
BuildArch: noarch

%description
Expand All @@ -34,22 +23,14 @@ kafkajournalpump is a daemon to pump journald messages into a given kafka topic.


%install
%if %{use_python3}
python3 setup.py install --prefix=%{_prefix} --root=%{buildroot}
%else
python2 setup.py install --prefix=%{_prefix} --root=%{buildroot}
%endif
sed -e "s@#!/bin/python@#!%{_bindir}/python@" -i %{buildroot}%{_bindir}/*
%{__install} -Dm0644 kafkajournalpump.unit %{buildroot}%{_unitdir}/kafkajournalpump.service
%{__mkdir_p} %{buildroot}%{_localstatedir}/lib/kafkajournalpump


%check
%if %{use_python3}
make test PYTHON=python3
%else
make test PYTHON=python2
%endif
make test


%files
Expand All @@ -58,14 +39,13 @@ make test PYTHON=python2
%{_bindir}/kafkajournalpump*
%{_unitdir}/kafkajournalpump.service
%{_localstatedir}/lib/kafkajournalpump
%if %{use_python3}
%{python3_sitelib}/*
%else
%{python_sitelib}/*
%endif


%changelog
* Tue Feb 16 2016 Oskari Saarenmaa <os@aiven.io> - 1.0.1
- We're Python 3 only now

* Mon Aug 03 2015 Hannu Valtonen <hannu.valtonen@ohmu.fi> - 1.0.1
- bugfix release

Expand Down
14 changes: 13 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,17 @@
dependency_links=[],
package_data={},
data_files=[],
entry_points={'console_scripts': ["kafkajournalpump = kafkajournalpump.__main__:main"]}
entry_points={
"console_scripts": [
"kafkajournalpump = kafkajournalpump.__main__:main",
],
},
classifiers=[
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"Topic :: System :: Logging",
"License :: OSI Approved :: Apache Software License",
"Programming Language :: Python :: 3.4",
"Programming Language :: Python :: 3.5",
],
)

0 comments on commit fb22d31

Please sign in to comment.