Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package python-agate for openSUSE:Factory 
checked in at 2024-09-30 15:38:22
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-agate (Old)
 and      /work/SRC/openSUSE:Factory/.python-agate.new.29891 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-agate"

Mon Sep 30 15:38:22 2024 rev:19 rq:1204400 version:1.12.0

Changes:
--------
--- /work/SRC/openSUSE:Factory/python-agate/python-agate.changes        
2024-06-12 15:40:07.930109547 +0200
+++ /work/SRC/openSUSE:Factory/.python-agate.new.29891/python-agate.changes     
2024-09-30 15:38:53.613254130 +0200
@@ -1,0 +2,9 @@
+Sat Sep 28 19:49:22 UTC 2024 - Dirk Müller <dmuel...@suse.com>
+
+- update to 1.12.0:
+  * feat: :class:`.Number` accepts a no_leading_zeroes keyword
+    argument, to indicate whether to disallow numbers with
+    leading zeroes (not including a single zero, or a single zero
+    before a decimal).
+
+-------------------------------------------------------------------

Old:
----
  agate-1.11.0.tar.gz

New:
----
  agate-1.12.0.tar.gz

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

Other differences:
------------------
++++++ python-agate.spec ++++++
--- /var/tmp/diff_new_pack.NNVC0F/_old  2024-09-30 15:38:54.229279788 +0200
+++ /var/tmp/diff_new_pack.NNVC0F/_new  2024-09-30 15:38:54.233279956 +0200
@@ -20,7 +20,7 @@
 %define skip_python2 1
 %define modname agate
 Name:           python-agate
-Version:        1.11.0
+Version:        1.12.0
 Release:        0
 Summary:        Data analysis library optimized for humans instead of machines
 License:        MIT

++++++ agate-1.11.0.tar.gz -> agate-1.12.0.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/agate-1.11.0/CHANGELOG.rst 
new/agate-1.12.0/CHANGELOG.rst
--- old/agate-1.11.0/CHANGELOG.rst      2024-05-27 19:21:31.000000000 +0200
+++ new/agate-1.12.0/CHANGELOG.rst      2024-07-30 02:56:56.000000000 +0200
@@ -1,3 +1,8 @@
+1.12.0 - July 29, 2024
+----------------------
+
+-  feat: :class:`.Number` accepts a ``no_leading_zeroes`` keyword argument, to 
indicate whether to disallow numbers with leading zeroes (not including a 
single zero, or a single zero before a decimal).
+
 1.11.0 - May 27, 2024
 ---------------------
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/agate-1.11.0/agate/data_types/number.py 
new/agate-1.12.0/agate/data_types/number.py
--- old/agate-1.11.0/agate/data_types/number.py 2024-05-27 19:21:31.000000000 
+0200
+++ new/agate-1.12.0/agate/data_types/number.py 2024-07-30 02:56:56.000000000 
+0200
@@ -29,14 +29,16 @@
         provided by the specified :code:`locale`.
     :param currency_symbols:
         A sequence of currency symbols to strip from numbers.
+    :param no_leading_zeroes:
+        Whether to disallow leading zeroes.
     """
     def __init__(self, locale='en_US', group_symbol=None, decimal_symbol=None,
-                 currency_symbols=DEFAULT_CURRENCY_SYMBOLS, **kwargs):
+                 currency_symbols=DEFAULT_CURRENCY_SYMBOLS, 
no_leading_zeroes=None, **kwargs):
         super().__init__(**kwargs)
 
         self.locale = Locale.parse(locale)
-
         self.currency_symbols = currency_symbols
+        self.no_leading_zeroes = no_leading_zeroes
 
         # Suppress Babel warning on Python 3.6
         # See #665
@@ -91,6 +93,9 @@
         d = d.replace(self.group_symbol, '')
         d = d.replace(self.decimal_symbol, '.')
 
+        if self.no_leading_zeroes and len(d) > 1 and d[0] == '0' and d[1] != 
'.':
+            raise CastError('Can not parse value "%s" as Decimal without 
leading zeroes' % d)
+
         try:
             return Decimal(d) * sign
         # The Decimal class will return an InvalidOperation exception on most 
Python implementations,
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/agate-1.11.0/docs/conf.py 
new/agate-1.12.0/docs/conf.py
--- old/agate-1.11.0/docs/conf.py       2024-05-27 19:21:31.000000000 +0200
+++ new/agate-1.12.0/docs/conf.py       2024-07-30 02:56:56.000000000 +0200
@@ -12,7 +12,7 @@
 
 project = 'agate'
 copyright = '2017, Christopher Groskopf'
-version = '1.11.0'
+version = '1.12.0'
 release = version
 
 # -- General configuration ---------------------------------------------------
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/agate-1.11.0/setup.py new/agate-1.12.0/setup.py
--- old/agate-1.11.0/setup.py   2024-05-27 19:21:31.000000000 +0200
+++ new/agate-1.12.0/setup.py   2024-07-30 02:56:56.000000000 +0200
@@ -5,7 +5,7 @@
 
 setup(
     name='agate',
-    version='1.11.0',
+    version='1.12.0',
     description='A data analysis library that is optimized for humans instead 
of machines.',
     long_description=long_description,
     long_description_content_type='text/x-rst',
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/agate-1.11.0/tests/test_data_types.py 
new/agate-1.12.0/tests/test_data_types.py
--- old/agate-1.11.0/tests/test_data_types.py   2024-05-27 19:21:31.000000000 
+0200
+++ new/agate-1.12.0/tests/test_data_types.py   2024-07-30 02:56:56.000000000 
+0200
@@ -188,6 +188,19 @@
         with self.assertRaises(CastError):
             self.type.cast('quack')
 
+    def test_cast_error_leading_zeroes(self):
+        data_type = Number(no_leading_zeroes=True)
+
+        self.assertEqual(data_type.cast('0'), Decimal('0'))
+        self.assertEqual(data_type.cast('0.123'), Decimal('0.123'))
+        self.assertEqual(data_type.cast('123'), Decimal('123'))
+
+        with self.assertRaises(CastError):
+            data_type.cast('01')
+
+        with self.assertRaises(CastError):
+            data_type.cast('00.11')
+
 
 class TestDate(unittest.TestCase):
     def setUp(self):

Reply via email to