From 3415c08e43ec6c6d320fe0901ac2969c51e26a0a Mon Sep 17 00:00:00 2001 From: mcepl <> Date: Tue, 20 Feb 2024 20:15:01 +0000 Subject: [PATCH] Update python-nptyping to version 2.5.0 / rev 4 via SR 1147711 https://build.opensuse.org/request/show/1147711 by user mcepl + anag+factory - Did the upstream just released different tarball with the same version number? Yes, they did! - Rebased patches - Update to 2.5.0 * Added the column wildcard in structure expressions to allow expressing 'a structure with at least ...'. * Fixed the help text for functions that use nptyping types as hints. * Fixed the distribution of dataframe.pyi that was missing. * Fixed the sdist to include tests and dependencies. - Fix the test suite. * The -k parameter for unittests does not know negative patterns * Don't test with beartype and typeguard: gh#ramonhagenaars/nptyping#115 * Drop skip-pyright-tests.patch, delete file instead * Drop skip_pandas.patch. --- .files | Bin 377 -> 315 bytes .rev | 24 +++++++++++++ nptyping-2.4.1.tar.gz | 1 - nptyping-2.5.0.tar.gz | 1 + python-nptyping.changes | 24 +++++++++++++ python-nptyping.spec | 50 ++++++++++++++++----------- skip-pyright-tests.patch | 30 ---------------- skip_on_other_archs.patch | 34 +++++++++--------- use_system_packages.patch | 71 ++++++++++++++++++++------------------ 9 files changed, 134 insertions(+), 101 deletions(-) delete mode 120000 nptyping-2.4.1.tar.gz create mode 120000 nptyping-2.5.0.tar.gz delete mode 100644 skip-pyright-tests.patch diff --git a/.files b/.files index 952762892300830257e884d3c3bb2432e15ba36b..51784f4e696722913f69c25e7c316c5a9ef0e0f0 100644 GIT binary patch literal 315 zcmZ9_%WA_g5QSkw$;RuJ(w$!*LK^G(G-fm!#UaENmb!4CzAChv?$3ArQk%StFT*fg z#!32^Qq0-ntg>Sb$pj{qv{xZXHhuNBm3EfZ`Z#EK`U-IuH!U=j6otJ1F(*0w9YxAV<5|O=8iu;D=+n|jh{~D?D_+(oOkjymE$)WL)*KN7BmG=dATI*b}(K?JClSz(M;2<<6 zEhHJ2OiTbeMaNzKw3T+0%XXgRtYFlMh5MK6u^1{F)qj+`aUO7srVcIk6D z+IrolUx%4i+|FEwQE|$eeFW)L4q9SFm2Ebhwdppu+K>OmwJ;4M$&^C0oGC!|)_dJU z(Gdb_!QZhjH{hup`{lg0sc~(8ya{c}iNVLtEFcKm4^XH;BFPB1xjrf{^{9>CmxA<$ Iz3|UmU(thaH~;_u diff --git a/.rev b/.rev index bc771227739..588d5595f00 100644 --- a/.rev +++ b/.rev @@ -39,4 +39,28 @@ 1041858 + + d314ae55cb7bc7e026f09e876ef4eb1b + 2.5.0 + + anag+factory + - Did the upstream just released different tarball with the same + version number? Yes, they did! +- Rebased patches +- Update to 2.5.0 + * Added the column wildcard in structure expressions to allow + expressing 'a structure with at least ...'. + * Fixed the help text for functions that use nptyping types as + hints. + * Fixed the distribution of dataframe.pyi that was missing. + * Fixed the sdist to include tests and dependencies. +- Fix the test suite. + * The -k parameter for unittests does not know negative patterns + * Don't test with beartype and typeguard: + gh#ramonhagenaars/nptyping#115 + * Drop skip-pyright-tests.patch, delete file instead + * Drop skip_pandas.patch. + + 1147711 + diff --git a/nptyping-2.4.1.tar.gz b/nptyping-2.4.1.tar.gz deleted file mode 120000 index 6c4fd614c35..00000000000 --- a/nptyping-2.4.1.tar.gz +++ /dev/null @@ -1 +0,0 @@ -/ipfs/bafkreia4dmvqqiqne4pt4uw36k6zdehe3uk3hqckx7hxubhmkm6tzsp5vm \ No newline at end of file diff --git a/nptyping-2.5.0.tar.gz b/nptyping-2.5.0.tar.gz new file mode 120000 index 00000000000..b9af0240801 --- /dev/null +++ b/nptyping-2.5.0.tar.gz @@ -0,0 +1 @@ +/ipfs/bafkreihd2nnvhl4wpzx3ib6dafx7tk5osvgtubli67gbhjdbbbbcj2hcbi \ No newline at end of file diff --git a/python-nptyping.changes b/python-nptyping.changes index 62c4496b4a9..1cc72cc4e26 100644 --- a/python-nptyping.changes +++ b/python-nptyping.changes @@ -1,3 +1,27 @@ +------------------------------------------------------------------- +Tue Feb 20 08:10:28 UTC 2024 - Matej Cepl + +- Did the upstream just released different tarball with the same + version number? Yes, they did! +- Rebased patches + +------------------------------------------------------------------- +Fri Feb 16 12:21:58 UTC 2024 - Ben Greiner + +- Update to 2.5.0 + * Added the column wildcard in structure expressions to allow + expressing 'a structure with at least ...'. + * Fixed the help text for functions that use nptyping types as + hints. + * Fixed the distribution of dataframe.pyi that was missing. + * Fixed the sdist to include tests and dependencies. +- Fix the test suite. + * The -k parameter for unittests does not know negative patterns + * Don't test with beartype and typeguard: + gh#ramonhagenaars/nptyping#115 + * Drop skip-pyright-tests.patch, delete file instead + * Drop skip_pandas.patch. + ------------------------------------------------------------------- Fri Dec 9 11:44:19 UTC 2022 - Daniel Garcia diff --git a/python-nptyping.spec b/python-nptyping.spec index 5d93254b73c..728c8e9f5ec 100644 --- a/python-nptyping.spec +++ b/python-nptyping.spec @@ -1,7 +1,7 @@ # # spec file for package python-nptyping # -# Copyright (c) 2022 SUSE LLC +# Copyright (c) 2024 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -16,40 +16,45 @@ # -%define modname nptyping +# pyright is a nodejs package and nobody dares to package it for openSUSE +%bcond_with pyright +# beartype and typeguard: https://github.com/ramonhagenaars/nptyping/issues/115 +%bcond_with beartype +%bcond_with typeguard +# mypy tests expect pandas_stubs, which are not in the distribution +%bcond_with pandas_stubs Name: python-nptyping -Version: 2.4.1 +Version: 2.5.0 Release: 0 Summary: Type hints for NumPy License: MIT URL: https://github.com/ramonhagenaars/nptyping -Source: https://github.com/ramonhagenaars/%{modname}/archive/refs/tags/v%{version}.tar.gz#/%{modname}-%{version}.tar.gz -# PATCH-FIX-OPENSUSE use_system_packages.patch gh#ramonhagenaars/nptyping#72 mcepl@suse.com -# Don't need to build the wheel a second time, when creating venv for install check, allow use of system packages -Patch0: use_system_packages.patch +Source: https://files.pythonhosted.org/packages/source/n/nptyping/nptyping-%{version}.tar.gz # PATCH-FIX-UPSTREAM skip_on_other_archs.patch gh#ramonhagenaars/nptyping#73 mcepl@suse.com # test_instance_check_performance doesn't seem to work well on some architectures -Patch1: skip_on_other_archs.patch -# PATCH-FIX-OPENSUSE skip-pyright-tests.patch code@bnavigator.de -- pyright is a nodejs package and nobody dares to package it for openSUSE -Patch2: skip-pyright-tests.patch +Patch0: skip_on_other_archs.patch +# PATCH-FIX-OPENSUSE use_system_packages.patch gh#ramonhagenaars/nptyping#72 mcepl@suse.com +# Don't need to build the wheel a second time, when creating venv for install check, allow use of system packages +Patch1: use_system_packages.patch BuildRequires: %{python_module pip} BuildRequires: %{python_module setuptools} BuildRequires: %{python_module wheel} BuildRequires: fdupes BuildRequires: python-rpm-macros BuildRequires: unzip -Requires: python-numpy >= 1.20.0 +Requires: (python-numpy >= 1.21.5 with python-numpy < 2) %if 0%{python_version_nodots} < 310 -Requires: python-typing_extensions >= 4.0.0 +Requires: (python-typing_extensions >= 4.0.0 with python-typing_extensions < 5) %endif BuildArch: noarch # SECTION test requirements -BuildRequires: %{python_module beartype} BuildRequires: %{python_module feedparser} -BuildRequires: %{python_module mypy} -BuildRequires: %{python_module numpy >= 1.20.0} +%{?_with_pandas_stubs:BuildRequires: %{python_module mypy}} +%{?_with_beartype:BuildRequires: %{python_module beartype}} +%{?_with_typeguard:BuildRequires: %{python_module typeguard}} +BuildRequires: %{python_module numpy >= 1.20.0 with %python-numpy < 2} BuildRequires: %{python_module pandas} -BuildRequires: %{python_module typeguard} +BuildRequires: %{python_module typing_extensions < 5 if %python-base < 3.10} BuildRequires: %{python_module typing_extensions >= 4.0.0 if %python-base < 3.10} # /SECTION %python_subpackages @@ -60,6 +65,8 @@ Type hints for NumPy. %prep %autosetup -p1 -n nptyping-%{version} +sed -i -e 's/\r//g' README.md + %build %pyproject_wheel @@ -71,13 +78,16 @@ Type hints for NumPy. # wheel in dist/ used by test/test_wheel.py mkdir -p dist/ cp build/nptyping-%{version}-py3-none-any.whl dist/ -# There's no python-pandas-stubs package in Factory yet -%pyunittest -v -k 'not test_mypi' +%{!?_with_pyright:rm tests/test_pyright.py} +%{!?_with_beartype:rm tests/test_beartype.py} +%{!?_with_typeguard:rm tests/test_typeguard.py} +%{!?_with_pandas_stubs:rm tests/test_mypy.py tests/pandas_/test_mypy_dataframe.py tests/pandas_/test_fork_sync.py} +%pyunittest -v %files %{python_files} %doc README.md %license LICENSE -%{python_sitelib}/%{modname} -%{python_sitelib}/%{modname}-%{version}*-info +%{python_sitelib}/nptyping +%{python_sitelib}/nptyping-%{version}.dist-info %changelog diff --git a/skip-pyright-tests.patch b/skip-pyright-tests.patch deleted file mode 100644 index 5962d51a325..00000000000 --- a/skip-pyright-tests.patch +++ /dev/null @@ -1,30 +0,0 @@ -Index: nptyping-2.2.0/tests/test_pyright.py -=================================================================== ---- nptyping-2.2.0.orig/tests/test_pyright.py -+++ nptyping-2.2.0/tests/test_pyright.py -@@ -1,9 +1,12 @@ - from functools import partial - from subprocess import PIPE, run - from typing import Tuple --from unittest import TestCase -+import unittest - --import pyright -+try: -+ import pyright -+except ImportError: -+ pyright = None - - from tests.test_helpers.temp_file import temp_file - -@@ -21,8 +24,8 @@ def _check_pyright_on_code(python_code: - finally: - pyright.node.subprocess.run = run - -- --class PyrightTest(TestCase): -+@unittest.skipIf(pyright is None, "pyright not installed") -+class PyrightTest(unittest.TestCase): - def test_pyright_accepts_array_with_shape(self): - exit_code, stdout, sterr = _check_pyright_on_code( - """ diff --git a/skip_on_other_archs.patch b/skip_on_other_archs.patch index f4d08db139d..e731d26d869 100644 --- a/skip_on_other_archs.patch +++ b/skip_on_other_archs.patch @@ -5,21 +5,21 @@ --- a/tests/test_performance.py +++ b/tests/test_performance.py @@ -1,5 +1,6 @@ - from timeit import Timer --from unittest import TestCase -+import platform -+import unittest - - import numpy as np - + from timeit import Timer +-from unittest import TestCase ++import platform ++import unittest + + import numpy as np + @@ -10,7 +11,9 @@ from nptyping import ( - ) - - --class PerformanceTest(TestCase): -+@unittest.skipIf(platform.machine in ('i586', 'aarch64'), -+ "not supported on this architecture") -+class PerformanceTest(unittest.TestCase): - def test_instance_check_performance(self): - - arr = np.random.randn(42, 42, 3, 5) + ) + + +-class PerformanceTest(TestCase): ++@unittest.skipIf(platform.machine in ('i586', 'aarch64'), ++ "not supported on this architecture") ++class PerformanceTest(unittest.TestCase): + def test_instance_check_performance(self): + + arr = np.random.randn(42, 42, 3, 5) diff --git a/use_system_packages.patch b/use_system_packages.patch index 0d5b04b5d0a..c6380089cdb 100644 --- a/use_system_packages.patch +++ b/use_system_packages.patch @@ -1,35 +1,40 @@ --- - tests/test_wheel.py | 9 +++++---- - 1 file changed, 5 insertions(+), 4 deletions(-) + tests/test_wheel.py | 13 +++---------- + 1 file changed, 3 insertions(+), 10 deletions(-) -Index: nptyping-2.2.0/tests/test_wheel.py -=================================================================== ---- nptyping-2.2.0.orig/tests/test_wheel.py -+++ nptyping-2.2.0/tests/test_wheel.py -@@ -80,12 +80,8 @@ class WheelTest(TestCase): - - def test_wheel_is_built_correctly(self): - with working_dir(_ROOT): -- subprocess.check_output(f"{sys.executable} -m invoke wheel", shell=True) - wheel_files = glob(f"dist/*{__version__}*.whl") -- src_files = glob(f"dist/*{__version__}*.tar.gz") -- - self.assertEqual(1, len(wheel_files)) -- self.assertEqual(1, len(src_files)) - - with ZipFile(_ROOT / Path(wheel_files[0]), "r") as zip_: - files_in_wheel = set( -@@ -98,10 +94,9 @@ class WheelTest(TestCase): - - def test_wheel_can_be_installed(self): - with working_dir(Path(self.temp_dir.name)): -- venv.create(_VENV_NAME, with_pip=False) -- # For some reason, with_pip=True fails, so we do it separately. -- subprocess.check_output( -- f"{self.py} -m ensurepip --upgrade --default-pip", shell=True -+ venv.create(_VENV_NAME, system_site_packages=True, with_pip=True) -+ print( -+ f"{self.pip} install {_ROOT / 'dist' / _WHEEL_NAME}" - ) - subprocess.check_output( - f"{self.pip} install {_ROOT / 'dist' / _WHEEL_NAME}", shell=True +--- a/tests/test_wheel.py ++++ b/tests/test_wheel.py +@@ -90,12 +90,9 @@ class WheelTest(TestCase): + + def test_wheel_is_built_correctly(self): + with working_dir(_ROOT): +- subprocess.check_output(f"{sys.executable} -m invoke wheel", shell=True) + wheel_files = glob(f"dist/*{__version__}*.whl") +- src_files = glob(f"dist/*{__version__}*.tar.gz") + + self.assertEqual(1, len(wheel_files)) +- self.assertEqual(1, len(src_files)) + + with ZipFile(_ROOT / Path(wheel_files[0]), "r") as zip_: + files_in_wheel = set( +@@ -108,17 +105,13 @@ class WheelTest(TestCase): + + def test_wheel_can_be_installed(self): + with working_dir(Path(self.temp_dir.name)): +- venv.create(_VENV_NAME, with_pip=False) +- # For some reason, with_pip=True fails, so we do it separately. +- subprocess.check_output( +- f"{self.py} -m ensurepip --upgrade --default-pip", shell=True ++ venv.create(_VENV_NAME, system_site_packages=True, with_pip=True) ++ print( ++ f"{self.pip} install {_ROOT / 'dist' / _WHEEL_NAME}" + ) + subprocess.check_output( + f"{self.py} -m pip install --upgrade pip", shell=True + ) +- subprocess.check_output( +- f"{self.pip} install {_ROOT / 'dist' / _WHEEL_NAME}", shell=True +- ) + # No errors raised? Then the install succeeded. + + def test_basic_nptyping_code(self):