#10 BLOCKED: Update to 0.23
Opened 6 months ago by music. Modified a month ago
rpms/ music/python-pint v0.22  into  rawhide

file modified
+6
@@ -7,3 +7,9 @@ 

  /Pint-0.17.tar.gz

  /Pint-0.19.tar.gz

  /Pint-0.19.2.tar.gz

+ /Pint-0.20.tar.gz

+ /Pint-0.20.1.tar.gz

+ /Pint-0.21.tar.gz

+ /Pint-0.21.1.tar.gz

+ /Pint-0.22.tar.gz

+ /Pint-0.23.tar.gz

@@ -1,30 +0,0 @@ 

- From 3cce96928581d5888f4f0b8a7b4ed07e49bcb2e7 Mon Sep 17 00:00:00 2001

- From: "Benjamin A. Beasley" <code@musicinmybrain.net>

- Date: Thu, 4 Jan 2024 08:32:17 -0500

- Subject: [PATCH] Downstream-only: Backport fix for importlib.resources.path

-  removal

- 

- Imitate current versions of flexparser, which was split out as a

- separate library in later releases of pint.

- ---

-  pint/parser.py | 4 +++-

-  1 file changed, 3 insertions(+), 1 deletion(-)

- 

- diff --git a/pint/parser.py b/pint/parser.py

- index e73e578..e1127a2 100644

- --- a/pint/parser.py

- +++ b/pint/parser.py

- @@ -261,7 +261,9 @@ class Parser:

-          it will use python importlib.resources.read_binary

