Hello community,

here is the log from the commit of package python-numericalunits for 
openSUSE:Leap:15.2 checked in at 2020-03-09 18:09:30
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Leap:15.2/python-numericalunits (Old)
 and      /work/SRC/openSUSE:Leap:15.2/.python-numericalunits.new.26092 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-numericalunits"

Mon Mar  9 18:09:30 2020 rev:4 rq:776858 version:1.24

Changes:
--------
--- 
/work/SRC/openSUSE:Leap:15.2/python-numericalunits/python-numericalunits.changes
    2020-01-15 15:50:52.323509474 +0100
+++ 
/work/SRC/openSUSE:Leap:15.2/.python-numericalunits.new.26092/python-numericalunits.changes
 2020-03-09 18:09:31.265037946 +0100
@@ -1,0 +2,27 @@
+Sun Dec  1 03:32:39 UTC 2019 - Arun Persaud <[email protected]>
+
+- specfile:
+  - disable python2
+
+- update to version 1.24:
+  * drop support for python 2
+  * update to latest CODATA
+  * add more acceleration-related units.
+
+-------------------------------------------------------------------
+Fri May 24 08:00:27 UTC 2019 - John Vandenberg <[email protected]>
+
+- Run dos2unix on source file which changed to DOS format
+- Update to v1.23
+  * add a smoke test
+  * drop support except 2.7+ and 3.4+
+  * random initializations now span more orders of magnitude
+  * update to latest CODATA
+
+-------------------------------------------------------------------
+Mon May 20 01:13:20 UTC 2019 - John Vandenberg <[email protected]>
+
+- Use GitHub tagged archive and post-release tests.py to add
+  %doc and %check
+
+-------------------------------------------------------------------

Old:
----
  numericalunits-1.22-py2.py3-none-any.whl

New:
----
  numericalunits-1.24.tar.gz
  tests.py

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ python-numericalunits.spec ++++++
--- /var/tmp/diff_new_pack.C06b9q/_old  2020-03-09 18:09:31.553038358 +0100
+++ /var/tmp/diff_new_pack.C06b9q/_new  2020-03-09 18:09:31.557038364 +0100
@@ -1,7 +1,7 @@
 #
 # spec file for package python-numericalunits
 #
-# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2019 SUSE LLC
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,20 +17,21 @@
 
 
 %{?!python_module:%define python_module() python-%{**} python3-%{**}}
+%define skip_python2 1
 Name:           python-numericalunits
-Version:        1.22
+Version:        1.24
 Release:        0
 Summary:        Python module for defining quantities with units
 License:        MIT
 Group:          Development/Languages/Python
-Url:            http://pypi.python.org/pypi/numericalunits
-Source:         
https://files.pythonhosted.org/packages/py2.py3/n/numericalunits/numericalunits-%{version}-py2.py3-none-any.whl
-BuildRequires:  %{python_module devel}
-BuildRequires:  %{python_module pip}
+URL:            https://github.com/sbyrnes321/numericalunits
+Source:         
https://files.pythonhosted.org/packages/source/n/numericalunits/numericalunits-%{version}.tar.gz
+Source1:        
https://raw.githubusercontent.com/sbyrnes321/numericalunits/master/tests/tests.py
+BuildRequires:  %{python_module setuptools}
+BuildRequires:  dos2unix
 BuildRequires:  fdupes
 BuildRequires:  python-rpm-macros
 BuildArch:      noarch
-
 %python_subpackages
 
 %description
@@ -44,21 +45,24 @@
 * Zero calculation overhead
 
 %prep
-%setup -T -c -n numericalunits-%{version}
+%setup -q -n numericalunits-%{version}
+dos2unix numericalunits.py
+cp %{SOURCE1} .
 
 %build
-# Not needed
+%python_build
 
 %install
-%python_expand pip%{$python_bin_suffix} install --root %{buildroot} %{SOURCE0}
+%python_install
 %python_expand %fdupes %{buildroot}%{$python_sitelib}
 
 %check
-# todo
+%python_exec setup.py test --test-suite=tests
 
 %files %{python_files}
-%license %{python_sitelib}/numericalunits-%{version}.dist-info/LICENSE.txt
-%{python_sitelib}/numericalunits-%{version}.dist-info/
+%license LICENSE.txt
+%doc Changes.txt README.rst
+%{python_sitelib}/numericalunits-%{version}*egg-info/
 %{python_sitelib}/numericalunits.py*
 %pycache_only %{python_sitelib}/__pycache__/numericalunits.*
 

++++++ tests.py ++++++
# -*- coding: utf-8 -*-
"""
very basic tests on numericalunits
"""
import unittest
import numericalunits as nu

class TestStuff(unittest.TestCase):

    def setUp(self):
        pass

    def assert_almost_equal(self, a, b, rtol):
        """helper function to check if two floats are approximately equal,
        allowing for rounding errors etc. Similar to math.isclose in py3."""
        self.assertTrue(abs(a-b) <= rtol * (abs(a) + abs(b)))

    def test_everything(self):
        """just some very basic smoke tests"""
        # example from README
        x = 5 * nu.mL
        self.assert_almost_equal(x, 5e21 * nu.nm**3, rtol=1e-9)

        # example from README
        Efield = 1e5 * (nu.V / nu.cm)
        force = nu.e * Efield
        accel = force / nu.me
        self.assert_almost_equal(accel, 1.75882002e18 * nu.m / nu.s**2, 
rtol=1e-6)

        # make sure reset_units('SI') works
        nu.reset_units('SI')
        self.assert_almost_equal(nu.G, 1e-4, rtol=1e-9)

if __name__ == '__main__':
    unittest.main()

Reply via email to