commit python-parse for openSUSE:Factory
Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package python-parse for openSUSE:Factory checked in at 2024-01-31 23:54:22 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-parse (Old) and /work/SRC/openSUSE:Factory/.python-parse.new.1815 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "python-parse" Wed Jan 31 23:54:22 2024 rev:11 rq:1142844 version:1.20.1 Changes: -------- --- /work/SRC/openSUSE:Factory/python-parse/python-parse.changes 2024-01-15 22:17:05.598142349 +0100 +++ /work/SRC/openSUSE:Factory/.python-parse.new.1815/python-parse.changes 2024-01-31 23:54:37.490883008 +0100 @@ -1,0 +2,9 @@ +Tue Jan 30 18:07:15 UTC 2024 - Dirk Müller <dmueller@suse.com> + +- update to 1.20.1: + * add formatter property, closes #172 + * add security policy file. closes #175. + * Support various number of digits after the comma in the + timestamp %f … + +------------------------------------------------------------------- Old: ---- parse-1.20.0.tar.gz New: ---- parse-1.20.1.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-parse.spec ++++++ --- /var/tmp/diff_new_pack.yPs6Ws/_old 2024-01-31 23:54:38.502919529 +0100 +++ /var/tmp/diff_new_pack.yPs6Ws/_new 2024-01-31 23:54:38.502919529 +0100 @@ -18,7 +18,7 @@ %{?!python_module:%define python_module() python-%{**} python3-%{**}} Name: python-parse -Version: 1.20.0 +Version: 1.20.1 Release: 0 Summary: Python module for parsing strings using a "format" syntax License: MIT ++++++ parse-1.20.0.tar.gz -> parse-1.20.1.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/parse-1.20.0/PKG-INFO new/parse-1.20.1/PKG-INFO --- old/parse-1.20.0/PKG-INFO 2023-11-25 04:02:07.164329300 +0100 +++ new/parse-1.20.1/PKG-INFO 2024-01-28 05:13:23.598074000 +0100 @@ -1,8 +1,9 @@ Metadata-Version: 2.1 Name: parse -Version: 1.20.0 +Version: 1.20.1 Summary: parse() is the opposite of format() Author-email: Richard Jones <richard@python.org> +Maintainer-email: Wim Glenn <hey@wimglenn.com> License: Copyright (c) 2012-2019 Richard Jones <richard@python.org> Permission is hereby granted, free of charge, to any person obtaining a copy @@ -476,6 +477,7 @@ Changelog --------- +- 1.20.1 The `%f` directive accepts 1-6 digits, like strptime (thanks @bbertincourt) - 1.20.0 Added support for strptime codes (thanks @bendichter) - 1.19.1 Added support for sign specifiers in number formats (thanks @anntzer) - 1.19.0 Added slice access to fixed results (thanks @jonathangjertsen). diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/parse-1.20.0/README.rst new/parse-1.20.1/README.rst --- old/parse-1.20.0/README.rst 2023-11-25 03:56:59.000000000 +0100 +++ new/parse-1.20.1/README.rst 2024-01-28 05:10:35.000000000 +0100 @@ -441,6 +441,7 @@ Changelog --------- +- 1.20.1 The `%f` directive accepts 1-6 digits, like strptime (thanks @bbertincourt) - 1.20.0 Added support for strptime codes (thanks @bendichter) - 1.19.1 Added support for sign specifiers in number formats (thanks @anntzer) - 1.19.0 Added slice access to fixed results (thanks @jonathangjertsen). diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/parse-1.20.0/parse.egg-info/PKG-INFO new/parse-1.20.1/parse.egg-info/PKG-INFO --- old/parse-1.20.0/parse.egg-info/PKG-INFO 2023-11-25 04:02:07.000000000 +0100 +++ new/parse-1.20.1/parse.egg-info/PKG-INFO 2024-01-28 05:13:23.000000000 +0100 @@ -1,8 +1,9 @@ Metadata-Version: 2.1 Name: parse -Version: 1.20.0 +Version: 1.20.1 Summary: parse() is the opposite of format() Author-email: Richard Jones <richard@python.org> +Maintainer-email: Wim Glenn <hey@wimglenn.com> License: Copyright (c) 2012-2019 Richard Jones <richard@python.org> Permission is hereby granted, free of charge, to any person obtaining a copy @@ -476,6 +477,7 @@ Changelog --------- +- 1.20.1 The `%f` directive accepts 1-6 digits, like strptime (thanks @bbertincourt) - 1.20.0 Added support for strptime codes (thanks @bendichter) - 1.19.1 Added support for sign specifiers in number formats (thanks @anntzer) - 1.19.0 Added slice access to fixed results (thanks @jonathangjertsen). diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/parse-1.20.0/parse.py new/parse-1.20.1/parse.py --- old/parse-1.20.0/parse.py 2023-11-25 03:56:59.000000000 +0100 +++ new/parse-1.20.1/parse.py 2024-01-28 05:08:47.000000000 +0100 @@ -11,7 +11,7 @@ from functools import partial -__version__ = "1.20.0" +__version__ = "1.20.1" __all__ = ["parse", "search", "findall", "with_pattern"] log = logging.getLogger(__name__) @@ -307,7 +307,7 @@ "%p": "(?:AM|PM)", "%M": "[0-9]{2}", "%S": "[0-9]{2}", - "%f": "[0-9]{6}", + "%f": "[0-9]{1,6}", "%z": "[+|-][0-9]{2}(:?[0-9]{2})?(:?[0-9]{2})?", # "%Z": punt "%j": "[0-9]{1,3}", @@ -482,6 +482,10 @@ def fixed_fields(self): return self._fixed_fields.copy() + @property + def format(self): + return self._format + def parse(self, string, evaluate_result=True): """Match my format to the string exactly. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/parse-1.20.0/pyproject.toml new/parse-1.20.1/pyproject.toml --- old/parse-1.20.0/pyproject.toml 2023-11-09 04:17:44.000000000 +0100 +++ new/parse-1.20.1/pyproject.toml 2023-12-15 04:50:45.000000000 +0100 @@ -6,7 +6,6 @@ name = "parse" dynamic = ["version"] readme = "README.rst" -authors = [{name = "Richard Jones", email = "richard@python.org"}] description = "parse() is the opposite of format()" license = {file = "LICENSE"} classifiers = [ @@ -18,6 +17,14 @@ "License :: OSI Approved :: MIT License", ] +[[project.authors]] +name = "Richard Jones" +email = "richard@python.org" + +[[project.maintainers]] +name = "Wim Glenn" +email = "hey@wimglenn.com" + [project.urls] homepage = "https://github.com/r1chardj0n3s/parse" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/parse-1.20.0/tests/test_parse.py new/parse-1.20.1/tests/test_parse.py --- old/parse-1.20.0/tests/test_parse.py 2023-11-25 03:59:38.000000000 +0100 +++ new/parse-1.20.1/tests/test_parse.py 2024-01-28 03:23:42.000000000 +0100 @@ -375,6 +375,23 @@ assert r.named["dt"] == datetime(2023, 11, 21, 13, 23, 27) +def test_datetime_with_various_subsecond_precision(): + r = parse.parse("{dt:%Y-%m-%d %H:%M:%S.%f}", "2023-11-21 13:23:27.123456") + assert r.named["dt"] == datetime(2023, 11, 21, 13, 23, 27, 123456) + + r = parse.parse("{dt:%Y-%m-%d %H:%M:%S.%f}", "2023-11-21 13:23:27.12345") + assert r.named["dt"] == datetime(2023, 11, 21, 13, 23, 27, 123450) + + r = parse.parse("{dt:%Y-%m-%d %H:%M:%S.%f}", "2023-11-21 13:23:27.1234") + assert r.named["dt"] == datetime(2023, 11, 21, 13, 23, 27, 123400) + + r = parse.parse("{dt:%Y-%m-%d %H:%M:%S.%f}", "2023-11-21 13:23:27.123") + assert r.named["dt"] == datetime(2023, 11, 21, 13, 23, 27, 123000) + + r = parse.parse("{dt:%Y-%m-%d %H:%M:%S.%f}", "2023-11-21 13:23:27.0") + assert r.named["dt"] == datetime(2023, 11, 21, 13, 23, 27, 0) + + @pytest.mark.skipif( sys.version_info[0] < 3, reason="Python 3+ required for timezone support" ) @@ -739,3 +756,10 @@ s = dt.strftime(fmt) [res] = parse.parse("{:" + fmt + "}", s) assert res == dt + + +def test_parser_format(): + parser = parse.compile("hello {}") + assert parser.format.format("world") == "hello world" + with pytest.raises(AttributeError): + parser.format = "hi {}"
participants (1)
-
Source-Sync