-          """

-  

- -        with resources.path(__package__, resource_name) as p:

- +        with resources.as_file(

- +            resources.files(__package__).joinpath(resource_name)

- +        )as p:

-              filepath = p.resolve()

-  

-          if filepath.exists():

- -- 

- 2.43.0

- 

@@ -0,0 +1,26 @@ 

+ From 50bf3ac0efa88545abac8efe7a3469c9a5cc94b8 Mon Sep 17 00:00:00 2001

+ From: "Benjamin A. Beasley" <code@musicinmybrain.net>

+ Date: Thu, 2 Nov 2023 11:24:32 -0400

+ Subject: [PATCH] Downstream-only: adjust pyproject.toml for unbundling

+ 

+ ---

+  pyproject.toml | 3 +++

+  1 file changed, 3 insertions(+)

+ 

+ diff --git a/pyproject.toml b/pyproject.toml

+ index 4b6b731..25bf09e 100644

+ --- a/pyproject.toml

+ +++ b/pyproject.toml

+ @@ -29,6 +29,9 @@ classifiers = [

+  requires-python = ">=3.9"

+  dynamic = ["version"] # Version is taken from git tags using setuptools_scm

+  dependencies = [

+ +  "appdirs",

+ +  "flexcache",

+ +  "flexparser",

+    "typing_extensions"

+  ]

+  

+ -- 

+ 2.43.0

+ 

@@ -1,25 +0,0 @@ 

- From 9ace880dfa2a57772f1c2cac1316338995baf1fb Mon Sep 17 00:00:00 2001

- From: Justus Magin <keewis@posteo.de>

- Date: Tue, 7 Mar 2023 13:24:37 +0100

- Subject: [PATCH] add `min` and `max` to the array function overrides

- 

- ---

-  pint/numpy_func.py | 2 ++

-  1 file changed, 2 insertions(+)

- 

- diff --git a/pint/numpy_func.py b/pint/numpy_func.py

- index e09decb..ccc99b9 100644

- --- a/pint/numpy_func.py

- +++ b/pint/numpy_func.py

- @@ -805,6 +805,8 @@ for func_str, unit_arguments, wrap_output in [

-      ("broadcast_to", ["array"], True),

-      ("amax", ["a", "initial"], True),

-      ("amin", ["a", "initial"], True),

- +    ("max", ["a", "initial"], True),

- +    ("min", ["a", "initial"], True),

-      ("searchsorted", ["a", "v"], False),

-      ("isclose", ["a", "b"], False),

-      ("nan_to_num", ["x", "nan", "posinf", "neginf"], True),

- -- 

- 2.41.0

- 

@@ -0,0 +1,53 @@ 

+ From 88199175f5fba58cd3a82fa0fbc61d98745ec7ca Mon Sep 17 00:00:00 2001

+ From: Hernan Grecco <hgrecco@gmail.com>

+ Date: Sat, 9 Mar 2024 01:36:59 -0300

+ Subject: [PATCH] fix: cache of decimal and float

+ 

+ ---

+  pint/delegates/base_defparser.py | 13 +++++++++----

+  1 file changed, 9 insertions(+), 4 deletions(-)

+ 

+ diff --git a/pint/delegates/base_defparser.py b/pint/delegates/base_defparser.py

+ index 193b33464..3814c1e00 100644

+ --- a/pint/delegates/base_defparser.py

+ +++ b/pint/delegates/base_defparser.py

+ @@ -14,7 +14,8 @@

+  import itertools

+  import numbers

+  import pathlib

+ -from dataclasses import dataclass, field

+ +from dataclasses import dataclass

+ +from typing import Any

+  

+  from pint import errors

+  from pint.facets.plain.definitions import NotNumeric

+ @@ -72,7 +73,7 @@ class PintParsedStatement(fp.ParsedStatement[ParserConfig]):

+  

+  

+  @functools.lru_cache

+ -def build_disk_cache_class(non_int_type: type):

+ +def build_disk_cache_class(chosen_non_int_type: type):

+      """Build disk cache class, taking into account the non_int_type."""

+  

+      @dataclass(frozen=True)

+ @@ -80,14 +81,18 @@ class PintHeader(fc.InvalidateByExist, fc.NameByFields, fc.BasicPythonHeader):

+          from .. import __version__

+  

+          pint_version: str = __version__

+ -        non_int_type: str = field(default_factory=lambda: non_int_type.__qualname__)

+ +        non_int_type: str = chosen_non_int_type.__qualname__

+  

+ +    @dataclass(frozen=True)

+      class PathHeader(fc.NameByFileContent, PintHeader):

+          pass

+  

+ +    @dataclass(frozen=True)

+      class ParsedProjecHeader(fc.NameByHashIter, PintHeader):

+          @classmethod

+ -        def from_parsed_project(cls, pp: fp.ParsedProject, reader_id):

+ +        def from_parsed_project(

+ +            cls, pp: fp.ParsedProject[Any, ParserConfig], reader_id: str

+ +        ):

+              tmp = (

+                  f"{stmt.content_hash.algorithm_name}:{stmt.content_hash.hexdigest}"

+                  for stmt in pp.iter_statements()

@@ -1,26 +0,0 @@ 

- From b3b18277ecc682bff7ca1fa9e48992f7ec68e47f Mon Sep 17 00:00:00 2001

- From: Hernan Grecco <hgrecco@gmail.com>

- Date: Wed, 12 Jul 2023 20:39:13 -0300

- Subject: [PATCH] Fix test as NumPy 1.25 changes the rules for equality

-  operator

- 

- ---

-  pint/testsuite/test_quantity.py | 5 ++++-

-  1 file changed, 4 insertions(+), 1 deletion(-)

- 

- diff --git a/pint/testsuite/test_quantity.py b/pint/testsuite/test_quantity.py

- index 1843b69ca..7efe74f80 100644

- --- a/pint/testsuite/test_quantity.py

- +++ b/pint/testsuite/test_quantity.py

- @@ -1906,7 +1906,10 @@ def test_equal_zero_nan_NP(self):

-              self.Q_([0, 1, 2], "J") == np.array([0, 0, np.nan]),

-              np.asarray([True, False, False]),

-          )

- -        assert not (self.Q_(np.arange(4), "J") == np.zeros(3))

- +

- +        # This raise an exception on NumPy 1.25 as dimensions

- +        # are different

- +        # assert not (self.Q_(np.arange(4), "J") == np.zeros(3))

-  

-      def test_offset_equal_zero(self):

-          ureg = self.ureg

file modified
+77 -50
@@ -1,5 +1,14 @@ 

+ # Not yet packaged: python-uncertainties

+ %bcond uncertainties 0

+ # Requires babel <= 2.8; F40 has 2.12.1, and current is 2.13.1

+ %bcond babel 0

+ # Not yet packaged: python-pint-pandas

+ %bcond pandas 0

+ # Not yet packaged: python-mip

+ %bcond mip 0

+ 

  Name:           python-pint

- Version:        0.19.2

+ Version:        0.23

  Release:        %autorelease

  Summary:        Physical quantities module

  
@@ -7,41 +16,21 @@ 

  #   - pint/_vendor/appdirs.py is MIT, but is unbundled in %%prep

  #   - pint/_vendor/flexcache.py is also BSD-3-Clause, but is unbundled in

  #     %%prep

+ #   - pint/_vendor/flexparser.py is also BSD-3-Clause, but is unbundled in

+ #     %%prep

  License:        BSD-3-Clause

  URL:            https://github.com/hgrecco/pint

- Source0:        %{pypi_source Pint}

+ Source:         %{pypi_source Pint}

  

- # Fix test as NumPy 1.25 changes the rules for equality operator

- # https://github.com/hgrecco/pint/commit/b3b18277ecc682bff7ca1fa9e48992f7ec68e47f

- #

- # Fixes:

- #

- # test_equal_zero_nan_NP fails with numpy 1.25.1

- # https://github.com/hgrecco/pint/issues/1825

- Patch:          %{url}/commit/b3b18277ecc682bff7ca1fa9e48992f7ec68e47f.patch

+ # Downstream-only: adjust pyproject.toml for unbundling

+ # Adds dependencies on external appdirs, flexcache, and flexparser

+ Patch:          0001-Downstream-only-adjust-pyproject.toml-for-unbundling.patch

  

- # add min and max to the array function overrides

- # https://github.com/hgrecco/pint/commit/1b2b0592f88a1c9fdf9b5649ebade19fa81adea4

+ # fix: cache of decimal and float

+ # https://github.com/hgrecco/pint/commit/88199175f5fba58cd3a82fa0fbc61d98745ec7ca

  #

- # Fixes several failures in TestNumpyUnclassified

- #

- # Cherry-picked to 0.19.

- Patch:          0001-add-min-and-max-to-the-array-function-overrides.patch

- 

- # Downstream-only: Backport fix for importlib.resources.path removal

- #

- # Imitate current versions of flexparser, which was split out as a

- # separate library in later releases of pint.

- #

- # This is resolved in current upstream releases of pint; see

- # https://src.fedoraproject.org/rpms/python-pint/pull-request/10.

- #

- # Fixes:

- #

- # python-pint fails to build with Python 3.13: AttributeError: module

- # 'importlib.resources' has no attribute 'path'

- # https://bugzilla.redhat.com/show_bug.cgi?id=2256746

- Patch:          0001-Downstream-only-Backport-fix-for-importlib.resources.patch

+ # Fixes a test failure with flexcache 0.3.

+ Patch:          %{url}/commit/88199175f5fba58cd3a82fa0fbc61d98745ec7ca.patch

  

  BuildArch:      noarch

  
@@ -58,22 +47,41 @@ 

  %package -n python3-pint

  Summary:        %{summary}

  

+ # Upstream bundles flexparser. We filed

+ # https://github.com/hgrecco/flexparser/issues/5 to convince them to issue a

+ # new release so we can unbundle without using a snapshot, but we need to wait

+ # for pint 0.23 before pint will be compatible with the new flexparser 0.2

+ # release.

+ Provides:       bundled(python3dist(flexparser)) = 0.1^20221026git66b1338

+ 

  %description -n python3-pint %{_description}

  

- # We omit the “uncertainties” extra because python-uncertainties is not yet

- # packaged.

- %pyproject_extras_subpkg -n python3-pint numpy

+ %pyproject_extras_subpkg -n python3-pint numpy xarray dask

+ %if %{with uncertainties}

+ %pyproject_extras_subpkg -n python3-pint uncertainties

+ %endif

+ %if %{with babel}

+ %pyproject_extras_subpkg -n python3-pint babel

+ %endif

+ %if %{with pandas}

+ %pyproject_extras_subpkg -n python3-pint pandas

+ %endif

+ %if %{with mip}

+ %pyproject_extras_subpkg -n python3-pint mip

+ %endif

  

  %prep

  %autosetup -n Pint-%{version} -p1

  

- # We are not sure where this was bundled from, but we are pretty sure it was

- # bundled from somewhere! We are not building HTML documentation, so we do not

- # need it.

- rm -rvf docs/_themes

- 

  # https://docs.fedoraproject.org/en-US/packaging-guidelines/Python/#_linters

- sed -r -i '/pytest-cov/d' setup.cfg

+ sed -r -i '/pytest-cov/d' pyproject.toml

+ 

+ # This module is executable in the source, and it might make sense for upstream

+ # to run it directly as a script during development, but this package will

+ # install it in site-packages without the executable bit set, so it doesn’t

+ # make sense for it to have a shebang. Package users will run it via the

+ # generated pint-convert entry point instead.

+ sed -r -i '1{/^#!/d}' pint/pint_convert.py

  

  # Unbundle python-appdirs

  # http://github.com/ActiveState/appdirs
@@ -83,32 +91,51 @@ 

  # https://github.com/hgrecco/flexcache

  # Provides:       bundled(python3dist(flexcache)) = 0.2

  rm -vf pint/_vendor/flexcache.py

- # Add devendored dependencies back in as regular dependencies

- sed -r -i 's/^setup_requires/install_requires = appdirs; flexcache\n&/' \

-     setup.cfg

+ # Unbundle python-flexparser

+ # https://github.com/hgrecco/flexparser

+ # Provides:       bundled(python3dist(flexparser)) = 0.1^20221026git66b1338

+ rm -vf pint/_vendor/flexparser.py

  # The find-then-modify pattern keeps us from discarding mtimes on sources that

  # do not need modification.

  find pint -type f -exec \

-     gawk '/^from (\.*|pint)\._vendor import (appdirs|flexcache)/ {

+     gawk '/^from (\.*|pint)\._vendor import (appdirs|flex(cache|parser))/ {

          print FILENAME; nextfile }' '{}' '+' |

    xargs -r -t sed -r -i \

        -e 's/^from (\.*|pint)\._vendor (import (appdirs))/\2/' \

-       -e 's/^(from )(\.*|pint)\._vendor( import (flexcache))/\1\4\3/'

+       -e 's/^(from )(\.*|pint)\._vendor( import (flex(cache|parser)))/\1\4\3/'

  

  %generate_buildrequires

- # We omit the “uncertainties” extra because python-uncertainties is not yet

- # packaged.

- %pyproject_buildrequires -x numpy,test

+ %{pyproject_buildrequires \

+     -x numpy \

+ %if %{with uncertainties}

+     -x uncertainties \

+ %endif

+ %if %{with babel}

+     -x babel \

+ %endif

+ %if %{with pandas}

+     -x pandas \

+ %endif

+     -x xarray \

+     -x dask \

+ %if %{with mip}

+     -x mip \

+ %endif

+     -x test}

  

  %build

  %pyproject_wheel

  

  %install

  %pyproject_install

- %pyproject_save_files pint

+ %pyproject_save_files -l pint

  

  %check

- %pytest

+ # Two test failures in pint/testsuite/benchmarks/test_10_registry.py

+ # https://github.com/hgrecco/pint/issues/1898

+ k="${k-}${k+ and }not test_load_definitions_stage_2[None]"

+ k="${k-}${k+ and }not test_load_definitions_stage_2[True]"

+ %pytest -k "${k-}"

  

  %files -n python3-pint -f %{pyproject_files}

  %{_bindir}/pint-convert

file modified
+1 -1
@@ -1,1 +1,1 @@ 

- SHA512 (Pint-0.19.2.tar.gz) = 9f4a00142159d298bf09fdc8ed2c4367a9ef2328663466b43bb4fbc31361c4fa63b1f0d5dec6a71fc5e50ddff22cb86e37abac5e75a13569c5332bb52884c7ee

+ SHA512 (Pint-0.23.tar.gz) = 80abfedab0c2b959c84958ad731a8e03469991b7a3970d99e344b513237b96c764098cdfe9e11f94c4208667fd965bd1cc043d820450d45cbb6a914ee1742ac6

I’m doing this incrementally since there is so much churn across versions.

All of this requires python-flexparser (review request).

1 new commit added

  • Update to 0.20.1
6 months ago

Build failed. More information on how to proceed and troubleshoot errors available at https://fedoraproject.org/wiki/Zuul-based-ci
https://fedora.softwarefactory-project.io/zuul/buildset/ebf38f19ed044a998af86d4b1c7440f6

rebased onto b917acd

5 months ago

1 new commit added

  • Update to 0.21.1
5 months ago

Build failed. More information on how to proceed and troubleshoot errors available at https://fedoraproject.org/wiki/Zuul-based-ci
https://fedora.softwarefactory-project.io/zuul/buildset/e885bdaab513412c9dcccdecf7d1f776

1 new commit added

  • Update to 0.22
5 months ago

Build failed. More information on how to proceed and troubleshoot errors available at https://fedoraproject.org/wiki/Zuul-based-ci
https://fedora.softwarefactory-project.io/zuul/buildset/b28280e6b0fd41f1bee84356990df5a9

This is done now. It just needs the new dependency reviewed:

All of this requires python-flexparser (review request).

Nothing upper-bounds the dependency version:

$ repoquery -q --repo=rawhide{,-source} --requires -a | grep pint | grep '<'
[no output]

COPR impact check looks good (python-xarray was already FTBFS).

Build failed. More information on how to proceed and troubleshoot errors available at https://fedoraproject.org/wiki/Zuul-based-ci
https://fedora.softwarefactory-project.io/zuul/buildset/1294514e973b437fb7a14a3ee03c8b04

1 new commit added

  • Keep bundling flexparser until pint 0.23
5 months ago

Unblocked by temporarily bundling flexparser to avoid packaging a post-release snapshot.

Build succeeded.
https://fedora.softwarefactory-project.io/zuul/buildset/68124b802a77442ca5161ee900902be5

1 new commit added

  • Fix useless shebang in pint/pint_convert.py
5 months ago

Updated to fix rpmlint message:

python3-pint.noarch: E: non-executable-script /usr/lib/python3.12/site-packages/pint/pint_convert.py 644 /usr/bin/env python3

Build succeeded.
https://fedora.softwarefactory-project.io/zuul/buildset/960f05a3e8d24545ad9ce547d1ca09a3

1 new commit added

  • Update to 0.23
4 months ago

Updated to 0.23; blocked on the python-flexparser review again.

Build failed. More information on how to proceed and troubleshoot errors available at https://fedoraproject.org/wiki/Zuul-based-ci
https://fedora.softwarefactory-project.io/zuul/buildset/49282739039c4f4b9a42624b44c4f910

$ repoquery -q --repo=rawhide{,-source} --requires -a | grep pint | grep '<'
(python3.12dist(pint) < 0.20~~ with python3.12dist(pint) >= 0.16.1)
(python3dist(pint) < 0.20~~ with python3dist(pint) >= 0.16.1)
$ fedrq wrsrc python-pint -s | pkgname
cantera
python-OBD
python-qcelemental
python-vulture
python-xarray
tmt
$ repoquery -q --repo=rawhide{,-source} --requires cantera | grep pint
python3-pint
$ repoquery -q --repo=rawhide{,-source} --requires python-OBD | grep pint
python3-pint >= 0.16
$ repoquery -q --repo=rawhide{,-source} --requires python-qcelemental | grep pint
python3dist(pint) >= 0.10
$ repoquery -q --repo=rawhide{,-source} --requires python-vulture | grep pint
python3dist(pint)
$ repoquery -q --repo=rawhide{,-source} --requires python-xarray | grep pint
python3dist(pint) >= 0.16
$ repoquery -q --repo=rawhide{,-source} --requires tmt | grep pint
(python3.12dist(pint) < 0.20~~ with python3.12dist(pint) >= 0.16.1)
(python3dist(pint) < 0.20~~ with python3dist(pint) >= 0.16.1)

So it looks like we need to see if the dependency bound can be loosened in tmt.

So it looks like we need to see if the dependency bound can be loosened in tmt.

Ugh, apparently not. So this PR must remain on hold until tmt upstream catches up.

Build succeeded.
https://fedora.softwarefactory-project.io/zuul/buildset/b58b5997da3e44338e2e4f7531bc0cd0

Build succeeded.
https://fedora.softwarefactory-project.io/zuul/buildset/101da21b44c34e8baf6f8d0a389c692a

The status hasn’t changed, except that https://github.com/teemtee/tmt/issues/2740 now tracks tmt blocking this, and there is some additional work and discussion in https://github.com/teemtee/tmt/pull/2741.

I’m going to rebase this on rawhide and force-push.

rebased onto b998998

a month ago

2 new commits added

  • Assert that the .dist-info directory contains a license file
  • Do not number the sole Source
a month ago

Build succeeded.
https://fedora.softwarefactory-project.io/zuul/buildset/3d91d86457654bbba2b93fab93d3d6b5

1 new commit added

  • Backport fix for cache of decimal of float
a month ago

11 new commits added

  • Backport fix for cache of decimal and float
  • Assert that the .dist-info directory contains a license file
  • Do not number the sole Source
  • Update to 0.23
  • Fix useless shebang in pint/pint_convert.py
  • Keep bundling flexparser until pint 0.23
  • Update to 0.22
  • Update to 0.21.1
  • Update to 0.21
  • Update to 0.20.1
  • Update to 0.20
a month ago

Build succeeded.
https://fedora.softwarefactory-project.io/zuul/buildset/f5776b640cbc4b9885023e13ed32dfc5