%global srcname easyargs
%bcond_without tests
Name: python-%{srcname}
Version: 0.9.4
Release: 3%{?dist}
Summary: Making argument parsing easy
License: MIT
URL: https://pypi.python.org/pypi/%{srcname}
Source0: https://files.pythonhosted.org/packages/source/%(cut -c1 <<< %{srcname})/%{srcname}/%{srcname}-%{version}.tar.gz
BuildArch: noarch
%description
A project designed to make command line argument parsing easy. There are many
ways to create a command line parser in python: argparse, docopt, click. These
are all great options, but require quite a lot of configuration and sometimes
you just need a function to be called. Enter easyargs. Define the function
that you want to be called, decorate it and let easyargs work out the command
line.
%package -n python2-%{srcname}
Summary: Making argument parsing easy
BuildRequires: python2-devel
BuildRequires: python%{?fedora:2}-setuptools
%if %{with tests}
BuildRequires: %{?fedora:python2-}pytest
BuildRequires: python2-mock
BuildRequires: python%{?fedora:2}-six
%endif
Requires: python%{?fedora:2}-six
%{?python_provide:%python_provide python2-%{srcname}}
%description -n python2-%{srcname}
A project designed to make command line argument parsing easy. There are many
ways to create a command line parser in python: argparse, docopt, click. These
are all great options, but require quite a lot of configuration and sometimes
you just need a function to be called. Enter easyargs. Define the function
that you want to be called, decorate it and let easyargs work out the command
line.
%package -n python%{python3_pkgversion}-%{srcname}
Summary: Making argument parsing easy
BuildRequires: python%{python3_pkgversion}-devel
BuildRequires: python%{python3_pkgversion}-setuptools
%if %{with tests}
BuildRequires: python%{python3_pkgversion}-pytest
BuildRequires: python%{python3_pkgversion}-mock
BuildRequires: python%{python3_pkgversion}-six
%endif
Requires: python%{python3_pkgversion}-six
%{?python_provide:%python_provide python%{python3_pkgversion}-%{srcname}}
%description -n python%{python3_pkgversion}-%{srcname}
A project designed to make command line argument parsing easy. There are many
ways to create a command line parser in python: argparse, docopt, click. These
are all great options, but require quite a lot of configuration and sometimes
you just need a function to be called. Enter easyargs. Define the function
that you want to be called, decorate it and let easyargs work out the command
line.
%prep
%autosetup -n %{srcname}-%{version}
find -name \*.py | xargs sed -i -e '1 {/^#!/d}'
%build
%py2_build
%py3_build
%install
%py2_install
%py3_install
%if %{with tests}
%check
%{__python2} -m pytest -v
%{__python3} -m pytest -v
%endif
%files -n python2-%{srcname}
%license LICENSE.txt
%doc README.rst
%{python2_sitelib}/*
%files -n python%{python3_pkgversion}-%{srcname}
%license LICENSE.txt
%doc README.rst
%{python3_sitelib}/*
%changelog
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.9.4-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
* Thu Aug 17 2017 Carl George <carl@george.computer> - 0.9.4-2
- Correct misplaced six requirement
* Thu Jul 06 2017 Carl George <carl@george.computer> - 0.9.4-1
- Initial package