Blame python-black.spec

bd67c1e
%global pypi_name        black
0bc7fdd
%global base_version     20.8
bd67c1e
%global prerel           b0
bd67c1e
%global upstream_version %{base_version}%{?prerel}
33708b5
Name:           python-%{pypi_name}
bd67c1e
Version:        %{base_version}%{?prerel:~%{prerel}}
0bc7fdd
Release:        1%{?dist}
33708b5
Summary:        The uncompromising code formatter
33708b5
License:        MIT
bd67c1e
URL:            https://github.com/psf/black
bd67c1e
Source0:        %{pypi_source %{pypi_name} %{upstream_version}}
111304e
Source1:        black.1
35060e1
Source2:        blackd.1
0bc7fdd
33708b5
BuildArch:      noarch
aa60c12
0bc7fdd
BuildRequires:  python3-devel
bd67c1e
BuildRequires:  pyproject-rpm-macros
33708b5
bd67c1e
%global _description %{expand:
33708b5
Black is the uncompromising Python code formatter. By using it, you agree to
33708b5
cease control over minutiae of hand-formatting. In return, Black gives you
33708b5
speed, determinism, and freedom from pycodestyle nagging about formatting.
bd67c1e
You will save time and mental energy for more important matters.}
bd67c1e
bd67c1e
%description %_description
bd67c1e
33708b5
a6dc783
%package -n     %{pypi_name}
33708b5
Summary:        %{summary}
35060e1
bd67c1e
# extras_require "d"
bd67c1e
Recommends:     python3-aiohttp >= 3.3.2
bd67c1e
Recommends:     python3-aiohttp-cors
a6dc783
a6dc783
# Package was renamed when Fedora 31 was rawhide
a6dc783
# Don't remove this before Fedora 33
a6dc783
Provides:       python3-%{pypi_name} = %{version}-%{release}
bd67c1e
Obsoletes:      python3-%{pypi_name} < 19.4
a6dc783
bd67c1e
%description -n %{pypi_name} %_description
33708b5
33708b5
33708b5
%prep
81e9f2c
%autosetup -n %{pypi_name}-%{upstream_version} -p1
bd67c1e
bd67c1e
%generate_buildrequires
bd67c1e
# d is a name of extras_require
bd67c1e
%pyproject_buildrequires -rx d
bd67c1e
33708b5
33708b5
%build
bd67c1e
%pyproject_wheel
bd67c1e
33708b5
33708b5
%install
bd67c1e
%pyproject_install
0bc7fdd
%pyproject_save_files 'black*' '_black*' blib2to3
bd67c1e
0bc7fdd
for exe in black blackd black-primer; do
0bc7fdd
  ln -sr %{buildroot}%{_bindir}/${exe}{,-%{python3_version}}
