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. # cannot enable tests at the moment.
# Need to package requestes_download # Need to package requestes_download
%global with_test 0 %global with_test 0
%global python3_wheelname %{srcname}-%{version}-py3-none-any.whl
%global srcname flit %global srcname flit
Name: python-%{srcname} Name: python-%{srcname}
Version: 2.1.0 Version: 2.1.0
Release: 1%{?dist} Release: 2%{?dist}
Summary: Simplified packaging of Python modules Summary: Simplified packaging of Python modules
# ./flit/logo.py under ASL 2.0 license # ./flit/logo.py under ASL 2.0 license
@ -30,19 +25,20 @@ BuildRequires: python3-pygments
BuildRequires: python3-pytoml BuildRequires: python3-pytoml
%if 0%{?with_test} %if 0%{?with_test}
BuildRequires: /usr/bin/python
BuildRequires: python3-pytest BuildRequires: python3-pytest
BuildRequires: python3-responses BuildRequires: python3-responses
# Requires flit to build: # Requires flit to build:
BuildRequires: python3-testpath BuildRequires: python3-testpath
BuildRequires: python3-requests-download
%endif %endif
# https://pypi.python.org/pypi/tornado # https://pypi.python.org/pypi/tornado
# ./flit/logo.py unkown version # ./flit/logo.py unkown version
Provides: bundled(python-tornado) Provides: bundled(python-tornado)
%description %global _description %{expand:
Flit is a simple way to put Python packages and modules on PyPI. 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 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. included automatically.
Flit requires Python 3, but you can use it to distribute modules for Python 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. so long as they can be imported on Python 3.}
%description %_description
%package -n python3-%{srcname} %package -n python3-%{srcname}
Summary: %{summary} Summary: %{summary}
%{?python_provide:%python_provide python3-%{srcname}} %{?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. # soft dependency: (WARNING) Cannot analyze code. Pygments package not found.
Recommends: python3-pygments Recommends: python3-pygments
%description -n python3-%{srcname} %description -n python3-%{srcname} %_description
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
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 %package -n python3-%{srcname}-core
name as the name on PyPI. All subpackages and data files within a package are Summary: PEP 517 build backend for packages using Flit
included automatically. %{?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, %description -n python3-%{srcname}-core
so long as they can be imported on Python 3. 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 %prep
@ -89,27 +82,51 @@ so long as they can be imported on Python 3.
%build %build
export FLIT_NO_NETWORK=1 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 %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} %if 0%{?with_test}
%check %check
py.test-3 export PYTHONPATH=%{buildroot}%{python3_sitelib}
pytest-3
%endif %endif
%files -n python3-%{srcname} %files -n python3-%{srcname}
%license LICENSE %license LICENSE
%doc README.rst %doc README.rst
%{python3_sitelib}/%{srcname}*egg-info %{python3_sitelib}/flit-*.dist-info/
%{python3_sitelib}/%{srcname}/ %{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 %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 * Tue Dec 03 2019 Mukundan Ragavan <nonamedotc@fedoraproject.org> - 2.1.0-1
- Update to 2.1.0 - Update to 2.1.0

Loading…
Cancel
Save