Accepting request 945128 from home:bnavigator:branches:devel:languages:python
- Back to bootstrap without pip OBS-URL: https://build.opensuse.org/request/show/945128 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-flit-core?expand=0&rev=19
This commit is contained in:
parent
9ebd211418
commit
5b2c36e178
17
build_dists.py
Normal file
17
build_dists.py
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
"""Build flit_core to upload to PyPI.
|
||||||
|
|
||||||
|
Normally, this should only be used by me when making a release.
|
||||||
|
"""
|
||||||
|
import os
|
||||||
|
|
||||||
|
from flit_core import buildapi
|
||||||
|
|
||||||
|
os.chdir(os.path.dirname(os.path.abspath(__file__)))
|
||||||
|
|
||||||
|
print("Building sdist")
|
||||||
|
sdist_fname = buildapi.build_sdist('dist/')
|
||||||
|
print(os.path.join('dist', sdist_fname))
|
||||||
|
|
||||||
|
print("\nBuilding wheel")
|
||||||
|
whl_fname = buildapi.build_wheel('dist/')
|
||||||
|
print(os.path.join('dist', whl_fname))
|
@ -1,3 +1,8 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Sun Jan 9 14:53:21 UTC 2022 - Ben Greiner <code@bnavigator.de>
|
||||||
|
|
||||||
|
- Back to bootstrap without pip
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Sun Jan 9 11:38:59 UTC 2022 - Ben Greiner <code@bnavigator.de>
|
Sun Jan 9 11:38:59 UTC 2022 - Ben Greiner <code@bnavigator.de>
|
||||||
|
|
||||||
|
@ -31,10 +31,10 @@ Version: 3.6.0
|
|||||||
Release: 0
|
Release: 0
|
||||||
Summary: Distribution-building parts of Flit
|
Summary: Distribution-building parts of Flit
|
||||||
License: BSD-3-Clause
|
License: BSD-3-Clause
|
||||||
URL: https://github.com/takluyver/flit
|
URL: https://github.com/pypa/flit
|
||||||
Source: https://files.pythonhosted.org/packages/source/f/flit-core/flit_core-%{version}.tar.gz
|
Source0: https://files.pythonhosted.org/packages/source/f/flit-core/flit_core-%{version}.tar.gz
|
||||||
|
Source1: https://github.com/pypa/flit/raw/%{version}/flit_core/build_dists.py
|
||||||
BuildRequires: %{python_module base >= 3.6}
|
BuildRequires: %{python_module base >= 3.6}
|
||||||
BuildRequires: %{python_module pip}
|
|
||||||
%if %{with test}
|
%if %{with test}
|
||||||
BuildRequires: %{python_module flit-core = %{version}}
|
BuildRequires: %{python_module flit-core = %{version}}
|
||||||
BuildRequires: %{python_module pytest}
|
BuildRequires: %{python_module pytest}
|
||||||
@ -52,13 +52,19 @@ Flit is a simple way to put Python packages and modules on PyPI.
|
|||||||
|
|
||||||
%prep
|
%prep
|
||||||
%setup -q -n flit_core-%{version}
|
%setup -q -n flit_core-%{version}
|
||||||
|
cp %{SOURCE1} .
|
||||||
|
|
||||||
%build
|
%build
|
||||||
%pyproject_wheel
|
# https://flit.readthedocs.io/en/latest/bootstrap.html
|
||||||
|
python3 build_dists.py
|
||||||
|
|
||||||
%if !%{with test}
|
%if !%{with test}
|
||||||
%install
|
%install
|
||||||
%pyproject_install
|
%{python_expand # do manually what pip would do
|
||||||
|
mkdir -p %{buildroot}%{$python_sitelib}
|
||||||
|
unzip dist/flit_core-%{version}-py3-none-any.whl -d %{buildroot}%{$python_sitelib}
|
||||||
|
rm -r %{buildroot}%{$python_sitelib}/flit_core/tests
|
||||||
|
}
|
||||||
%{python_expand # debundle after the bootstrap. See vendor/README
|
%{python_expand # debundle after the bootstrap. See vendor/README
|
||||||
sed -i 's/from .vendor import tomli/import tomli/' %{buildroot}%{$python_sitelib}/flit_core/config.py
|
sed -i 's/from .vendor import tomli/import tomli/' %{buildroot}%{$python_sitelib}/flit_core/config.py
|
||||||
rm -r %{buildroot}%{$python_sitelib}/flit_core/vendor
|
rm -r %{buildroot}%{$python_sitelib}/flit_core/vendor
|
||||||
@ -69,7 +75,7 @@ rm -r %{buildroot}%{$python_sitelib}/flit_core/vendor
|
|||||||
|
|
||||||
%if %{with test}
|
%if %{with test}
|
||||||
%check
|
%check
|
||||||
# make sure we do not test the debundled sources
|
# make sure we do not test the sources but the debundled package
|
||||||
rm flit_core/*.py pyproject.toml
|
rm flit_core/*.py pyproject.toml
|
||||||
%pytest -rfEs
|
%pytest -rfEs
|
||||||
%endif
|
%endif
|
||||||
@ -78,7 +84,6 @@ rm flit_core/*.py pyproject.toml
|
|||||||
%files %{python_files}
|
%files %{python_files}
|
||||||
%{python_sitelib}/flit_core
|
%{python_sitelib}/flit_core
|
||||||
%{python_sitelib}/flit_core-%{version}*-info
|
%{python_sitelib}/flit_core-%{version}*-info
|
||||||
%exclude %{python_sitelib}/flit_core/tests
|
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
Loading…
Reference in New Issue
Block a user