3 %bcond_without python2 # CPython 2.x module
4 %bcond_without python3 # CPython 3.x module
6 %define module ConfigArgParse
7 Summary: A Python module with support for argparse, config files, and env variables
8 Name: python-configargparse
12 Source0: https://pypi.python.org/packages/source/C/%{module}/%{module}-%{version}.tar.gz
13 # Source0-md5: 6d3427dce78a17fb48222538f579bdb8
14 Group: Libraries/Python
15 URL: https://github.com/bw2/ConfigArgParse
16 BuildRequires: rpm-pythonprov
17 BuildRequires: rpmbuild(macros) >= 1.713
19 BuildRequires: python-setuptools
22 BuildRequires: python3-setuptools
25 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
28 Applications with more than a handful of user-settable options are
29 best configured through a combination of command line args, config
30 files, hard coded defaults, and in some cases, environment variables.
32 Python's command line parsing modules such as argparse have very
33 limited support for config files and environment variables, so this
34 module extends argparse to add these features.
36 %package -n python3-configargparse
37 Summary: A Python module with support for argparse, config files, and env variables
38 Group: Libraries/Python
40 %description -n python3-configargparse
41 Applications with more than a handful of user-settable options are
42 best configured through a combination of command line args, config
43 files, hard coded defaults, and in some cases, environment variables.
45 Python's command line parsing modules such as argparse have very
46 limited support for config files and environment variables, so this
47 module extends argparse to add these features.
50 %setup -q -n %{module}-%{version}
61 rm -rf $RPM_BUILD_ROOT
71 rm -rf $RPM_BUILD_ROOT
75 %defattr(644,root,root,755)
76 %doc README.rst LICENSE
77 %{py_sitescriptdir}/configargparse.py[co]
78 %{py_sitescriptdir}/%{module}*.egg-info
82 %files -n python3-configargparse
83 %defattr(644,root,root,755)
84 %doc README.rst LICENSE
85 %{py3_sitescriptdir}/configargparse.py
86 %{py3_sitescriptdir}/%{module}*.egg-info
87 %{py3_sitescriptdir}/__pycache__/configargparse*