#1 New version 0.0.25
Closed 2 years ago by ankursinha. Opened 2 years ago by vanessa_kris.
rpms/ vanessa_kris/python-pymatreader version-0.0.25  into  rawhide

file modified
+1
@@ -3,3 +3,4 @@ 

  /python-pymatreader-0.0.21.tar.gz

  /pymatreader-9ae2e1f.tar.gz

  /pymatreader-00041de.tar.gz

+ /python-pymatreader-0.0.25.tar.gz

@@ -1,173 +0,0 @@ 

- From 2eae1cd98ae518a7eb6d72bdf95e56baa36e1d05 Mon Sep 17 00:00:00 2001

- From: "Ankur Sinha (Ankur Sinha Gmail)" <sanjay.ankur@gmail.com>

- Date: Tue, 6 Jul 2021 13:45:03 +0100

- Subject: [PATCH 1/3] feat: replace nose with pytest

- 

- Nose is deprecated. The nose website says:

- 

- https://nose.readthedocs.io/en/latest/

- 

- "Nose has been in maintenance mode for the past several years and will

- likely cease without a new person/team to take over maintainership. New

- projects should consider using Nose2, py.test, or just plain

- unittest/unittest2."

- 

- Deprecation of nose in Fedora:

- https://fedoraproject.org/wiki/Changes/DeprecateNose

- ---

-  gitlab-ci-test.sh                  | 4 ++--

-  meta.yaml                          | 4 ++--

-  requirements.txt                   | 5 +++--

-  tests/helper_functions/__init__.py | 9 ++++-----

-  tests/test_pymatreader.py          | 6 +++---

-  tox.ini                            | 5 +++--

-  tox_ci.ini                         | 5 +++--

-  7 files changed, 20 insertions(+), 18 deletions(-)

- 

- diff --git a/gitlab-ci-test.sh b/gitlab-ci-test.sh

- index 094761e..68cc759 100644

- --- a/gitlab-ci-test.sh

- +++ b/gitlab-ci-test.sh

- @@ -3,6 +3,6 @@ cd $CI_PROJECT_DIR

-  apt-get update

-  apt-get install -y libhdf5-dev

-  pip install -U -r requirements.txt

- -nosetests --with-coverage --cover-package=pymatreader && \

- +pytest --cov=pymatreader && \

-  tox -c tox_ci.ini && \

- -codecov

- \ No newline at end of file

- +codecov

- diff --git a/meta.yaml b/meta.yaml

- index b887810..f009533 100644

- --- a/meta.yaml

- +++ b/meta.yaml

- @@ -33,9 +33,9 @@ test:

-    source_files:

-      - tests

-    requires:

- -    - nose

- +    - pytest pytest-cov

-    commands:

- -    - nosetests tests

- +    - pytest

-  

-  about:

-    home: {{ data.url }}

- diff --git a/requirements.txt b/requirements.txt

- index cf965a5..33370b9 100644

- --- a/requirements.txt

- +++ b/requirements.txt

- @@ -1,7 +1,8 @@

-  h5py

-  scipy

-  numpy

- -nose

- +pytest

- +pytest-cov

-  xmltodict

-  sphinx

-  sphinx-autobuild

- @@ -12,4 +13,4 @@ twine

-  wheel

-  coverage

-  flake8

- -codecov

- \ No newline at end of file

- +codecov

- diff --git a/tests/helper_functions/__init__.py b/tests/helper_functions/__init__.py

- index 3a50ea4..9ef10a7 100644

- --- a/tests/helper_functions/__init__.py

- +++ b/tests/helper_functions/__init__.py

- @@ -29,7 +29,6 @@ import string

-  

-  import numpy

-  import xmltodict

- -from nose.tools import assert_almost_equal, assert_equal

-  import types

-  

-  

- @@ -57,24 +56,24 @@ def assertDeepAlmostEqual(expected, actual, *args, **kwargs):

-  

-      try:

-          if isinstance(expected, (int, float, complex)):

- -            assert_almost_equal(expected, actual, *args, **kwargs)

- +            numpy.testing.assert_almost_equal(expected, actual, *args, **kwargs)

-          elif isinstance(expected, (list, tuple, numpy.ndarray, types.GeneratorType)):

-              if isinstance(expected, types.GeneratorType):

-                  expected = list(expected)

-                  actual = list(actual)

-  

- -            assert_equal(len(expected), len(actual))

- +            assert len(expected) == len(actual)

-              for index in range(len(expected)):

-                  v1, v2 = expected[index], actual[index]

-                  assertDeepAlmostEqual(v1, v2,

-                                        __trace=repr(index), *args, **kwargs)

-          elif isinstance(expected, dict):

- -            assert_equal(set(expected), set(actual))

- +            assert set(expected) == set(actual)

-              for key in expected:

-                  assertDeepAlmostEqual(expected[key], actual[key],

-                                        __trace=repr(key), *args, **kwargs)

-          else:

- -            assert_equal(expected, actual)

- +            assert expected == actual

-      except AssertionError as exc:

