From bd67c1e0cea26b3c871e749b9b1ad359bb3858f3 Mon Sep 17 00:00:00 2001 From: Miro Hrončok Date: Oct 29 2019 08:56:48 +0000 Subject: Update to 19.10b0, modernize packaging --- diff --git a/.gitignore b/.gitignore index b25d4ee..dcfa4c8 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ /black-18.6b4.tar.gz /black-18.9b0.tar.gz /black-19.3b0.tar.gz +/black-19.10b0.tar.gz diff --git a/python-black.spec b/python-black.spec index 53e3f40..1e3317a 100644 --- a/python-black.spec +++ b/python-black.spec @@ -1,76 +1,72 @@ -# Created by pyp2rpm-3.2.2 -%global pypi_name black - +%global pypi_name black +%global base_version 19.10 +%global prerel b0 +%global upstream_version %{base_version}%{?prerel} Name: python-%{pypi_name} -Version: 19.3b0 -Release: 5%{?dist} +Version: %{base_version}%{?prerel:~%{prerel}} +Release: 1%{?dist} Summary: The uncompromising code formatter - License: MIT -URL: https://github.com/ambv/black -Source0: https://files.pythonhosted.org/packages/source/b/%{pypi_name}/%{pypi_name}-%{version}.tar.gz +URL: https://github.com/psf/black +Source0: %{pypi_source %{pypi_name} %{upstream_version}} Source1: black.1 Source2: blackd.1 BuildArch: noarch - -BuildRequires: python3-devel -BuildRequires: python3-setuptools -BuildRequires: python3-aiohttp -BuildRequires: python3-appdirs -BuildRequires: python3-attrs >= 17.4.0 -BuildRequires: python3-click >= 6.5 -BuildRequires: python3-toml >= 0.9.4 +BuildRequires: pyproject-rpm-macros -%description +%global _description %{expand: Black is the uncompromising Python code formatter. By using it, you agree to cease control over minutiae of hand-formatting. In return, Black gives you speed, determinism, and freedom from pycodestyle nagging about formatting. -You will save time and mental energy for more important matters. +You will save time and mental energy for more important matters.} + +%description %_description + %package -n %{pypi_name} Summary: %{summary} -Requires: python3-aiohttp -Requires: python3-appdirs -Requires: python3-attrs >= 17.4.0 -Requires: python3-click >= 6.5 -Requires: python3-setuptools -Requires: python3-toml >= 0.9.4 +# extras_require "d" +Recommends: python3-aiohttp >= 3.3.2 +Recommends: python3-aiohttp-cors # Package was renamed when Fedora 31 was rawhide # Don't remove this before Fedora 33 Provides: python3-%{pypi_name} = %{version}-%{release} -Obsoletes: python3-%{pypi_name} < 19.3b0-2 +Obsoletes: python3-%{pypi_name} < 19.4 -%description -n %{pypi_name} -Black is the uncompromising Python code formatter. By using it, you agree to -cease control over minutiae of hand-formatting. In return, Black gives you -speed, determinism, and freedom from pycodestyle nagging about formatting. -You will save time and mental energy for more important matters. +%description -n %{pypi_name} %_description %prep -%autosetup -n %{pypi_name}-%{version} -# Remove bundled egg-info -rm -rf %{pypi_name}.egg-info +%autosetup -n %{pypi_name}-%{upstream_version} + +%generate_buildrequires +# d is a name of extras_require +%pyproject_buildrequires -rx d + %build -%py3_build +%pyproject_wheel + %install -%py3_install -cp %{buildroot}/%{_bindir}/black %{buildroot}/%{_bindir}/black-%{python3_version} -cp %{buildroot}/%{_bindir}/blackd %{buildroot}/%{_bindir}/blackd-%{python3_version} -# ln -s {_bindir}/black-{python3_version} {buildroot}/{_bindir}/black-3 +%pyproject_install + +ln -s ./black %{buildroot}%{_bindir}/black-%{python3_version} +ln -s ./blackd %{buildroot}%{_bindir}/blackd-%{python3_version} +# ln -s ./black-{python3_version} {buildroot}{_bindir}/black-3 install -D -m 644 %{SOURCE1} %{buildroot}%{_mandir}/man1/black.1 install -D -m 644 %{SOURCE2} %{buildroot}%{_mandir}/man1/blackd.1 + %check export PIP_INDEX_URL=http://host.invalid./ export PIP_NO_DEPS=yes -%{__python3} setup.py test +%{python3} setup.py test + %files -n %{pypi_name} %license LICENSE @@ -83,11 +79,17 @@ export PIP_NO_DEPS=yes %{_mandir}/man1/blackd.1* %{python3_sitelib}/__pycache__/black* +%{python3_sitelib}/__pycache__/_black* %{python3_sitelib}/black*.py -%{python3_sitelib}/blib2to3 -%{python3_sitelib}/%{pypi_name}-%{version}-py?.?.egg-info +%{python3_sitelib}/_black*.py +%{python3_sitelib}/blib2to3/ +%{python3_sitelib}/%{pypi_name}-%{upstream_version}.dist-info/ + %changelog +* Tue Oct 29 2019 Miro Hrončok - 19.10~b0-1 +- Update to 19.10b0 + * Thu Oct 03 2019 Miro Hrončok - 19.3b0-5 - Rebuilt for Python 3.8.0rc1 (#1748018) diff --git a/sources b/sources index 0da1f9c..9a2cd59 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (black-19.3b0.tar.gz) = db241d13c76b0c6fd218d9a741adce3c28447140add1346e540d6ba9238fe87bbd9b159fc9c36c685734da57a001144b4dc3a63c868a267aee36ceb4faa1fbc1 +SHA512 (black-19.10b0.tar.gz) = abc6d2623ab50e59bed01fdb7a6ee7434c2d3e0f779a046d9141087aa6ef46b73b3aacc6bf84ac70b9384817bd2c707a3fa262811f11a2f61a99251d2b84dd02