From fa14e8153e7adc433b24e4974b5bd03be0fbedd3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Sat, 14 Nov 2015 13:38:14 -0500 Subject: [PATCH] Update to 1.0.0 and new packaging guidelines Other packages should now depend on python2-argcomplete or python3-argcomplete to get the python module, and /usr/bin/register-python-argcomplete to get the script. The bug where the scripts would require /usr/bin/python3 but be in the python2 subpackage is fixed. --- .gitignore | 1 + python-argcomplete.spec | 85 ++++++++++++++++++++++++----------------- sources | 2 +- 3 files changed, 51 insertions(+), 37 deletions(-) diff --git a/.gitignore b/.gitignore index 16afff5..0b2f7cb 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,4 @@ /argcomplete-0.8.1.tar.gz /argcomplete-0.8.8.tar.gz /argcomplete-0.8.9.tar.gz +/argcomplete-1.0.0.tar.gz diff --git a/python-argcomplete.spec b/python-argcomplete.spec index c2e4895..3b9c737 100644 --- a/python-argcomplete.spec +++ b/python-argcomplete.spec @@ -7,8 +7,8 @@ Summary: Bash tab completion for argparse Name: python-argcomplete -Version: 0.8.9 -Release: 4%{?dist} +Version: 1.0.0 +Release: 1%{?dist} License: ASL 2.0 Group: Development/Libraries Url: https://github.com/kislyuk/argcomplete @@ -37,9 +37,32 @@ 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). +%package -n python2-argcomplete +Summary: %{summary} +%if 0%{?with_python3} == 0 +Provides: /usr/bin/register-python-argcomplete +%endif +%{?python_provide:%python_provide python2-argcomplete} + +%description -n python2-argcomplete +Argcomplete provides easy, extensible command line tab completion of +arguments for your Python script. + +It makes two assumptions: + + * You're using bash as your shell + * You're 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). + %if 0%{?with_python3} %package -n python3-argcomplete -Summary: Bash tab completion for argparse +Summary: %{summary} +Provides: /usr/bin/register-python-argcomplete +%{?python_provide:%python_provide python3-argcomplete} %description -n python3-argcomplete Argcomplete provides easy, extensible command line tab completion of @@ -60,56 +83,46 @@ is browsing resources over the network). %prep %setup -n argcomplete-%{version} -q -%if 0%{?with_python3} -rm -rf %{py3dir} -cp -a . %{py3dir} -%endif # with_python3 - %build -python setup.py build - +%py2_build %if 0%{?with_python3} -pushd %{py3dir} -2to3 --write --nobackups . -%{__python3} setup.py build -popd +%py3_build %endif %install +%py2_install %if 0%{?with_python3} -pushd %{py3dir} -%{__python3} setup.py install --skip-build --root %{buildroot} -popd +%py3_install +sed -i '1s|#!/usr/bin/python2|#!%{__python3}|' %{buildroot}%{_bindir}/* %endif -python setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT - - - -%clean -rm -rf $RPM_BUILD_ROOT - -%files -%defattr(-,root,root) -%doc README.rst LICENSE.rst -%{_bindir}/activate-global-python-argcomplete -%{_bindir}/python-argcomplete-check-easy-install-script -%{_bindir}/register-python-argcomplete +%files -n python2-argcomplete +%license LICENSE.rst +%doc README.rst %{python_sitelib}/argcomplete-%{version}-py*.egg-info %{python_sitelib}/argcomplete/ %if 0%{?with_python3} %files -n python3-argcomplete -%doc README.rst LICENSE.rst +%license LICENSE.rst +%doc README.rst %{python3_sitelib}/argcomplete-%{version}-py*.egg-info %{python3_sitelib}/argcomplete/ - %endif - - +%{_bindir}/activate-global-python-argcomplete +%{_bindir}/python-argcomplete-check-easy-install-script +%{_bindir}/register-python-argcomplete %changelog +* Sat Nov 14 2015 Zbigniew Jędrzejewski-Szmek - 1.0.0-1 +- Update to latest version (#1227119) +- Use %license +- Update to new python packaging style +- Remove 2to3 invocation, the code is already python3 compatible +- Move scripts to python3 subpackage +- Add Provides:/usr/bin/register-python-activate so packages can depend on it + * Fri Nov 06 2015 Robert Kuska - 0.8.9-4 - Rebuilt for Python3.5 rebuild @@ -144,13 +157,13 @@ rm -rf $RPM_BUILD_ROOT - Updating package to 0.7.0 * Mon Jan 13 2014 - Dale Macartney 0.6.7-2 -- Removing '%exclude %{python_sitelib}/test' fom %files as no longer needed. +- Removing '%exclude %{python_sitelib}/test' fom %files as no longer needed. * Mon Jan 13 2014 - Dale Macartney 0.6.7-1 - Applying latest patch of argcomplete. * Wed Jan 8 2014 - Dale Macartney 0.6.3-4 -- Pushing new build for update as previous was not picked up. +- Pushing new build for update as previous was not picked up. * Wed Oct 16 2013 - Dale Macartney 0.6.3-3 - Correct missing files for el6 diff --git a/sources b/sources index f1a4b22..7356eff 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -02861a1bd74943edc48741c06e125b6a argcomplete-0.8.9.tar.gz +7cdf147b498e7e4d6ab71036292939a3 argcomplete-1.0.0.tar.gz