]> git.pld-linux.org Git - packages/python3-argcomplete.git/blob - python3-argcomplete.spec
ec224da26359d1f87dd80a458230c346edc845bd
[packages/python3-argcomplete.git] / python3-argcomplete.spec
1 #
2 # Conditional build:
3 %bcond_without  doc     # Sphinx documentation
4 %bcond_with     tests   # unit tests
5
6 %define         module          argcomplete
7 Summary:        Bash tab completion for argparse
8 Summary(pl.UTF-8):      Bashowe dopełnianie parametrów dla argparse
9 Name:           python3-%{module}
10 Version:        2.0.0
11 Release:        1
12 License:        Apache v2.0
13 Group:          Libraries/Python
14 #Source0Download: https://github.com/kislyuk/argcomplete/releases
15 Source0:        https://github.com/kislyuk/argcomplete/archive/v%{version}/%{module}-%{version}.tar.gz
16 # Source0-md5:  57d492ebd86eaa4f24c1c041252b1118
17 URL:            https://github.com/kislyuk/argcomplete
18 %if %(locale -a | grep -q '^C\.utf8$'; echo $?)
19 BuildRequires:  glibc-localedb-all
20 %endif
21 BuildRequires:  python3-devel >= 1:3.6
22 BuildRequires:  python3-setuptools
23 %if %{with tests}
24 %if "%{py3_ver}" < "3.8"
25 BuildRequires:  python3-importlib_metadata >= 0.23
26 BuildRequires:  python3-importlib_metadata < 5
27 %endif
28 BuildRequires:  python3-pexpect
29 %endif
30 BuildRequires:  rpm-pythonprov
31 BuildRequires:  rpmbuild(macros) >= 1.714
32 %if %{with doc}
33 BuildRequires:  python3-guzzle_sphinx_theme
34 BuildRequires:  sphinx-pdg-3
35 %endif
36 %if %{with tests}
37 BuildRequires:  bash
38 BuildRequires:  fish
39 BuildRequires:  pip
40 BuildRequires:  tcsh
41 %endif
42 # pkg_resources module is used from python-argcomplete-check-easy-install-script
43 Requires:       python-setuptools
44 BuildArch:      noarch
45 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
46
47 %description
48 Argcomplete provides easy, extensible command line tab completion of
49 arguments for your Python script.
50
51 It makes two assumptions:
52 - You are using bash as your shell
53 - You are using argparse to manage your command line arguments/options
54
55 Argcomplete is particularly useful if your program has lots of options
56 or subparsers, and if your program can dynamically suggest completions
57 for your argument/option values (for example, if the user is browsing
58 resources over the network).
59
60 %description -l pl.UTF-8
61 Argcomplete zapewnia łatwe, rozszerzalne dopełnianie tabem argumentów
62 scriptów Pythona w wierszu poleceń.
63
64 Czyni dwa założenia:
65 - powłoką jest bash
66 - skrypt używa argparse do zarządzania argumentami/opcjami linii
67   poleceń
68
69 Argcomplete jest przydatne szczególnie wtedy, gdy program ma wiele
70 opcji lub podparserów, albo gdy może dynamicznie podpowiadać
71 dopełnienia wartości argumentów/opcji (np. kiedy użytkownik przegląda
72 zasoby sieciowe).
73
74 %package -n bash-completion-python3-argcomplete
75 Summary:        Bash completion for argparse
76 Summary(pl.UTF-8):      Bashowe dopełnianie parametrów dla argparse
77 Group:          Applications/Shells
78 Requires:       bash-completion >= 2.0
79 Requires:       python3-%{module} = %{version}-%{release}
80 Obsoletes:      bash-completion-python-argcomplete < 2
81
82 %description -n bash-completion-python3-argcomplete
83 Bash completion for argparse based Python scripts.
84
85 %description -n bash-completion-python3-argcomplete -l pl.UTF-8
86 Bashowe dopełnianie parametrów dla skryptów Pythona opartych na
87 argparse.
88
89 %prep
90 %setup -q -n %{module}-%{version}
91
92 %package apidocs
93 Summary:        API documentation for Python argcomplete module
94 Summary(pl.UTF-8):      Dokumentacja API modułu Pythona argcomplete
95 Group:          Documentation
96
97 %description apidocs
98 API documentation for Python argcomplete module.
99
100 %description apidocs -l pl.UTF-8
101 Dokumentacja API modułu Pythona argcomplete.
102
103 %build
104 %py3_build
105
106 %if %{with tests}
107 %{__python3} test/test.py
108 %endif
109
110 %if %{with doc}
111 sphinx-build-3 -b html docs docs/_build/html
112 %endif
113
114 %install
115 rm -rf $RPM_BUILD_ROOT
116
117 %py3_install
118
119 install -d $RPM_BUILD_ROOT%{bash_compdir}
120 cp -p argcomplete/bash_completion.d/python-argcomplete $RPM_BUILD_ROOT%{bash_compdir}
121
122 %clean
123 rm -rf $RPM_BUILD_ROOT
124
125 %files
126 %defattr(644,root,root,755)
127 %doc Authors.rst Changes.rst README.rst
128 %attr(755,root,root) %{_bindir}/activate-global-python-argcomplete
129 %attr(755,root,root) %{_bindir}/python-argcomplete-check-easy-install-script
130 %attr(755,root,root) %{_bindir}/python-argcomplete-tcsh
131 %attr(755,root,root) %{_bindir}/register-python-argcomplete
132 %{py3_sitescriptdir}/argcomplete
133 %{py3_sitescriptdir}/argcomplete-%{version}-py*.egg-info
134
135 %files -n bash-completion-python3-argcomplete
136 %defattr(644,root,root,755)
137 %{bash_compdir}/python-argcomplete
138
139 %if %{with doc}
140 %files apidocs
141 %defattr(644,root,root,755)
142 %doc docs/_build/html/{_static,*.html,*.js}
143 %endif
This page took 0.254465 seconds and 2 git commands to generate.