%global srcname argcomplete # Currently it's broken: https://github.com/kislyuk/argcomplete/issues/174 %bcond_with check Name: python-%{srcname} Summary: Bash tab completion for argparse Version: 1.9.4 Release: %mkrel 1 Group: Development/Python License: ASL 2.0 URL: https://github.com/kislyuk/argcomplete Source0: https://files.pythonhosted.org/packages/source/a/argcomplete/argcomplete-%{version}.tar.gz BuildArch: noarch %global _description \ Argcomplete provides easy, extensible command line tab completion of\ arguments for your Python script.\ \ It makes two assumptions:\ \ * You are using bash as your shell\ * You are using argparse to manage your command line arguments/options\ \ Argcomplete is particularly useful if your program has lots of\ options or subparsers, and if your program can dynamically suggest\ completions for your argument/option values (for example, if the user\ is browsing resources over the network). %description %{_description} %package -n python2-%{srcname} Summary: %{summary} Group: Development/Python BuildRequires: pkgconfig(python2) BuildRequires: python2dist(setuptools) %if %{with check} BuildRequires: python2dist(pexpect) BuildRequires: tcsh %endif %{?python_provide:%python_provide python2-%{srcname}} %description -n python2-%{srcname} %{_description} %package -n python3-%{srcname} Summary: %{summary} Group: Development/Python BuildRequires: pkgconfig(python3) BuildRequires: python3dist(setuptools) %if %{with check} BuildRequires: python3dist(pexpect) BuildRequires: tcsh %endif %{?python_provide:%python_provide python3-%{srcname}} # pkg_resources module is used from python-argcomplete-check-easy-install-script Requires: python3dist(setuptools) %description -n python3-%{srcname} %{_description} %prep %autosetup -n %{srcname}-%{version} # Drop bundled egg-info rm -rf %{srcname}.egg-info # Remove useless BRs sed -i -r -e '/tests_require = /s/"(coverage|flake8|wheel)"[, ]*//g' setup.py %build %py2_build %py3_build %install %py2_install %py3_install mkdir -p %{buildroot}%{_sysconfdir}/bash_completion.d/ install -p -m0644 %{buildroot}%{python3_sitelib}/%{srcname}/bash_completion.d/python-argcomplete.sh %{buildroot}%{_sysconfdir}/bash_completion.d/ %if %{with check} %check export LC_ALL=C.UTF-8 %{__python2} setup.py test %{__python3} setup.py test %endif %files -n python2-%{srcname} %license LICENSE.rst %doc README.rst %{python2_sitelib}/%{srcname}-*.egg-info/ %{python2_sitelib}/%{srcname}/ %files -n python3-%{srcname} %license LICENSE.rst %doc README.rst %{python3_sitelib}/%{srcname}-*.egg-info/ %{python3_sitelib}/%{srcname}/ %{_bindir}/activate-global-python-argcomplete %{_bindir}/python-argcomplete-check-easy-install-script %{_bindir}/python-argcomplete-tcsh %{_bindir}/register-python-argcomplete %{_sysconfdir}/bash_completion.d/python-argcomplete.sh