Hello community, here is the log from the commit of package python-packaging for openSUSE:Factory checked in at 2015-07-05 18:02:42 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-packaging (Old) and /work/SRC/openSUSE:Factory/.python-packaging.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-packaging" Changes: -------- --- /work/SRC/openSUSE:Factory/python-packaging/python-packaging.changes 2015-07-03 00:17:23.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.python-packaging.new/python-packaging.changes 2015-07-05 18:02:43.000000000 +0200 @@ -1,0 +2,14 @@ +Thu Jun 25 04:01:09 UTC 2015 - [email protected] + +- update to 15.2: + * Fix an error where the arbitary specifier (``===``) was not correctly + allowing pre-releases when it was being used. + * Expose the specifier and version parts through properties on the + ``Specifier`` classes. + * Allow iterating over the ``SpecifierSet`` to get access to all of the + ``Specifier`` instances. + * Allow testing if a version is contained within a specifier via the ``in`` + operator. + + +------------------------------------------------------------------- Old: ---- packaging-15.1.tar.gz New: ---- packaging-15.2.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-packaging.spec ++++++ --- /var/tmp/diff_new_pack.WRHPqt/_old 2015-07-05 18:02:43.000000000 +0200 +++ /var/tmp/diff_new_pack.WRHPqt/_new 2015-07-05 18:02:43.000000000 +0200 @@ -1,7 +1,7 @@ # # spec file for package python-packaging # -# Copyright (c) 2015 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -13,20 +13,21 @@ # published by the Open Source Initiative. # Please submit bugfixes or comments via http://bugs.opensuse.org/ +# Name: python-packaging -Version: 15.1 +Version: 15.2 Release: 0 -License: Apache-2.0 Summary: Core utilities for Python packages -Url: https://github.com/pypa/packaging +License: Apache-2.0 Group: Development/Languages/Python +Url: https://github.com/pypa/packaging Source: https://pypi.python.org/packages/source/p/packaging/packaging-%{version}.tar.gz BuildRequires: python-devel -BuildRequires: python-setuptools -BuildRequires: python-pytest BuildRequires: python-pretend +BuildRequires: python-pytest +BuildRequires: python-setuptools BuildRoot: %{_tmppath}/%{name}-%{version}-build %if 0%{?suse_version} && 0%{?suse_version} <= 1110 %{!?python_sitelib: %global python_sitelib %(python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")} ++++++ packaging-15.1.tar.gz -> packaging-15.2.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/packaging-15.1/CHANGELOG.rst new/packaging-15.2/CHANGELOG.rst --- old/packaging-15.1/CHANGELOG.rst 2015-04-15 02:27:02.000000000 +0200 +++ new/packaging-15.2/CHANGELOG.rst 2015-05-13 23:43:29.000000000 +0200 @@ -1,6 +1,22 @@ Changelog --------- +15.2 - 2015-05-13 +~~~~~~~~~~~~~~~~~ + +* Fix an error where the arbitary specifier (``===``) was not correctly + allowing pre-releases when it was being used. + +* Expose the specifier and version parts through properties on the + ``Specifier`` classes. + +* Allow iterating over the ``SpecifierSet`` to get access to all of the + ``Specifier`` instances. + +* Allow testing if a version is contained within a specifier via the ``in`` + operator. + + 15.1 - 2015-04-13 ~~~~~~~~~~~~~~~~~ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/packaging-15.1/PKG-INFO new/packaging-15.2/PKG-INFO --- old/packaging-15.1/PKG-INFO 2015-04-15 02:27:16.000000000 +0200 +++ new/packaging-15.2/PKG-INFO 2015-05-13 23:43:34.000000000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: packaging -Version: 15.1 +Version: 15.2 Summary: Core utilities for Python packages Home-page: https://github.com/pypa/packaging Author: Donald Stufft @@ -32,6 +32,22 @@ Changelog --------- + 15.2 - 2015-05-13 + ~~~~~~~~~~~~~~~~~ + + * Fix an error where the arbitary specifier (``===``) was not correctly + allowing pre-releases when it was being used. + + * Expose the specifier and version parts through properties on the + ``Specifier`` classes. + + * Allow iterating over the ``SpecifierSet`` to get access to all of the + ``Specifier`` instances. + + * Allow testing if a version is contained within a specifier via the ``in`` + operator. + + 15.1 - 2015-04-13 ~~~~~~~~~~~~~~~~~ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/packaging-15.1/docs/specifiers.rst new/packaging-15.2/docs/specifiers.rst --- old/packaging-15.1/docs/specifiers.rst 2015-04-15 02:27:03.000000000 +0200 +++ new/packaging-15.2/docs/specifiers.rst 2015-05-13 23:43:29.000000000 +0200 @@ -32,12 +32,12 @@ >>> v1 = Version("1.0a5") >>> v2 = Version("1.0") >>> # We can check a version object to see if it falls within a specifier - >>> combined_spec.contains(v1) + >>> v1 in combined_spec False - >>> combined_spec.contains(v2) + >>> v2 in combined_spec True >>> # We can even do the same with a string based version - >>> combined_spec.contains("1.4") + >>> "1.4" in combined_spec True >>> # Finally we can filter a list of versions to get only those which are >>> # contained within our specifier. @@ -79,6 +79,14 @@ prereleases or it can be set to ``None`` (the default) to enable autodetection. + .. method:: __contains__(version) + + This is the more Pythonic version of :meth:`contains()`, but does + not allow you to override the ``prereleases`` argument. If you + need that, use :meth:`contains()`. + + See :meth:`contains()`. + .. method:: contains(version, prereleases=None) Determines if ``version``, which can be either a version string, a @@ -91,6 +99,15 @@ determine if to allow them. Otherwise it will use the boolean value of the passed in value to determine if to allow them or not. + .. method:: __len__() + + Returns the number of specifiers in this specifier set. + + .. method:: __iter__() + + Returns an iterator over all the underlying :class:`Specifier` + (or :class:`LegacySpecifier`) instances in this specifier set. + .. method:: filter(iterable, prereleases=None) Takes an iterable that can contain version strings, :class:`Version`, @@ -126,10 +143,22 @@ :raises InvalidSpecifier: If the ``specifier`` does not conform to PEP 440 in any way then this exception will be raised. + .. attribute:: operator + + The string value of the operator part of this specifier. + + .. attribute:: version + + The string version of the version part of this specifier. + .. attribute:: prereleases See :attr:`SpecifierSet.prereleases`. + .. method:: __contains__(version) + + See :meth:`SpecifierSet.__contains__()`. + .. method:: contains(version, prereleases=None) See :meth:`SpecifierSet.contains()`. @@ -154,10 +183,22 @@ :raises InvalidSpecifier: If the ``specifier`` is not parseable than this will be raised. + .. attribute:: operator + + The string value of the operator part of this specifier. + + .. attribute:: version + + The string version of the version part of this specifier. + .. attribute:: prereleases See :attr:`SpecifierSet.prereleases`. + .. method:: __contains__(version) + + See :meth:`SpecifierSet.__contains__()`. + .. method:: contains(version, prereleases=None) See :meth:`SpecifierSet.contains()`. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/packaging-15.1/packaging/__about__.py new/packaging-15.2/packaging/__about__.py --- old/packaging-15.1/packaging/__about__.py 2015-04-15 02:27:03.000000000 +0200 +++ new/packaging-15.2/packaging/__about__.py 2015-05-13 23:43:29.000000000 +0200 @@ -22,7 +22,7 @@ __summary__ = "Core utilities for Python packages" __uri__ = "https://github.com/pypa/packaging" -__version__ = "15.1" +__version__ = "15.2" __author__ = "Donald Stufft" __email__ = "[email protected]" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/packaging-15.1/packaging/specifiers.py new/packaging-15.2/packaging/specifiers.py --- old/packaging-15.1/packaging/specifiers.py 2015-04-15 02:27:03.000000000 +0200 +++ new/packaging-15.2/packaging/specifiers.py 2015-05-13 23:43:29.000000000 +0200 @@ -152,6 +152,14 @@ return version @property + def operator(self): + return self._spec[0] + + @property + def version(self): + return self._spec[1] + + @property def prereleases(self): return self._prereleases @@ -159,6 +167,9 @@ def prereleases(self, value): self._prereleases = value + def __contains__(self, item): + return self.contains(item) + def contains(self, item, prereleases=None): # Determine if prereleases are to be allowed or not. if prereleases is None: @@ -176,7 +187,7 @@ # Actually do the comparison to determine if this item is contained # within this Specifier or not. - return self._get_operator(self._spec[0])(item, self._spec[1]) + return self._get_operator(self.operator)(item, self.version) def filter(self, iterable, prereleases=None): yielded = False @@ -526,7 +537,7 @@ # operators, and if they are if they are including an explicit # prerelease. operator, version = self._spec - if operator in ["==", ">=", "<=", "~="]: + if operator in ["==", ">=", "<=", "~=", "==="]: # The == specifier can include a trailing .*, if it does we # want to remove before parsing. if operator == "==" and version.endswith(".*"): @@ -666,6 +677,12 @@ return self._specs != other._specs + def __len__(self): + return len(self._specs) + + def __iter__(self): + return iter(self._specs) + @property def prereleases(self): # If we have been given an explicit prerelease modifier, then we'll @@ -687,6 +704,9 @@ def prereleases(self, value): self._prereleases = value + def __contains__(self, item): + return self.contains(item) + def contains(self, item, prereleases=None): # Ensure that our item is a Version or LegacyVersion instance. if not isinstance(item, (LegacyVersion, Version)): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/packaging-15.1/packaging.egg-info/PKG-INFO new/packaging-15.2/packaging.egg-info/PKG-INFO --- old/packaging-15.1/packaging.egg-info/PKG-INFO 2015-04-15 02:27:12.000000000 +0200 +++ new/packaging-15.2/packaging.egg-info/PKG-INFO 2015-05-13 23:43:34.000000000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: packaging -Version: 15.1 +Version: 15.2 Summary: Core utilities for Python packages Home-page: https://github.com/pypa/packaging Author: Donald Stufft @@ -32,6 +32,22 @@ Changelog --------- + 15.2 - 2015-05-13 + ~~~~~~~~~~~~~~~~~ + + * Fix an error where the arbitary specifier (``===``) was not correctly + allowing pre-releases when it was being used. + + * Expose the specifier and version parts through properties on the + ``Specifier`` classes. + + * Allow iterating over the ``SpecifierSet`` to get access to all of the + ``Specifier`` instances. + + * Allow testing if a version is contained within a specifier via the ``in`` + operator. + + 15.1 - 2015-04-13 ~~~~~~~~~~~~~~~~~ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/packaging-15.1/packaging.egg-info/pbr.json new/packaging-15.2/packaging.egg-info/pbr.json --- old/packaging-15.1/packaging.egg-info/pbr.json 2015-04-15 02:27:12.000000000 +0200 +++ new/packaging-15.2/packaging.egg-info/pbr.json 2015-05-13 23:43:34.000000000 +0200 @@ -1 +1 @@ -{"is_release": true, "git_version": "4151632"} \ No newline at end of file +{"git_version": "7c7bec5", "is_release": true} \ No newline at end of file diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/packaging-15.1/setup.cfg new/packaging-15.2/setup.cfg --- old/packaging-15.1/setup.cfg 2015-04-15 02:27:16.000000000 +0200 +++ new/packaging-15.2/setup.cfg 2015-05-13 23:43:34.000000000 +0200 @@ -2,7 +2,7 @@ universal = 1 [egg_info] -tag_date = 0 tag_build = +tag_date = 0 tag_svn_revision = 0 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/packaging-15.1/tests/test_specifiers.py new/packaging-15.2/tests/test_specifiers.py --- old/packaging-15.1/tests/test_specifiers.py 2015-04-15 02:27:03.000000000 +0200 +++ new/packaging-15.2/tests/test_specifiers.py 2015-05-13 23:43:29.000000000 +0200 @@ -508,15 +508,19 @@ if expected: # Test that the plain string form works + assert version in spec assert spec.contains(version) # Test that the version instance form works + assert Version(version) in spec assert spec.contains(Version(version)) else: # Test that the plain string form works + assert version not in spec assert not spec.contains(version) # Test that the version instance form works + assert Version(version) not in spec assert not spec.contains(Version(version)) @pytest.mark.parametrize( @@ -528,6 +532,7 @@ ("1.0", "===1.0", True), ("nope", "===lolwat", False), ("1.0.0", "===1.0", False), + ("1.0.dev0", "===1.0.dev0", True), ], ) def test_specifiers_identity(self, version, spec, expected): @@ -535,10 +540,10 @@ if expected: # Identity comparisons only support the plain string form - assert spec.contains(version) + assert version in spec else: # Identity comparisons only support the plain string form - assert not spec.contains(version) + assert version not in spec @pytest.mark.parametrize( ("specifier", "expected"), @@ -576,13 +581,13 @@ spec = Specifier(specifier) if expected: - assert spec.contains(version) + assert version in spec spec.prereleases = False - assert not spec.contains(version) + assert version not in spec else: - assert not spec.contains(version) + assert version not in spec spec.prereleases = True - assert spec.contains(version) + assert version in spec @pytest.mark.parametrize( ("specifier", "prereleases", "input", "expected"), @@ -601,8 +606,74 @@ assert list(spec.filter(input, **kwargs)) == expected - def test_specifier_explicit_leacy(self): - Specifier("==1.0").contains(LegacyVersion("1.0")) + @pytest.mark.xfail + def test_specifier_explicit_legacy(self): + assert Specifier("==1.0").contains(LegacyVersion("1.0")) + + @pytest.mark.parametrize( + ('spec', 'op'), + [ + ('~=2.0', '~='), + ('==2.1.*', '=='), + ('==2.1.0.3', '=='), + ('!=2.2.*', '!='), + ('!=2.2.0.5', '!='), + ('<=5', '<='), + ('>=7.9a1', '>='), + ('<1.0.dev1', '<'), + ('>2.0.post1', '>'), + ('===lolwat', '==='), + ] + ) + def test_specifier_operator_property(self, spec, op): + assert Specifier(spec).operator == op + + @pytest.mark.parametrize( + ('spec', 'version'), + [ + ('~=2.0', '2.0'), + ('==2.1.*', '2.1.*'), + ('==2.1.0.3', '2.1.0.3'), + ('!=2.2.*', '2.2.*'), + ('!=2.2.0.5', '2.2.0.5'), + ('<=5', '5'), + ('>=7.9a1', '7.9a1'), + ('<1.0.dev1', '1.0.dev1'), + ('>2.0.post1', '2.0.post1'), + ('===lolwat', 'lolwat'), + ] + ) + def test_specifier_version_property(self, spec, version): + assert Specifier(spec).version == version + + @pytest.mark.parametrize( + ("spec", "expected_length"), + [ + ("", 0), + ("==2.0", 1), + (">=2.0", 1), + (">=2.0,<3", 2), + (">=2.0,<3,==2.4", 3), + ], + ) + def test_length(self, spec, expected_length): + spec = SpecifierSet(spec) + assert len(spec) == expected_length + + @pytest.mark.parametrize( + ("spec", "expected_items"), + [ + ("", []), + ("==2.0", ["==2.0"]), + (">=2.0", [">=2.0"]), + (">=2.0,<3", [">=2.0", "<3"]), + (">=2.0,<3,==2.4", [">=2.0", "<3", "==2.4"]), + ], + ) + def test_iteration(self, spec, expected_items): + spec = SpecifierSet(spec) + items = set(str(item) for item in spec) + assert items == set(expected_items) class TestLegacySpecifier: @@ -707,15 +778,19 @@ if expected: # Test that the plain string form works + assert version in spec assert spec.contains(version) # Test that the version instance form works + assert LegacyVersion(version) in spec assert spec.contains(LegacyVersion(version)) else: # Test that the plain string form works + assert version not in spec assert not spec.contains(version) # Test that the version instance form works + assert LegacyVersion(version) not in spec assert not spec.contains(LegacyVersion(version)) def test_specifier_explicit_prereleases(self): @@ -749,29 +824,37 @@ def test_empty_specifier(self, version): spec = SpecifierSet(prereleases=True) + assert version in spec assert spec.contains(version) + assert parse(version) in spec assert spec.contains(parse(version)) def test_specifier_prereleases_explicit(self): spec = SpecifierSet() assert not spec.prereleases + assert "1.0.dev1" not in spec assert not spec.contains("1.0.dev1") spec.prereleases = True assert spec.prereleases + assert "1.0.dev1" in spec assert spec.contains("1.0.dev1") spec = SpecifierSet(prereleases=True) assert spec.prereleases + assert "1.0.dev1" in spec assert spec.contains("1.0.dev1") spec.prereleases = False assert not spec.prereleases + assert "1.0.dev1" not in spec assert not spec.contains("1.0.dev1") spec = SpecifierSet(prereleases=True) assert spec.prereleases + assert "1.0.dev1" in spec assert spec.contains("1.0.dev1") spec.prereleases = None assert not spec.prereleases + assert "1.0.dev1" not in spec assert not spec.contains("1.0.dev1") def test_specifier_contains_prereleases(self): @@ -827,7 +910,7 @@ def test_legacy_specifiers_combined(self): spec = SpecifierSet("<3,>1-1-1") - assert spec.contains("2.0") + assert "2.0" in spec @pytest.mark.parametrize( ("specifier", "expected"),