-          exc.__dict__.setdefault('traces', []).append(trace)

-          if is_root:

- diff --git a/tests/test_pymatreader.py b/tests/test_pymatreader.py

- index 91b4318..c92414a 100644

- --- a/tests/test_pymatreader.py

- +++ b/tests/test_pymatreader.py

- @@ -28,7 +28,7 @@

-  import os.path

-  from unittest import TestCase

-  

- -from nose.tools import raises

- +import pytest

-  

-  from pymatreader import read_mat

-  from .helper_functions import assertDeepAlmostEqual, sanitize_dict, \

- @@ -201,9 +201,9 @@ def test_raw_old_eeglab_event_type():

-      first_event.latency

-  

-  

- -@raises(IOError)

-  def test_file_does_not_exist():

- -    read_mat(os.path.join(test_data_folder, invalid_fname))

- +    with pytest.raises(IOError):

- +        read_mat(os.path.join(test_data_folder, invalid_fname))

-  

-  

-  def test_files_with_unsupported_classesv7():

- diff --git a/tox.ini b/tox.ini

- index 25cb508..71680b0 100644

- --- a/tox.ini

- +++ b/tox.ini

- @@ -7,6 +7,7 @@

-  envlist = py37, py38, py39

-  

-  [testenv]

- -commands = nosetests

- +commands = pytest

-  deps =

- -    nose

- +    pytest

- +    pytest-cov

- diff --git a/tox_ci.ini b/tox_ci.ini

- index 3ddd816..6fdcfd2 100644

- --- a/tox_ci.ini

- +++ b/tox_ci.ini

- @@ -1,4 +1,5 @@

-  [testenv]

- -commands = nosetests

- +commands = pytest

-  deps =

- -    nose

- \ No newline at end of file

- +    pytest

- +    pytest-cov

- -- 

- 2.31.1

- 

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

- From 61c5a608a6511eb9683ec2d28461cd0151277053 Mon Sep 17 00:00:00 2001

- From: "Ankur Sinha (Ankur Sinha Gmail)" <sanjay.ankur@gmail.com>

- Date: Tue, 6 Jul 2021 14:31:42 +0100

- Subject: [PATCH 2/3] feat: do not use deprecated np.complex

- 

- ---

-  pymatreader/utils.py | 2 +-

-  1 file changed, 1 insertion(+), 1 deletion(-)

- 

- diff --git a/pymatreader/utils.py b/pymatreader/utils.py

- index d6c5b64..ecfa842 100644

- --- a/pymatreader/utils.py

- +++ b/pymatreader/utils.py

- @@ -167,7 +167,7 @@ def _handle_ndarray(values):

-      values = numpy.squeeze(values).T

-      if (isinstance(values, numpy.ndarray) and

-              values.dtype.names == ('real', 'imag')):

- -        values = numpy.array(values.view(numpy.complex))

- +        values = numpy.array(values.view(complex))

-  

-      if isinstance(values, numpy.ndarray) and \

-              values.size == 1:

- -- 

- 2.31.1

- 

@@ -1,36 +0,0 @@ 

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

- From: "Ankur Sinha (Ankur Sinha Gmail)" <sanjay.ankur@gmail.com>

- Date: Tue, 6 Jul 2021 14:32:01 +0100

- Subject: [PATCH 3/3] fix: handle cases where either actual or expected are

-  None

- 

- In this case, the len() function throws a TypeError.

- ---

-  tests/helper_functions/__init__.py | 10 +++++++++-

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

- 

- diff --git a/tests/helper_functions/__init__.py b/tests/helper_functions/__init__.py

- index 9ef10a7..29815b3 100644

- --- a/tests/helper_functions/__init__.py

- +++ b/tests/helper_functions/__init__.py

- @@ -61,8 +61,16 @@ def assertDeepAlmostEqual(expected, actual, *args, **kwargs):

-              if isinstance(expected, types.GeneratorType):

-                  expected = list(expected)

-                  actual = list(actual)

- +            # if any of them are None, len(None) throws a TypeError

- +            try:

- +                assert len(expected) == len(actual)

- +            except TypeError:

- +                # if both are None, they are equal

- +                if not expected and not actual:

- +                    pass

- +                else:

- +                    raise AssertionError

-  

- -            assert len(expected) == len(actual)

-              for index in range(len(expected)):

-                  v1, v2 = expected[index], actual[index]

