#17 Adjust bootstrap mode for pyparsing 3.0.9
Closed a year ago by churchyard. Opened 2 years ago by thrnciar.
rpms/ thrnciar/pyparsing bootstrap  into  rawhide

file modified
+15 -22
@@ -1,11 +1,7 @@ 

  %global srcname pyparsing

Side note: I've noticed %srcname is only used in %python_provide. Let's remove both (in a separate commit)?

  

- # when bootstrapping Python 3, pyparsing needs to be rebuilt before dependency generator is available

- %bcond_with bootstrap

- %if %{without bootstrap}

- %global build_wheel 1

- %global python_wheelname %{srcname}-%{version}-py2.py3-none-any.whl

- %endif

+ # when bootstrapping Python 3, pyparsing needs to be rebuilt before dependency generator and pip is available

+ %bcond bootstrap 0

  

  

  Summary:        Python package with an object-oriented approach to text processing
@@ -19,19 +15,16 @@ 

  

  BuildArch:      noarch

  BuildRequires:  dos2unix

+ BuildRequires:  unzip

technically, unzip is only needed when bootstrapping, but it's not that important considering it is installed by default anyway.

  BuildRequires:  python%{python3_pkgversion}-devel

- BuildRequires:  python%{python3_pkgversion}-setuptools

+ BuildRequires:  python%{python3_pkgversion}-flit-core

same with flit-core, when not bootstrapping, the dependency shall be generated, but having it also manually specified is not a big deal

  

  %if %{without bootstrap}

  BuildRequires:  python%{python3_pkgversion}-sphinx

- %endif

- 

- %if 0%{?build_wheel}

  BuildRequires:  python%{python3_pkgversion}-pip

  BuildRequires:  python%{python3_pkgversion}-wheel

OTOH when without bootstrap, we should not need to manually BR either pip or wheel. pip is pulled in by the generation and wheel is no longer used with flit.

- %endif

- 

  BuildRequires:  python%{python3_pkgversion}-pytest

+ %endif

  

  %description

  pyparsing is a module that can be used to easily and directly configure syntax
@@ -76,19 +69,16 @@ 

  dos2unix -k examples/*

  

  

- %if 0%{?build_wheel}

+ %if %{without bootstrap}

  %generate_buildrequires

  %pyproject_buildrequires -t

  %endif

  

  %build

- %if 0%{?build_wheel}

- %pyproject_wheel

+ %if %{with bootstrap}

+ %{python3} -m flit_core.wheel

  %else

- %py3_build

- %endif

- 

- %if %{without bootstrap}

+ %pyproject_wheel

  # build docs

  pushd docs

  # Theme is not available
@@ -98,15 +88,18 @@ 

  %endif

  

  %install

- %if 0%{?build_wheel}

- %pyproject_install

+ %if %{with bootstrap}

+ mkdir -p %{buildroot}%{python3_sitelib}

+ unzip dist/pyparsing-%{version}-py3-none-any.whl -d %{buildroot}%{python3_sitelib} -x pyparsing-%{version}.dist-info/RECORD

  %else

- %py3_install

+ %pyproject_install

  %endif

  

  

+ %if %{without bootstrap}

  %check

  %pytest -v

+ %endif

  

  

  %files -n python%{python3_pkgversion}-pyparsing

no initial comment

Build succeeded.

Bootstrap bcond (besides the other changes) currently disables the tests and docs. Especially dependencies for documentation will be available quite late. I wonder if it's okay or if I should add a special bcond for tests and/or docs (I would prefer not to do that). @churchyard WDYT?

Bootstrap bcond (besides the other changes) currently disables the tests and docs. Especially dependencies for documentation will be available quite late. I wonder if it's okay or if I should add a special bcond for tests and/or docs (I would prefer not to do that). @churchyard WDYT?

I would not do that either.

rebased onto 4163204

2 years ago

Build succeeded.

Is mkdir -p %{buildroot}%{python3_sitelib} not enough?

Let's BuildRequire unzip explicitly, please. It is in the default buildroot now, due to being in the buildsys-build comps group, but explicit is better than implicit.

The docs %if can be merged to the previous %else branch.

Build succeeded.

rebased onto 1b50595

2 years ago

Is mkdir -p %{buildroot}%{python3_sitelib} not enough?

Yup, it was enough. I've updated the PR.

Build succeeded.

Considering a new version of packaging without a dependency on pyparsing is to be released soon, I think we can leave this unmerged for now.

The new packaging release is stalled as the new parser has some serious regression, so I'll review this and we can revert later once the release actually happens.

technically, unzip is only needed when bootstrapping, but it's not that important considering it is installed by default anyway.

same with flit-core, when not bootstrapping, the dependency shall be generated, but having it also manually specified is not a big deal

OTOH when without bootstrap, we should not need to manually BR either pip or wheel. pip is pulled in by the generation and wheel is no longer used with flit.

Side note: I've noticed %srcname is only used in %python_provide. Let's remove both (in a separate commit)?

Interestingly I've also noted that %pyproject_buildrequires -t bring in coverage via tox and not pytest. Upstream uses tox to run coverage+unittests. We should:

  • drop -t as it only adds coverage dependency which is undesired
  • consider using %{pytohon3} -m unittest instead of pytest to run the tests even when bootstrapping (and drop the dependency on pytest, if it works)

New packaging was actually released, so we might not need this. https://bugzilla.redhat.com/show_bug.cgi?id=2151743

Pull-Request has been closed by churchyard

a year ago
Metadata