0bc7fdd
done
33708b5
111304e
install -D -m 644 %{SOURCE1} %{buildroot}%{_mandir}/man1/black.1
35060e1
install -D -m 644 %{SOURCE2} %{buildroot}%{_mandir}/man1/blackd.1
111304e
bd67c1e
33708b5
%check
aa60c12
export PIP_INDEX_URL=http://host.invalid./
aa60c12
export PIP_NO_DEPS=yes
0bc7fdd
export PYTHONPATH=%{buildroot}%{python3_sitelib}
0bc7fdd
export PATH=%{buildroot}%{_bindir}:$PATH
bd67c1e
%{python3} setup.py test
bd67c1e
33708b5
0bc7fdd
%files -n %{pypi_name} -f %{pyproject_files}
33708b5
%license LICENSE
33708b5
%doc README.md
33708b5
%{_bindir}/black
33708b5
%{_bindir}/black-%{python3_version}
111304e
%{_mandir}/man1/black.1*
35060e1
%{_bindir}/blackd
35060e1
%{_bindir}/blackd-%{python3_version}
35060e1
%{_mandir}/man1/blackd.1*
0bc7fdd
%{_bindir}/black-primer
0bc7fdd
%{_bindir}/black-primer-%{python3_version}
bd67c1e
33708b5
33708b5
%changelog
0bc7fdd
* Wed Aug 26 2020 Miro Hrončok <mhroncok@redhat.com> - 20.8~b0-1
0bc7fdd
- Update to 20.8b0
0bc7fdd
- Fixes rhbz#1872743
0bc7fdd
b6eeed8
* Tue Jul 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 19.10~b0-4
b6eeed8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
b6eeed8
81e9f2c
* Wed Jun 03 2020 Adam Williamson <awilliam@redhat.com> - 19.10~b0-3
88b5180
- Rebuilt for Python 3.9
81e9f2c
- Fix one test and hack up another one for Python 3.9 parser issues
88b5180
0b54cbf
* Thu Jan 30 2020 Fedora Release Engineering <releng@fedoraproject.org> - 19.10~b0-2
0b54cbf
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
0b54cbf
bd67c1e
* Tue Oct 29 2019 Miro Hrončok <mhroncok@redhat.com> - 19.10~b0-1
bd67c1e
- Update to 19.10b0
bd67c1e
29e1955
* Thu Oct 03 2019 Miro Hrončok <mhroncok@redhat.com> - 19.3b0-5
29e1955
- Rebuilt for Python 3.8.0rc1 (#1748018)
29e1955
0843560
* Mon Aug 19 2019 Miro Hrončok <mhroncok@redhat.com> - 19.3b0-4
0843560
- Rebuilt for Python 3.8
0843560
11cec68
* Fri Jul 26 2019 Fedora Release Engineering <releng@fedoraproject.org> - 19.3b0-3
11cec68
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
11cec68
a6dc783
* Wed Apr 03 2019 Miro Hrončok <mhroncok@redhat.com> - 19.3b0-2
a6dc783
- Rename the binary package to black, rhbz#1692117
a6dc783
c3ac4df
* Thu Mar 21 2019 Christian Heimes <cheimes@redhat.com> - 19.3b0-1
c3ac4df
- New upstream release 19.3b0, rhbz#1688957
c3ac4df
660cc6c
* Sat Feb 02 2019 Fedora Release Engineering <releng@fedoraproject.org> - 18.9b0-2
660cc6c
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
660cc6c
35060e1
* Thu Sep 27 2018 Christian Heimes <cheimes@redhat.com> - 18.9b0-1
35060e1
- New upstream version 18.9b0
35060e1
- Include blackd daemon
35060e1
672a03a
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 18.6b4-3
672a03a
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
672a03a
994d2e8
* Mon Jul 02 2018 Miro Hrončok <mhroncok@redhat.com> - 18.6b4-2
994d2e8
- Rebuilt for Python 3.7
994d2e8
06f9719
* Fri Jun 22 2018 Christian Heimes <cheimes@redhat.com> - 18.6b4-1
06f9719
- New upstream release 18.6b4, rhbz#1593485
06f9719
- Remove workaround for missing empty_pyproject.toml
06f9719
197fac0
* Tue Jun 19 2018 Miro Hrončok <mhroncok@redhat.com> - 18.6b2-3
197fac0
- Rebuilt for Python 3.7
197fac0
aa60c12
* Sat Jun 09 2018 Christian Heimes <cheimes@redhat.com> - 18.6b2-2
aa60c12
- Add new build and runtime dependency python3-toml
aa60c12
- Don't download external packages in tests
aa60c12
- Create missing empty_pyproject.toml for tests
aa60c12
4385d0a
* Sat Jun 09 2018 Christian Heimes <cheimes@redhat.com> - 18.6b2-1
4385d0a
- New upstream release 18.6b2, rhbz#1589399
4385d0a
626b9b3
* Wed Jun 06 2018 Christian Heimes <cheimes@redhat.com> - 18.6b1-1
626b9b3
- New upstream release 18.6b1
626b9b3
21af0fe
* Tue May 29 2018 Christian Heimes <cheimes@redhat.com> - 18.5b1-1
21af0fe
- New upstream release 18.5b0, rhbz#1579822
21af0fe
3a58c47
* Fri May 04 2018 Christian Heimes <cheimes@redhat.com> - 18.4a4-2
3a58c47
- Add man page
3a58c47
- Ignore false spelling warnings
3a58c47
33708b5
* Wed May 02 2018 Christian Heimes <cheimes@redhat.com> - 18.4a4-1
33708b5
- Initial package.