]> git.pld-linux.org Git - packages/python-pytest-black.git/blame - python-pytest-black.spec
- added pytest patch (adjust black tests for pytest 6); release 2
[packages/python-pytest-black.git] / python-pytest-black.spec
CommitLineData
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
7Summary: pytest plugin to enable format checking with black
8Summary(pl.UTF-8): Wtyczka pytesta do sprawdzania formatowania przy użyciu modułu black
9Name: python-pytest-black
10Version: 0.3.12
3632a400 11Release: 2
77bea2a5
JB
12License: MIT
13Group: Libraries/Python
14#Source0Download: https://pypi.org/simple/pytest-black/
15Source0: https://files.pythonhosted.org/packages/source/p/pytest-black/pytest-black-%{version}.tar.gz
16# Source0-md5: 5c44840754f9edfb5c775768aa07990a
3632a400 17Patch0: %{name}-pytest.patch
77bea2a5
JB
18URL: https://pypi.org/project/pytest-black/
19%if %{with python2}
20BuildRequires: python-modules >= 1:2.7
21BuildRequires: python-setuptools
22BuildRequires: python-setuptools_scm
23%if %{with tests}
24BuildRequires: python-pytest >= 3.5.0
25BuildRequires: python-toml
26%endif
27%endif
28%if %{with python3}
29BuildRequires: python3-modules >= 1:3.6
30BuildRequires: python3-setuptools
31BuildRequires: python3-setuptools_scm
32%if %{with tests}
33BuildRequires: python3-black >= 19.3b0
3632a400 34BuildRequires: python3-pytest >= 6
77bea2a5
JB
35BuildRequires: python3-toml
36%endif
37%endif
38BuildRequires: rpm-pythonprov
39BuildRequires: rpmbuild(macros) >= 1.714
40Requires: python-modules >= 1:2.7
41BuildArch: noarch
42BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
43
44%description
45A pytest plugin to enable format checking with black
46<https://github.com/ambv/black>.
47
48%description -l pl.UTF-8
49Wtyczka pytesta do sprawdzania formatowania przy użyciu modułu black
50<https://github.com/ambv/black>.
51
52%package -n python3-pytest-black
53Summary: pytest plugin to enable format checking with black
54Summary(pl.UTF-8): Wtyczka pytesta do sprawdzania formatowania przy użyciu modułu black
55Group: Libraries/Python
56Requires: python3-modules >= 1:3.6
57
58%description -n python3-pytest-black
59A 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
63Wtyczka 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}
75PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
76PYTEST_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}
85PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
86PYTEST_PLUGINS="pytest_black" \
87%{__python3} -m pytest tests
88%endif
89%endif
90
91%install
92rm -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
105rm -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
This page took 0.217552 seconds and 4 git commands to generate.