Hello community, here is the log from the commit of package python-iso8601 for openSUSE:Factory checked in at 2014-03-13 20:43:54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-iso8601 (Old) and /work/SRC/openSUSE:Factory/.python-iso8601.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-iso8601" Changes: -------- --- /work/SRC/openSUSE:Factory/python-iso8601/python-iso8601.changes 2014-02-26 06:55:05.000000000 +0100 +++ /work/SRC/openSUSE:Factory/.python-iso8601.new/python-iso8601.changes 2014-03-13 20:43:55.000000000 +0100 @@ -1,0 +2,12 @@ +Wed Mar 12 15:16:08 UTC 2014 - speili...@suse.com + +- Update to version 0.1.10 + + Fixes https://bitbucket.org/micktwomey/pyiso8601/issue/14/regression-yyyy-mm-no-longer-parses + + Adds YYYY as a valid date (uses 1 for both month and day) + + Woo, semantic versioning, .10 at last. +- Changes from version 0.1.9: + + Lots of fixes tightening up parsing from jdanjou. + + Release addresses https://bitbucket.org/micktwomey/pyiso8601/issue/13/new-release-based-on-critical-bug-fix +- Run tests again + +------------------------------------------------------------------- Old: ---- iso8601-0.1.8.tar.gz New: ---- iso8601-0.1.10.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-iso8601.spec ++++++ --- /var/tmp/diff_new_pack.7jKeNk/_old 2014-03-13 20:43:55.000000000 +0100 +++ /var/tmp/diff_new_pack.7jKeNk/_new 2014-03-13 20:43:55.000000000 +0100 @@ -16,11 +16,8 @@ # -%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")} -%{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")} - Name: python-iso8601 -Version: 0.1.8 +Version: 0.1.10 Release: 0 Url: http://code.google.com/p/pyiso8601/ Summary: Simple module to parse ISO 8601 dates @@ -29,14 +26,15 @@ Source: iso8601-%{version}.tar.gz BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRequires: python-devel -BuildRequires: python-pytest BuildRequires: python-setuptools -%if 0%{?suse_version} -%py_requires -%if 0%{?suse_version} > 1110 +# Test requirements: +BuildRequires: python-pytest >= 2.4.2 +%if 0%{?suse_version} && 0%{?suse_version} <= 1110 +Requires: python-argparse +%{!?python_sitelib: %global python_sitelib %(python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")} +%else BuildArch: noarch %endif -%endif %description Simple module to parse ISO 8601 dates @@ -51,7 +49,7 @@ python setup.py build %check -# py.test iso8601 +py.test --verbose iso8601 %install python setup.py install --prefix=%{_prefix} --root=%{buildroot} ++++++ iso8601-0.1.8.tar.gz -> iso8601-0.1.10.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/iso8601-0.1.8/PKG-INFO new/iso8601-0.1.10/PKG-INFO --- old/iso8601-0.1.8/PKG-INFO 2013-10-22 18:03:58.000000000 +0200 +++ new/iso8601-0.1.10/PKG-INFO 2014-02-27 16:14:10.000000000 +0100 @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: iso8601 -Version: 0.1.8 +Version: 0.1.10 Summary: Simple module to parse ISO 8601 dates Home-page: https://bitbucket.org/micktwomey/pyiso8601 Author: Michael Twomey @@ -33,6 +33,7 @@ - YYYY-MM-DD - YYYYMMDD - YYYY-MM (defaults to 1 for the day) + - YYYY (defaults to 1 for month and day) Times ----- @@ -110,6 +111,19 @@ Changes ======= + 0.1.10 + ------ + + * Fixes https://bitbucket.org/micktwomey/pyiso8601/issue/14/regression-yyyy-mm-no-longer-parses (thanks to Kevin Gill for reporting) + * Adds YYYY as a valid date (uses 1 for both month and day) + * Woo, semantic versioning, .10 at last. + + 0.1.9 + ----- + + * Lots of fixes tightening up parsing from jdanjou. In particular more invalid cases are treated as errors. Also includes fixes for tests (which is how these invalid cases got in in the first place). + * Release addresses https://bitbucket.org/micktwomey/pyiso8601/issue/13/new-release-based-on-critical-bug-fix + 0.1.8 ----- diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/iso8601-0.1.8/README.rst new/iso8601-0.1.10/README.rst --- old/iso8601-0.1.8/README.rst 2013-10-22 18:03:57.000000000 +0200 +++ new/iso8601-0.1.10/README.rst 2014-02-27 16:14:09.000000000 +0100 @@ -25,6 +25,7 @@ - YYYY-MM-DD - YYYYMMDD - YYYY-MM (defaults to 1 for the day) +- YYYY (defaults to 1 for month and day) Times ----- @@ -102,6 +103,19 @@ Changes ======= +0.1.10 +------ + +* Fixes https://bitbucket.org/micktwomey/pyiso8601/issue/14/regression-yyyy-mm-no-longer-parses (thanks to Kevin Gill for reporting) +* Adds YYYY as a valid date (uses 1 for both month and day) +* Woo, semantic versioning, .10 at last. + +0.1.9 +----- + +* Lots of fixes tightening up parsing from jdanjou. In particular more invalid cases are treated as errors. Also includes fixes for tests (which is how these invalid cases got in in the first place). +* Release addresses https://bitbucket.org/micktwomey/pyiso8601/issue/13/new-release-based-on-critical-bug-fix + 0.1.8 ----- diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/iso8601-0.1.8/dev-requirements.txt new/iso8601-0.1.10/dev-requirements.txt --- old/iso8601-0.1.8/dev-requirements.txt 2013-10-22 18:03:57.000000000 +0200 +++ new/iso8601-0.1.10/dev-requirements.txt 2014-02-27 16:14:09.000000000 +0100 @@ -1,3 +1,4 @@ -pytest >= 2.4.2 -tox >= 1.6.0 -devpi >= 1.1 +devpi>=1.2.1 +pytest>=2.5.2 +tox>=1.7.0 +wheel>=0.22.0 \ No newline at end of file diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/iso8601-0.1.8/iso8601/iso8601.py new/iso8601-0.1.10/iso8601/iso8601.py --- old/iso8601-0.1.8/iso8601/iso8601.py 2013-10-22 18:03:57.000000000 +0200 +++ new/iso8601-0.1.10/iso8601/iso8601.py 2014-02-27 16:14:09.000000000 +0100 @@ -32,27 +32,43 @@ ISO8601_REGEX = re.compile( r""" (?P<year>[0-9]{4}) - (-{0,1}(?P<month>[0-9]{1,2})){1} - (-{0,1}(?P<day>[0-9]{1,2})){1} ( - (?P<separator>[ T]) - (?P<hour>[0-9]{2}) - (:{0,1}(?P<minute>[0-9]{2})){0,1} ( - :{0,1}(?P<second>[0-9]{1,2}) - (\.(?P<second_fraction>[0-9]+)){0,1} - ){0,1} - (?P<timezone> - Z + (-(?P<monthdash>[0-9]{1,2})) | + (?P<month>[0-9]{2}) + (?!$) # Don't allow YYYYMM + ) + ( + ( + (-(?P<daydash>[0-9]{1,2})) + | + (?P<day>[0-9]{2}) + ) ( - (?P<tz_sign>[-+]) - (?P<tz_hour>[0-9]{2}) - :{0,1} - (?P<tz_minute>[0-9]{2}){0,1} + ( + (?P<separator>[ T]) + (?P<hour>[0-9]{2}) + (:{0,1}(?P<minute>[0-9]{2})){0,1} + ( + :{0,1}(?P<second>[0-9]{1,2}) + (\.(?P<second_fraction>[0-9]+)){0,1} + ){0,1} + (?P<timezone> + Z + | + ( + (?P<tz_sign>[-+]) + (?P<tz_hour>[0-9]{2}) + :{0,1} + (?P<tz_minute>[0-9]{2}){0,1} + ) + ){0,1} + ){0,1} ) - ){0,1} - ){0,1} + ){0,1} # YYYY-MM + ){0,1} # YYYY only + $ """, re.VERBOSE ) @@ -113,20 +129,22 @@ def __repr__(self): return "<FixedOffset %r %r>" % (self.__name, self.__offset) -def to_int(d, key, default_to_zero=False, default=None): +def to_int(d, key, default_to_zero=False, default=None, required=True): """Pull a value from the dict and convert to int :param default_to_zero: If the value is None or empty, treat it as zero :param default: If the value is missing in the dict use this default """ - value = d.get(key, default) + value = d.get(key) or default LOG.debug("Got %r for %r with default %r", value, key, default) if (value in ["", None]) and default_to_zero: return 0 if value is None: - raise ParseError("Unable to read %s from %s" % (key, d)) - return int(value) + if required: + raise ParseError("Unable to read %s from %s" % (key, d)) + else: + return int(value) def parse_timezone(matches, default_timezone=UTC): """Parses ISO 8601 time zone specs into tzinfo offsets @@ -172,8 +190,8 @@ try: return datetime( year=to_int(groups, "year"), - month=to_int(groups, "month"), - day=to_int(groups, "day"), + month=to_int(groups, "month", default=to_int(groups, "monthdash", required=False, default=1)), + day=to_int(groups, "day", default=to_int(groups, "daydash", required=False, default=1)), hour=to_int(groups, "hour", default_to_zero=True), minute=to_int(groups, "minute", default_to_zero=True), second=to_int(groups, "second", default_to_zero=True), diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/iso8601-0.1.8/iso8601/test_iso8601.py new/iso8601-0.1.10/iso8601/test_iso8601.py --- old/iso8601-0.1.8/iso8601/test_iso8601.py 2013-10-22 18:03:57.000000000 +0200 +++ new/iso8601-0.1.10/iso8601/test_iso8601.py 2014-02-27 16:14:09.000000000 +0100 @@ -26,21 +26,27 @@ d = iso8601.parse_date("2007-01-01T08:00:00Z", default_timezone=tz) assert d == datetime.datetime(2007, 1, 1, 8, 0, 0, 0, iso8601.UTC) -@pytest.mark.parametrize("invalid_date", [ - ("2013-10-",), - ("2013-",), - ("",), - (None,), - ("23",), - ("131015T142533Z",), - ("131015",), - ("2007-06-23X06:40:34.00Z", ), # https://code.google.com/p/pyiso8601/issues/detail?id=14 - ("2007-06-23 06:40:34.00Zrubbish", ), # https://code.google.com/p/pyiso8601/issues/detail?id=14 +@pytest.mark.parametrize("invalid_date, error_string", [ + ("2013-10-", "Unable to parse date string"), + ("2013-", "Unable to parse date string"), + ("", "Unable to parse date string"), + (None, "Expecting a string"), + ("wibble", "Unable to parse date string"), + ("23", "Unable to parse date string"), + ("131015T142533Z", "Unable to parse date string"), + ("131015", "Unable to parse date string"), + ("20141", "Unable to parse date string"), + ("201402", "Unable to parse date string"), + ("2007-06-23X06:40:34.00Z", "Unable to parse date string"), # https://code.google.com/p/pyiso8601/issues/detail?id=14 + ("2007-06-23 06:40:34.00Zrubbish", "Unable to parse date string"), # https://code.google.com/p/pyiso8601/issues/detail?id=14 + ("20114-01-03T01:45:49", "Unable to parse date string"), ]) -def test_parse_invalid_date(invalid_date): +def test_parse_invalid_date(invalid_date, error_string): + assert isinstance(invalid_date, str) or invalid_date is None # Why? 'cos I've screwed up the parametrize before :) with pytest.raises(iso8601.ParseError) as exc: iso8601.parse_date(invalid_date) assert exc.errisinstance(iso8601.ParseError) + assert str(exc.value).startswith(error_string) @pytest.mark.parametrize("valid_date,expected_datetime,isoformat", [ ("2007-06-23 06:40:34.00Z", datetime.datetime(2007, 6, 23, 6, 40, 34, 0, iso8601.UTC), "2007-06-23T06:40:34+00:00"), # Handle a separator other than T @@ -48,7 +54,7 @@ ("2007-01-01T08:00:00", datetime.datetime(2007, 1, 1, 8, 0, 0, 0, iso8601.UTC), "2007-01-01T08:00:00+00:00"), # Handle timezone-less dates. Assumes UTC. http://code.google.com/p/pyiso8601/issues/detail?id=4 ("2006-10-20T15:34:56.123+02:30", datetime.datetime(2006, 10, 20, 15, 34, 56, 123000, iso8601.FixedOffset(2, 30, "+02:30")), None), ("2006-10-20T15:34:56Z", datetime.datetime(2006, 10, 20, 15, 34, 56, 0, iso8601.UTC), "2006-10-20T15:34:56+00:00"), - ("2007-5-7T11:43:55.328Z'", datetime.datetime(2007, 5, 7, 11, 43, 55, 328000, iso8601.UTC), "2007-05-07T11:43:55.328000+00:00"), # http://code.google.com/p/pyiso8601/issues/detail?id=6 + ("2007-5-7T11:43:55.328Z", datetime.datetime(2007, 5, 7, 11, 43, 55, 328000, iso8601.UTC), "2007-05-07T11:43:55.328000+00:00"), # http://code.google.com/p/pyiso8601/issues/detail?id=6 ("2006-10-20T15:34:56.123Z", datetime.datetime(2006, 10, 20, 15, 34, 56, 123000, iso8601.UTC), "2006-10-20T15:34:56.123000+00:00"), ("2013-10-15T18:30Z", datetime.datetime(2013, 10, 15, 18, 30, 0, 0, iso8601.UTC), "2013-10-15T18:30:00+00:00"), ("2013-10-15T22:30+04", datetime.datetime(2013, 10, 15, 22, 30, 0, 0, iso8601.FixedOffset(4, 0, "+04:00")), "2013-10-15T22:30:00+04:00"), # <time>±hh:mm @@ -69,6 +75,8 @@ ("2010-06-12", datetime.datetime(2010, 6, 12, tzinfo=iso8601.UTC), "2010-06-12T00:00:00+00:00"), # https://code.google.com/p/pyiso8601/issues/detail?id=16 ("1985-04-12T23:20:50.52-05:30", datetime.datetime(1985, 4, 12, 23, 20, 50, 520000, iso8601.FixedOffset(-5, -30, "-05:30")), "1985-04-12T23:20:50.520000-05:30"), # https://bitbucket.org/micktwomey/pyiso8601/issue/8/015-parses-negative-timezones-incorrectly ("1997-08-29T06:14:00.000123Z", datetime.datetime(1997, 8, 29, 6, 14, 0, 123, iso8601.UTC), "1997-08-29T06:14:00.000123+00:00"), # https://bitbucket.org/micktwomey/pyiso8601/issue/9/regression-parsing-microseconds + ("2014-02", datetime.datetime(2014, 2, 1, 0, 0, 0, 0, iso8601.UTC), "2014-02-01T00:00:00+00:00"), # https://bitbucket.org/micktwomey/pyiso8601/issue/14/regression-yyyy-mm-no-longer-parses + ("2014", datetime.datetime(2014, 1, 1, 0, 0, 0, 0, iso8601.UTC), "2014-01-01T00:00:00+00:00"), # YYYY ]) def test_parse_valid_date(valid_date, expected_datetime, isoformat): parsed = iso8601.parse_date(valid_date) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/iso8601-0.1.8/iso8601.egg-info/PKG-INFO new/iso8601-0.1.10/iso8601.egg-info/PKG-INFO --- old/iso8601-0.1.8/iso8601.egg-info/PKG-INFO 2013-10-22 18:03:58.000000000 +0200 +++ new/iso8601-0.1.10/iso8601.egg-info/PKG-INFO 2014-02-27 16:14:09.000000000 +0100 @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: iso8601 -Version: 0.1.8 +Version: 0.1.10 Summary: Simple module to parse ISO 8601 dates Home-page: https://bitbucket.org/micktwomey/pyiso8601 Author: Michael Twomey @@ -33,6 +33,7 @@ - YYYY-MM-DD - YYYYMMDD - YYYY-MM (defaults to 1 for the day) + - YYYY (defaults to 1 for month and day) Times ----- @@ -110,6 +111,19 @@ Changes ======= + 0.1.10 + ------ + + * Fixes https://bitbucket.org/micktwomey/pyiso8601/issue/14/regression-yyyy-mm-no-longer-parses (thanks to Kevin Gill for reporting) + * Adds YYYY as a valid date (uses 1 for both month and day) + * Woo, semantic versioning, .10 at last. + + 0.1.9 + ----- + + * Lots of fixes tightening up parsing from jdanjou. In particular more invalid cases are treated as errors. Also includes fixes for tests (which is how these invalid cases got in in the first place). + * Release addresses https://bitbucket.org/micktwomey/pyiso8601/issue/13/new-release-based-on-critical-bug-fix + 0.1.8 ----- diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/iso8601-0.1.8/setup.cfg new/iso8601-0.1.10/setup.cfg --- old/iso8601-0.1.8/setup.cfg 2013-10-22 18:03:58.000000000 +0200 +++ new/iso8601-0.1.10/setup.cfg 2014-02-27 16:14:10.000000000 +0100 @@ -1,5 +1,5 @@ [egg_info] -tag_build = -tag_date = 0 tag_svn_revision = 0 +tag_date = 0 +tag_build = diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/iso8601-0.1.8/setup.py new/iso8601-0.1.10/setup.py --- old/iso8601-0.1.8/setup.py 2013-10-22 18:03:57.000000000 +0200 +++ new/iso8601-0.1.10/setup.py 2014-02-27 16:14:09.000000000 +0100 @@ -9,7 +9,7 @@ setup( name="iso8601", - version="0.1.8", + version="0.1.10", description=long_description.split("\n")[0], long_description=long_description, author="Michael Twomey", diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/iso8601-0.1.8/tox.ini new/iso8601-0.1.10/tox.ini --- old/iso8601-0.1.8/tox.ini 2013-10-22 18:03:57.000000000 +0200 +++ new/iso8601-0.1.10/tox.ini 2014-02-27 16:14:09.000000000 +0100 @@ -3,6 +3,6 @@ [testenv] deps=pytest>=2.4.2 -commands=py.test iso8601 +commands=py.test --verbose iso8601 setenv = LC_ALL=C -- To unsubscribe, e-mail: opensuse-commit+unsubscr...@opensuse.org For additional commands, e-mail: opensuse-commit+h...@opensuse.org