]>
Commit | Line | Data |
---|---|---|
77bea2a5 JB |
1 | # |
2 | # Conditional build: | |
3 | %bcond_without tests # unit tests | |
4 | %bcond_without python2 # CPython 2.x module | |
5 | %bcond_without python3 # CPython 3.x module | |
6 | ||
7 | Summary: pytest plugin to enable format checking with black | |
8 | Summary(pl.UTF-8): Wtyczka pytesta do sprawdzania formatowania przy użyciu modułu black | |
9 | Name: python-pytest-black | |
10 | Version: 0.3.12 | |
3632a400 | 11 | Release: 2 |
77bea2a5 JB |
12 | License: MIT |
13 | Group: Libraries/Python | |
14 | #Source0Download: https://pypi.org/simple/pytest-black/ | |
15 | Source0: https://files.pythonhosted.org/packages/source/p/pytest-black/pytest-black-%{version}.tar.gz | |
16 | # Source0-md5: 5c44840754f9edfb5c775768aa07990a | |
3632a400 | 17 | Patch0: %{name}-pytest.patch |
77bea2a5 JB |
18 | URL: https://pypi.org/project/pytest-black/ |
19 | %if %{with python2} | |
20 | BuildRequires: python-modules >= 1:2.7 | |
21 | BuildRequires: python-setuptools | |
22 | BuildRequires: python-setuptools_scm | |
23 | %if %{with tests} | |
24 | BuildRequires: python-pytest >= 3.5.0 | |
25 | BuildRequires: python-toml | |
26 | %endif | |
27 | %endif | |
28 | %if %{with python3} | |
29 | BuildRequires: python3-modules >= 1:3.6 | |
30 | BuildRequires: python3-setuptools | |
31 | BuildRequires: python3-setuptools_scm | |
32 | %if %{with tests} | |
33 | BuildRequires: python3-black >= 19.3b0 | |
3632a400 | 34 | BuildRequires: python3-pytest >= 6 |
77bea2a5 JB |
35 | BuildRequires: python3-toml |
36 | %endif | |
37 | %endif | |
38 | BuildRequires: rpm-pythonprov | |
39 | BuildRequires: rpmbuild(macros) >= 1.714 | |
40 | Requires: python-modules >= 1:2.7 | |
41 | BuildArch: noarch | |
42 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
43 | ||
44 | %description | |
45 | A pytest plugin to enable format checking with black | |
46 | <https://github.com/ambv/black>. | |
47 | ||
48 | %description -l pl.UTF-8 | |
49 | Wtyczka pytesta do sprawdzania formatowania przy użyciu modułu black | |
50 | <https://github.com/ambv/black>. | |
51 | ||
52 | %package -n python3-pytest-black | |
53 | Summary: pytest plugin to enable format checking with black | |
54 | Summary(pl.UTF-8): Wtyczka pytesta do sprawdzania formatowania przy użyciu modułu black | |
55 | Group: Libraries/Python | |
56 | Requires: python3-modules >= 1:3.6 | |
57 | ||
58 | %description -n python3-pytest-black | |
59 | A pytest plugin to enable format checking with black | |
60 | <https://github.com/ambv/black>. | |
61 | ||
62 | %description -n python3-pytest-black -l pl.UTF-8 | |
63 | Wtyczka pytesta do sprawdzania formatowania przy użyciu modułu black | |
64 | <https://github.com/ambv/black>. | |
65 | ||
66 | %prep | |
67 | %setup -q -n pytest-black-%{version} | |
3632a400 | 68 | %patch0 -p1 |
77bea2a5 JB |
69 | |
70 | %build | |
71 | %if %{with python2} | |
72 | %py_build | |
73 | ||
74 | %if %{with tests} | |
75 | PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \ | |
76 | PYTEST_PLUGINS="pytest_black" \ | |
77 | %{__python} -m pytest tests | |
78 | %endif | |
79 | %endif | |
80 | ||
81 | %if %{with python3} | |
82 | %py3_build | |
83 | ||
84 | %if %{with tests} | |
85 | PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \ | |
86 | PYTEST_PLUGINS="pytest_black" \ | |
87 | %{__python3} -m pytest tests | |
88 | %endif | |
89 | %endif | |
90 | ||
91 | %install | |
92 | rm -rf $RPM_BUILD_ROOT | |
93 | ||
94 | %if %{with python2} | |
95 | %py_install | |
96 | ||
97 | %py_postclean | |
98 | %endif | |
99 | ||
100 | %if %{with python3} | |
101 | %py3_install | |
102 | %endif | |
103 | ||
104 | %clean | |
105 | rm -rf $RPM_BUILD_ROOT | |
106 | ||
107 | %if %{with python2} | |
108 | %files | |
109 | %defattr(644,root,root,755) | |
110 | %doc LICENSE README.md | |
111 | %{py_sitescriptdir}/pytest_black.py[co] | |
112 | %{py_sitescriptdir}/pytest_black-%{version}-py*.egg-info | |
113 | %endif | |
114 | ||
115 | %if %{with python3} | |
116 | %files -n python3-pytest-black | |
117 | %defattr(644,root,root,755) | |
118 | %doc LICENSE README.md | |
119 | %{py3_sitescriptdir}/pytest_black.py | |
120 | %{py3_sitescriptdir}/__pycache__/pytest_black.cpython-*.py[co] | |
121 | %{py3_sitescriptdir}/pytest_black-%{version}-py*.egg-info | |
122 | %endif |