diff --git a/build_dists.py b/build_dists.py new file mode 100644 index 0000000..3cee836 --- /dev/null +++ b/build_dists.py @@ -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)) diff --git a/python-flit-core.changes b/python-flit-core.changes index a29bce4..fdb5538 100644 --- a/python-flit-core.changes +++ b/python-flit-core.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Sun Jan 9 14:53:21 UTC 2022 - Ben Greiner + +- Back to bootstrap without pip + ------------------------------------------------------------------- Sun Jan 9 11:38:59 UTC 2022 - Ben Greiner diff --git a/python-flit-core.spec b/python-flit-core.spec index 4a718a5..221b25c 100644 --- a/python-flit-core.spec +++ b/python-flit-core.spec @@ -31,10 +31,10 @@ Version: 3.6.0 Release: 0 Summary: Distribution-building parts of Flit License: BSD-3-Clause -URL: https://github.com/takluyver/flit -Source: https://files.pythonhosted.org/packages/source/f/flit-core/flit_core-%{version}.tar.gz +URL: https://github.com/pypa/flit +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 pip} %if %{with test} BuildRequires: %{python_module flit-core = %{version}} BuildRequires: %{python_module pytest} @@ -52,13 +52,19 @@ Flit is a simple way to put Python packages and modules on PyPI. %prep %setup -q -n flit_core-%{version} +cp %{SOURCE1} . %build -%pyproject_wheel +# https://flit.readthedocs.io/en/latest/bootstrap.html +python3 build_dists.py %if !%{with test} %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 sed -i 's/from .vendor import tomli/import tomli/' %{buildroot}%{$python_sitelib}/flit_core/config.py rm -r %{buildroot}%{$python_sitelib}/flit_core/vendor @@ -69,7 +75,7 @@ rm -r %{buildroot}%{$python_sitelib}/flit_core/vendor %if %{with test} %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 %pytest -rfEs %endif @@ -78,7 +84,6 @@ rm flit_core/*.py pyproject.toml %files %{python_files} %{python_sitelib}/flit_core %{python_sitelib}/flit_core-%{version}*-info -%exclude %{python_sitelib}/flit_core/tests %endif %changelog