]> git.pld-linux.org Git - packages/python-mccabe.git/blob - python-mccabe.spec
e5253e608bc96549171df64284e3aa97f72aa806
[packages/python-mccabe.git] / python-mccabe.spec
1 #
2 # Conditional build:
3 %bcond_without  tests   # test target
4 %bcond_without  python2 # CPython 2.x module
5 %bcond_without  python3 # CPython 3.x module
6
7 %define         module  mccabe
8 Summary:        McCabe checker, plugin for flake8
9 Summary(pl.UTF-8):      Wtyczka flake8 do sprawdzania złożoności McCabe'a
10 Name:           python-%{module}
11 # keep 0.6.x here for python2 support and flake8 compatibility
12 Version:        0.6.1
13 Release:        4
14 License:        Expat/MIT
15 Group:          Libraries/Python
16 #Source0Download: https://pypi.org/simple/mccabe/
17 Source0:        https://files.pythonhosted.org/packages/source/m/mccabe/mccabe-%{version}.tar.gz
18 # Source0-md5:  723df2f7b1737b8887475bac4c763e1e
19 URL:            https://github.com/pycqa/mccabe
20 BuildRequires:  rpm-pythonprov
21 BuildRequires:  rpmbuild(macros) >= 1.714
22 %if %{with python2}
23 BuildRequires:  python-devel >= 1:2.7
24 BuildRequires:  python-pytest-runner
25 BuildRequires:  python-setuptools
26 %if %{with tests}
27 BuildRequires:  python-pytest
28 %endif
29 %endif
30 %if %{with python3}
31 BuildRequires:  python3-devel >= 1:3.3
32 BuildRequires:  python3-pytest-runner
33 BuildRequires:  python3-setuptools
34 %if %{with tests}
35 BuildRequires:  python3-pytest
36 %endif
37 %endif
38 Requires:       python-modules >= 1:2.7
39 BuildArch:      noarch
40 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
41
42 %description
43 Ned's script to check McCabe complexity.
44
45 %description -l pl.UTF-8
46 Skrypt Neda do sprawdzania złożoności McCabe'a (cyklomatycznej).
47
48 %package -n python3-%{module}
49 Summary:        McCabe checker, plugin for flake8
50 Summary(pl.UTF-8):      Wtyczka flake8 do sprawdzania złożoności McCabe'a
51 Group:          Libraries/Python
52 Requires:       python3-modules >= 1:3.3
53
54 %description -n python3-%{module}
55 Ned's script to check McCabe complexity.
56
57 %description -n python3-%{module} -l pl.UTF-8
58 Skrypt Neda do sprawdzania złożoności McCabe'a (cyklomatycznej).
59
60 %prep
61 %setup -q -n %{module}-%{version}
62
63 %build
64 %if %{with python2}
65 %py_build
66
67 %if %{with tests}
68 PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
69 %{__python} -m pytest test_mccabe.py
70 %endif
71 %endif
72
73 %if %{with python3}
74 %py3_build
75
76 %if %{with tests}
77 PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
78 %{__python3} -m pytest test_mccabe.py
79 %endif
80 %endif
81
82 %install
83 rm -rf $RPM_BUILD_ROOT
84
85 %if %{with python2}
86 %py_install
87
88 %py_postclean
89 %endif
90
91 %if %{with python3}
92 %py3_install
93 %endif
94
95 %clean
96 rm -rf $RPM_BUILD_ROOT
97
98 %if %{with python2}
99 %files
100 %defattr(644,root,root,755)
101 %doc LICENSE README.rst
102 %{py_sitescriptdir}/mccabe.py[co]
103 %{py_sitescriptdir}/mccabe-%{version}-py*.egg-info
104 %endif
105
106 %if %{with python3}
107 %files -n python3-%{module}
108 %defattr(644,root,root,755)
109 %doc LICENSE README.rst
110 %{py3_sitescriptdir}/mccabe.py
111 %{py3_sitescriptdir}/__pycache__/mccabe.cpython-*.py[co]
112 %{py3_sitescriptdir}/mccabe-%{version}-py*.egg-info
113 %endif
This page took 0.068599 seconds and 2 git commands to generate.