diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..21a1760 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/cli_helpers-0.2.3.tar.gz diff --git a/README.md b/README.md deleted file mode 100644 index 57db89e..0000000 --- a/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# python-cli-helpers - -The python-cli-helpers package \ No newline at end of file diff --git a/python-cli-helpers-0.2.3-setup.patch b/python-cli-helpers-0.2.3-setup.patch new file mode 100644 index 0000000..7352e60 --- /dev/null +++ b/python-cli-helpers-0.2.3-setup.patch @@ -0,0 +1,34 @@ +diff --git a/setup.py b/setup.py +index aead63d..3d2d7fa 100755 +--- a/setup.py ++++ b/setup.py +@@ -4,6 +4,7 @@ + import ast + from io import open + import re ++import sys + + from setuptools import find_packages, setup + +@@ -22,6 +23,11 @@ def open_file(filename): + + readme = open_file('README.rst') + ++if sys.version_info[0] == 2: ++ py2_reqs = [ 'backports.csv >= 1.0.0', ] ++else: ++ py2_reqs = [] ++ + setup( + name='cli_helpers', + author='dbcli', +@@ -34,8 +40,7 @@ setup( + long_description=readme, + install_requires=[ + 'terminaltables >= 3.0.0', +- 'backports.csv >= 1.0.0' +- ], ++ ] + py2_reqs, + extras_require={ + 'styles': ['Pygments >= 1.6'], + }, diff --git a/python-cli-helpers.spec b/python-cli-helpers.spec new file mode 100644 index 0000000..7440ba2 --- /dev/null +++ b/python-cli-helpers.spec @@ -0,0 +1,121 @@ +%if 0%{?rhel} && 0%{?rhel} <= 7 +%bcond_with python3 +%else +%bcond_without python3 +%endif + +# python2-backports-csv not in Fedora yet, disable Python 2 version +%global with_python2 0 + +%global pypi_name cli_helpers + +Summary: Python helpers for common CLI tasks +Name: python-cli-helpers +Version: 0.2.3 +Release: 1%{?dist} +License: BSD +URL: https://github.com/dbcli/cli_helpers +Source0: https://files.pythonhosted.org/packages/source/c/cli_helpers/cli_helpers-%{version}.tar.gz +Patch01: python-cli-helpers-0.2.3-setup.patch +BuildArch: noarch +%if 0%{?with_python2} +BuildRequires: python2-backports-csv +BuildRequires: python2-devel +BuildRequires: python-setuptools +BuildRequires: python2-terminaltables +BuildRequires: python2-pytest +%endif +%if %{with python3} +BuildRequires: python3-devel +BuildRequires: python3-setuptools +BuildRequires: python3-terminaltables +BuildRequires: python3-pytest +%endif +%description +CLI Helpers is a Python package that makes it easy to perform common +tasks when building command-line apps. Its a helper library for +command-line interfaces. + +%if 0%{?with_python2} +%package -n python2-cli-helpers +Summary: %{summary} +%{?python_provide:%python_provide python2-cli-helpers} +%{?el6:Provides: python-cli-helpers} +Requires: python2-pygments >= 1.6 +Requires: python2-terminaltables >= 3.0.0 +%description -n python2-cli-helpers +%{desc} +%endif + +%if %{with python3} +%package -n python3-cli-helpers +Summary: %{summary} +%{?python_provide:%python_provide python3-cli-helpers} +Requires: python3-pygments >= 1.6 +Requires: python3-terminaltables >= 3.0.0 +%description -n python3-cli-helpers +%{desc} +%endif + +%prep +%setup -q -n %{pypi_name}-%{version} +%patch01 -p1 +rm -rf %{pypi_name}.egg-info + +%build +%if 0%{?with_python2} +%py2_build +%endif +%if %{with python3} +%py3_build +%endif + +%install +%if %{with python3} +%py3_install +%endif +%if 0%{?with_python2} +%py2_install +%endif + +%check +%if 0%{?with_python2} +PYTHONPATH=build/lib/ py.test-2 +%endif +%if %{with python3} +PYTHONPATH=build/lib/ py.test-3 +%endif + +%if 0%{?with_python2} +%files -n python2-cli-helpers +%license LICENSE +%doc AUTHORS CHANGELOG README.rst +%{python2_sitelib}/%{pypi_name} +%{python2_sitelib}/%{pypi_name}-%{version}-py?.?.egg-info +%endif + +%if %{with python3} +%files -n python3-cli-helpers +%license LICENSE +%doc AUTHORS CHANGELOG README.rst +%{python3_sitelib}/%{pypi_name} +%{python3_sitelib}/%{pypi_name}-%{version}-py?.?.egg-info +%endif + +%changelog +* Wed Aug 16 2017 Terje Rosten - 0.2.3-1 +- 0.2.3 +- Rename +- Use summary and desc macros +- Drop Python 2 sub package for now, backports.csv not available +- Add patch to remove Python 2 specific reqs into Python 3 package + +* Mon Jun 26 2017 Terje Rosten - 0.2.0-1 +- 0.2.0 +- Rename + +* Mon May 15 2017 Terje Rosten - 0.1.0-2 +- Minor tweaks + +* Sat May 13 2017 Dick Marinus - 0.1.0-1 +- Initial package diff --git a/sources b/sources new file mode 100644 index 0000000..219165d --- /dev/null +++ b/sources @@ -0,0 +1 @@ +SHA512 (cli_helpers-0.2.3.tar.gz) = 19d4c1742676436e1d843baffa67446629ead3fb5c151f873b895e2d2a8ccae24c3bd9948900219e72cae4a59c3c35a41ab70f82d97277ffeb0eac142a32ea92