-                  assertDeepAlmostEqual(v1, v2,

- -- 

- 2.31.1

- 

file modified
+10 -10
@@ -1,5 +1,5 @@ 

- # The extracted tar has the commit in it

- %global commit 00041deb731dffdfbbf457b9c05ae680d21a7234

+ # The extracted tar has the commit in it	

+ %global commit 1e536dbf50ee385e90273c7a31fcd85d402154d1	

  %global shortcommit %(c=%{commit}; echo ${c:0:7})

  

  %bcond_without tests
@@ -14,17 +14,13 @@ 

  Documentation can be found here: http://pymatreader.readthedocs.io/en/latest/}

  

  Name:           python-%{srcname}

- Version:        0.0.24

- Release:        5%{?dist}

+ Version:        0.0.25

+ Release:        1%{?dist}

  Summary:        Convenient reader for Matlab mat files

  

  License:        BSD

  URL:            https://pypi.python.org/pypi/%{srcname}

- Source0:        https://gitlab.com/obob/%{srcname}/-/archive/%{commit}/%{srcname}-%{shortcommit}.tar.gz

- # Remove pytest, fix some tests

- Patch0:         0001-feat-replace-nose-with-pytest.patch

- Patch1:         0002-feat-do-not-use-deprecated-np.complex.patch

- Patch2:         0003-fix-handle-cases-where-either-actual-or-expected-are.patch

+ Source0:        https://gitlab.com/obob/%{srcname}/-/archive/v%{version}/%{name}-%{version}.tar.gz

  

  BuildArch:      noarch

  
@@ -60,7 +56,7 @@ 

  Documentation for %{name}.

  

  %prep

- %autosetup -n %{srcname}-%{commit} -S git

+ %autosetup -n %{srcname}-v%{version}-%{commit}

  rm -rf %{srcname}.egg-info

  

  %build
@@ -98,6 +94,10 @@ 

  %doc doc/build/html

  

  %changelog

+ * Fri Jul 23 2021 Fedora Release Engineering <vanessaigwe1@gmail.com> - 0.0.25-1

+ - Updated version to 0.0.25

+ - Removed patch files in specFile

+ 

  * Fri Jul 23 2021 Fedora Release Engineering <releng@fedoraproject.org> - 0.0.24-5

  - Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild

  

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

- SHA512 (pymatreader-00041de.tar.gz) = 5c10d7748994b5674e880461b724acbae65da18b3a6c28b57b39a9009cc9f419d6cf31d35230cd0ab464b44b58bb4b96a11384e5a75052335319ae3cf9bb68bb

+ SHA512 (python-pymatreader-0.0.25.tar.gz) = ad485917d0dcc55216d0b03650e1abfa91ba9e3214f6b21cd7b60df133956ff64f22e0c6118a1ef4b50857fcec4fcfcb9d47f1fa74e9e2acc2d0016a244e8175

  • Updated version to 0.0.25
  • Removed patches from SpecFile
  • Removed patches from repo

Metadata Update from @ankursinha:
- Request assigned

2 years ago

Looks good in general. I see that this is using the older python system without pyproject_wheel and all that. Would you like to try to update the spec to use the new commands that you've all learned too?

Hello @ankursinha

I've made some changes to python-pymatreader

and i get error
only best candidate packages)Error:
Problem: nothing provides requested (python3dist(scipy) < 1.7 or python3dist(scipy) > 1.7)

I have checked the setup.py file and scipy!=1.7.0
but the scipy being installed during the build is 1.7.0-2
I'm not sure why the devs blocked scipy version 1.7.0
Don't know if it's wise i change the setup.py value from the sepcfile

Here’s the explanation for excluding scipy 1.7.0: https://gitlab.com/sanjayankur31/pymatreader/-/merge_requests/1

Here’s the RHBZ issue for updating scipy, which is now at 1.7.2 upstream: https://bugzilla.redhat.com/show_bug.cgi?id=1988883

I agree it seems best to wait for a scipy update in F35–F36 (and maybe help out with a PR) rather than to allow the buggy version.

Here’s the explanation for excluding scipy 1.7.0: https://gitlab.com/sanjayankur31/pymatreader/-/merge_requests/1

Here’s the RHBZ issue for updating scipy, which is now at 1.7.2 upstream: https://bugzilla.redhat.com/show_bug.cgi?id=1988883

I agree it seems best to wait for a scipy update in F35–F36 (and maybe help out with a PR) rather than to allow the buggy version.

Wow sounds great, please how can I open a PR regarding this situation?

Wow sounds great, please how can I open a PR regarding this situation?

In general, you can:

  • go to the package page, e.g. https://src.fedoraproject.org/rpms/scipy
  • click the button in the top right to create a fork
  • clone your fork
  • make the needed changes—preferably in a named branch like v1.7.2 rather than in rawhide, so it’s easier to re-use your fork
  • test with fedpkg --release rawhide mockbuild and/or fedpkg --release rawhide scratch-build --srpm
  • push to your fork; note that you can create and delete branches freely in a fork, unlike in a normal dist-git repo
  • use the Open PR button in the web UI

I thought about making a PR to update scipy myself, but when I did a test build with 1.7.2, I ran into a couple of new test failures that I didn’t have time or the inclination to examine.

Yeh, scipy is quite a complex package, so it's probably best to wait for the maintainers to update it. @vanessa_kris : I'd say working on a package other than scipy would be a better use of your time

Looks like scipy was updated to 1.7.3 in rawhide, and is building for f35 too, so we should be able to proceed here.

@vanessakris let's leave this for your next week. You'll have to do it again with your new FAS account anyway, so I'll close this, and we can look at it again next week or so.

Pull-Request has been closed by ankursinha

2 years ago