Properly package flit-core and restore /usr/bin/flit (#1783610)

epel9
Miro Hrončok 5 years ago
parent ca56f65778
commit b940a9ddb5

@ -1,17 +1,12 @@
# These require packages that are built using this package itself.
%global with_loop 0
# cannot enable tests at the moment.
# Need to package requestes_download
%global with_test 0
%global python3_wheelname %{srcname}-%{version}-py3-none-any.whl
%global srcname flit
Name: python-%{srcname}
Version: 2.1.0
Release: 1%{?dist}
Release: 2%{?dist}
Summary: Simplified packaging of Python modules
# ./flit/logo.py under ASL 2.0 license
@ -30,19 +25,20 @@ BuildRequires: python3-pygments
BuildRequires: python3-pytoml
%if 0%{?with_test}
BuildRequires: /usr/bin/python
BuildRequires: python3-pytest
BuildRequires: python3-responses
# Requires flit to build:
BuildRequires: python3-testpath
BuildRequires: python3-requests-download
%endif
# https://pypi.python.org/pypi/tornado
# ./flit/logo.py unkown version
Provides: bundled(python-tornado)
%description
%global _description %{expand:
Flit is a simple way to put Python packages and modules on PyPI.
Flit only creates packages in the new 'wheel' format. People using older
@ -53,35 +49,32 @@ name as the name on PyPI. All sub-packages and data files within a package are
included automatically.
Flit requires Python 3, but you can use it to distribute modules for Python 2,
so long as they can be imported on Python 3.
so long as they can be imported on Python 3.}
%description %_description
%package -n python3-%{srcname}
Summary: %{summary}
%{?python_provide:%python_provide python3-%{srcname}}
Requires: python3-%{srcname}-core = %{version}-%{release}
Requires: python3-requests
Requires: python3-docutils
Requires: python3-pytoml
%if 0%{?with_loop}
Requires: python3-requests-download
%endif
# soft dependency: (WARNING) Cannot analyze code. Pygments package not found.
Recommends: python3-pygments
%description -n python3-%{srcname}
Flit is a simple way to put Python packages and modules on PyPI.
%description -n python3-%{srcname} %_description
Flit only creates packages in the new 'wheel' format. People using older
versions of pip (<1.5) or easy_install will not be able to install them.
Flit packages a single importable module or package at a time, using the import
name as the name on PyPI. All subpackages and data files within a package are
included automatically.
%package -n python3-%{srcname}-core
Summary: PEP 517 build backend for packages using Flit
%{?python_provide:%python_provide python3-%{srcname}-core}
Conflicts: python3-%{srcname} < 2.1.0-2
Flit requires Python 3, but you can use it to distribute modules for Python 2,
so long as they can be imported on Python 3.
%description -n python3-%{srcname}-core
This provides a PEP 517 build backend for packages using Flit.
The only public interface is the API specified by PEP 517,
at flit_core.buildapi.
%prep
@ -89,27 +82,51 @@ so long as they can be imported on Python 3.
%build
export FLIT_NO_NETWORK=1
%py3_build
# first, build flit_core with self
# TODO do it in a less hacky way, this is reconstructed from pyoroject.toml
cd flit_core
PYTHONPATH=$(pwd) %{python3} -c 'from flit_core.build_thyself import build_wheel; build_wheel(".")'
# %%py3_install_wheel unfortunately hardcodes installing from dist/
mkdir ../dist
mv flit_core-%{version}-py2.py3-none-any.whl ../dist
cd -
PYTHONPATH=$(pwd):$(pwd)/flit_core %{python3} -m flit build --format wheel
%install
%py3_install
%py3_install_wheel flit_core-%{version}-py2.py3-none-any.whl
%py3_install_wheel flit-%{version}-py3-none-any.whl
%if 0%{?with_test}
%check
py.test-3
export PYTHONPATH=%{buildroot}%{python3_sitelib}
pytest-3
%endif
%files -n python3-%{srcname}
%license LICENSE
%doc README.rst
%{python3_sitelib}/%{srcname}*egg-info
%{python3_sitelib}/%{srcname}/
%{python3_sitelib}/flit-*.dist-info/
%{python3_sitelib}/flit/
%{_bindir}/flit
%files -n python3-%{srcname}-core
%license LICENSE
%doc flit_core/README.rst
%{python3_sitelib}/flit_core-*.dist-info/
%{python3_sitelib}/flit_core/
%changelog
* Sat Dec 14 2019 Miro Hrončok <mhroncok@redhat.com> - 2.1.0-2
- Properly package flit-core and restore /usr/bin/flit (#1783610)
* Tue Dec 03 2019 Mukundan Ragavan <nonamedotc@fedoraproject.org> - 2.1.0-1
- Update to 2.1.0

Loading…
Cancel
Save