Hello community,
here is the log from the commit of package python-python-daemon for
openSUSE:Factory checked in at 2015-09-08 17:39:27
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-python-daemon (Old)
and /work/SRC/openSUSE:Factory/.python-python-daemon.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-python-daemon"
Changes:
--------
---
/work/SRC/openSUSE:Factory/python-python-daemon/python-python-daemon.changes
2015-05-27 12:50:08.000000000 +0200
+++
/work/SRC/openSUSE:Factory/.python-python-daemon.new/python-python-daemon.changes
2015-09-08 17:42:44.000000000 +0200
@@ -1,0 +2,9 @@
+Thu Sep 3 14:17:06 UTC 2015 - [email protected]
+
+- Update to 2.0.6
+ * Lower dependency for unittest2, we can work with an earlier version.
+ * Specify development status Production/Stable in Trove classifiers.
+ * Migrate to mock version 1.3 with corresponding API changes.
+ * Use current Python concept of basestring to test for an attribute name.
+
+-------------------------------------------------------------------
Old:
----
python-daemon-2.0.5.tar.gz
New:
----
python-daemon-2.0.6.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-python-daemon.spec ++++++
--- /var/tmp/diff_new_pack.ez8x4B/_old 2015-09-08 17:42:45.000000000 +0200
+++ /var/tmp/diff_new_pack.ez8x4B/_new 2015-09-08 17:42:45.000000000 +0200
@@ -17,7 +17,7 @@
Name: python-python-daemon
-Version: 2.0.5
+Version: 2.0.6
Release: 0
Url: http://pypi.python.org/pypi/python-daemon/
Summary: Library to implement a well-behaved Unix daemon process
++++++ python-daemon-2.0.5.tar.gz -> python-daemon-2.0.6.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/python-daemon-2.0.5/ChangeLog
new/python-daemon-2.0.6/ChangeLog
--- old/python-daemon-2.0.5/ChangeLog 2015-02-02 05:43:28.000000000 +0100
+++ new/python-daemon-2.0.6/ChangeLog 2015-08-30 11:14:42.000000000 +0200
@@ -1,3 +1,16 @@
+Version 2.0.6
+=============
+
+:Released: 2015-08-30
+:Maintainer: Ben Finney <[email protected]>
+
+* Lower dependency for ‘unittest2’, we can work with an earlier version.
+* Specify development status “Production/Stable” in Trove classifiers.
+* Migrate to ‘mock’ version 1.3 with corresponding API changes.
+* Use current Python concept of “basestring” to test for an attribute name.
+ Thanks to Arthur de Jong for the bug report.
+
+
Version 2.0.5
=============
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/python-daemon-2.0.5/PKG-INFO
new/python-daemon-2.0.6/PKG-INFO
--- old/python-daemon-2.0.5/PKG-INFO 2015-02-02 05:44:42.000000000 +0100
+++ new/python-daemon-2.0.6/PKG-INFO 2015-08-30 11:16:48.000000000 +0200
@@ -1,6 +1,6 @@
Metadata-Version: 1.1
Name: python-daemon
-Version: 2.0.5
+Version: 2.0.6
Summary: Library to implement a well-behaved Unix daemon process.
Home-page: https://alioth.debian.org/projects/python-daemon/
Author: Ben Finney
@@ -29,7 +29,7 @@
documentation for that class for each option.
Keywords: daemon,fork,unix
Platform: UNKNOWN
-Classifier: Development Status :: 4 - Beta
+Classifier: Development Status :: 5 - Production/Stable
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Operating System :: POSIX
Classifier: Programming Language :: Python :: 2.7
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/python-daemon-2.0.5/daemon/daemon.py
new/python-daemon-2.0.6/daemon/daemon.py
--- old/python-daemon-2.0.5/daemon/daemon.py 2015-02-02 05:43:28.000000000
+0100
+++ new/python-daemon-2.0.6/daemon/daemon.py 2015-08-30 11:10:43.000000000
+0200
@@ -483,7 +483,7 @@
"""
if target is None:
result = signal.SIG_IGN
- elif isinstance(target, unicode):
+ elif isinstance(target, basestring):
name = target
result = getattr(self, name)
else:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/python-daemon-2.0.5/python_daemon.egg-info/PKG-INFO
new/python-daemon-2.0.6/python_daemon.egg-info/PKG-INFO
--- old/python-daemon-2.0.5/python_daemon.egg-info/PKG-INFO 2015-02-02
05:44:32.000000000 +0100
+++ new/python-daemon-2.0.6/python_daemon.egg-info/PKG-INFO 2015-08-30
11:16:48.000000000 +0200
@@ -1,6 +1,6 @@
Metadata-Version: 1.1
Name: python-daemon
-Version: 2.0.5
+Version: 2.0.6
Summary: Library to implement a well-behaved Unix daemon process.
Home-page: https://alioth.debian.org/projects/python-daemon/
Author: Ben Finney
@@ -29,7 +29,7 @@
documentation for that class for each option.
Keywords: daemon,fork,unix
Platform: UNKNOWN
-Classifier: Development Status :: 4 - Beta
+Classifier: Development Status :: 5 - Production/Stable
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Operating System :: POSIX
Classifier: Programming Language :: Python :: 2.7
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/python-daemon-2.0.5/python_daemon.egg-info/version_info.json
new/python-daemon-2.0.6/python_daemon.egg-info/version_info.json
--- old/python-daemon-2.0.5/python_daemon.egg-info/version_info.json
2015-02-02 05:44:33.000000000 +0100
+++ new/python-daemon-2.0.6/python_daemon.egg-info/version_info.json
2015-08-30 11:16:48.000000000 +0200
@@ -1,6 +1,6 @@
{
- "release_date": "2015-02-02",
- "version": "2.0.5",
- "maintainer": "Ben Finney <[email protected]>",
- "body": "* Refine compatibility of exceptions for file operations.\n*
Specify the text encoding when opening the changelog file.\n"
+ "release_date": "2015-08-30",
+ "version": "2.0.6",
+ "maintainer": "Ben Finney <[email protected]>",
+ "body": "* Lower dependency for \u2018unittest2\u2019, we can work with an
earlier version.\n* Specify development status \u201cProduction/Stable\u201d in
Trove classifiers.\n* Migrate to \u2018mock\u2019 version 1.3 with
corresponding API changes.\n* Use current Python concept of
\u201cbasestring\u201d to test for an attribute name.\n Thanks to Arthur de
Jong for the bug report.\n"
}
\ No newline at end of file
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/python-daemon-2.0.5/setup.cfg
new/python-daemon-2.0.6/setup.cfg
--- old/python-daemon-2.0.5/setup.cfg 2015-02-02 05:44:42.000000000 +0100
+++ new/python-daemon-2.0.6/setup.cfg 2015-08-30 11:16:48.000000000 +0200
@@ -4,8 +4,11 @@
[bdist_wheel]
universal = true
+[upload]
+sign = true
+
[egg_info]
-tag_svn_revision = 0
-tag_date = 0
tag_build =
+tag_date = 0
+tag_svn_revision = 0
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/python-daemon-2.0.5/setup.py
new/python-daemon-2.0.6/setup.py
--- old/python-daemon-2.0.5/setup.py 2015-02-02 05:43:28.000000000 +0100
+++ new/python-daemon-2.0.6/setup.py 2015-08-30 11:08:58.000000000 +0200
@@ -66,10 +66,10 @@
],
test_suite="unittest2.collector",
tests_require=[
- "unittest2 >=0.6",
+ "unittest2 >=0.5.1",
"testtools",
"testscenarios >=0.4",
- "mock >=1.0",
+ "mock >=1.3",
"docutils",
],
install_requires=[
@@ -88,7 +88,7 @@
long_description=long_description,
classifiers=[
# Reference: http://pypi.python.org/pypi?%3Aaction=list_classifiers
- "Development Status :: 4 - Beta",
+ "Development Status :: 5 - Production/Stable",
"License :: OSI Approved :: Apache Software License",
"Operating System :: POSIX",
"Programming Language :: Python :: 2.7",
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/python-daemon-2.0.5/test/scaffold.py
new/python-daemon-2.0.6/test/scaffold.py
--- old/python-daemon-2.0.5/test/scaffold.py 2015-01-10 12:29:24.000000000
+0100
+++ new/python-daemon-2.0.6/test/scaffold.py 2015-02-22 20:46:58.000000000
+0100
@@ -61,8 +61,8 @@
* 'arg_count': The number of arguments expected by the function.
* 'arg_names': A sequence of the argument names, as strings.
* 'arg_defaults': A sequence of the default values for the arguments.
- * 'va_args': The name bound to remaining positional arguments.
- * 'va_kw_args': The name bound to remaining keyword arguments.
+ * 'var_args': The name bound to remaining positional arguments.
+ * 'var_kw_args': The name bound to remaining keyword arguments.
"""
try:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/python-daemon-2.0.5/test/test_daemon.py
new/python-daemon-2.0.6/test/test_daemon.py
--- old/python-daemon-2.0.5/test/test_daemon.py 2015-02-02 05:43:28.000000000
+0100
+++ new/python-daemon-2.0.6/test/test_daemon.py 2015-08-30 11:10:43.000000000
+0200
@@ -744,10 +744,18 @@
result = instance._make_signal_handler(target)
self.assertEqual(expected_result, result)
- def test_returns_method_for_name(self):
- """ Should return method of DaemonContext when name specified. """
+ def test_returns_method_for_str_name(self):
+ """ Should return DaemonContext method for name of type ‘str’. """
instance = self.test_instance
- target = 'terminate'
+ target = str('terminate')
+ expected_result = instance.terminate
+ result = instance._make_signal_handler(target)
+ self.assertEqual(expected_result, result)
+
+ def test_returns_method_for_unicode_name(self):
+ """ Should return DaemonContext method for name of type ‘unicode’. """
+ instance = self.test_instance
+ target = unicode('terminate')
expected_result = instance.terminate
result = instance._make_signal_handler(target)
self.assertEqual(expected_result, result)
@@ -1011,9 +1019,14 @@
"""
args = self.test_args
+ mock_os_module = mock.MagicMock()
+ mock_os_module.attach_mock(mock_func_os_setuid, "setuid")
+ mock_os_module.attach_mock(mock_func_os_setgid, "setgid")
daemon.daemon.change_process_owner(**args)
- mock_func_os_setuid.assert_called()
- mock_func_os_setgid.assert_called()
+ mock_os_module.assert_has_calls([
+ mock.call.setgid(mock.ANY),
+ mock.call.setuid(mock.ANY),
+ ])
def test_changes_group_id_to_gid(
self,
@@ -1022,7 +1035,7 @@
args = self.test_args
gid = self.test_gid
daemon.daemon.change_process_owner(**args)
- mock_func_os_setgid.assert_called(gid)
+ mock_func_os_setgid.assert_called_once_with(gid)
def test_changes_user_id_to_uid(
self,
@@ -1031,7 +1044,7 @@
args = self.test_args
uid = self.test_uid
daemon.daemon.change_process_owner(**args)
- mock_func_os_setuid.assert_called(uid)
+ mock_func_os_setuid.assert_called_once_with(uid)
def test_raises_daemon_error_on_os_error_from_setgid(
self,
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/python-daemon-2.0.5/test_version.py
new/python-daemon-2.0.6/test_version.py
--- old/python-daemon-2.0.5/test_version.py 2015-02-02 05:43:28.000000000
+0100
+++ new/python-daemon-2.0.6/test_version.py 2015-02-03 02:10:54.000000000
+0100
@@ -19,6 +19,7 @@
import io
import errno
import functools
+import contextlib
import collections
import textwrap
import json
@@ -249,7 +250,25 @@
self.assertEqual(expected_output, instance.output)
-class ChangeLogEntry_TestCase(testtools.TestCase):
+class NoOpContextManager:
+ """ A context manager with no effect. """
+ def __enter__(self): pass
+ def __exit__(self, exc_type, exc_value, traceback): pass
+
+
+class ChangeLogEntry_BaseTestCase(
+ testscenarios.WithScenarios, testtools.TestCase):
+ """ Base class for ‘ChangeLogEntry’ test case classes. """
+
+ def expected_error_context(self):
+ """ Make a context manager to expect the nominated error. """
+ context = NoOpContextManager()
+ if hasattr(self, 'expected_error'):
+ context = testtools.ExpectedException(self.expected_error)
+ return context
+
+
+class ChangeLogEntry_TestCase(ChangeLogEntry_BaseTestCase):
""" Test cases for ‘ChangeLogEntry’ class. """
def setUp(self):
@@ -269,8 +288,7 @@
self.assertIsNot(instance, None)
-class ChangeLogEntry_release_date_TestCase(
- testscenarios.WithScenarios, testtools.TestCase):
+class ChangeLogEntry_release_date_TestCase(ChangeLogEntry_BaseTestCase):
""" Test cases for ‘ChangeLogEntry.release_date’ attribute. """
scenarios = [
@@ -299,17 +317,13 @@
def test_has_expected_release_date(self):
""" Should have default `release_date` attribute. """
- if hasattr(self, 'expected_error'):
- self.assertRaises(
- self.expected_error,
- version.ChangeLogEntry, **self.test_args)
- else:
+ with self.expected_error_context():
instance = version.ChangeLogEntry(**self.test_args)
+ if hasattr(self, 'expected_release_date'):
self.assertEqual(self.expected_release_date, instance.release_date)
-class ChangeLogEntry_version_TestCase(
- testscenarios.WithScenarios, testtools.TestCase):
+class ChangeLogEntry_version_TestCase(ChangeLogEntry_BaseTestCase):
""" Test cases for ‘ChangeLogEntry.version’ attribute. """
scenarios = [
@@ -322,20 +336,57 @@
'test_args': {'version': "UNKNOWN"},
'expected_version': "UNKNOWN",
}),
+ ('next token', {
+ 'test_args': {'version': "NEXT"},
+ 'expected_version': "NEXT",
+ }),
('0.0', {
'test_args': {'version': "0.0"},
'expected_version': "0.0",
}),
+ ('1.2.3', {
+ 'test_args': {'version': "1.2.3"},
+ 'expected_version': "1.2.3",
+ }),
+ ('1.23.456', {
+ 'test_args': {'version': "1.23.456"},
+ 'expected_version': "1.23.456",
+ }),
+ ('1.23.456a5', {
+ 'test_args': {'version': "1.23.456a5"},
+ 'expected_version': "1.23.456a5",
+ }),
+ ('123.456.789', {
+ 'test_args': {'version': "123.456.789"},
+ 'expected_version': "123.456.789",
+ }),
+ ('non-number', {
+ 'test_args': {'version': "b0gUs"},
+ 'expected_error': ValueError,
+ }),
+ ('negative', {
+ 'test_args': {'version': "-1.0"},
+ 'expected_error': ValueError,
+ }),
+ ('non-number parts', {
+ 'test_args': {'version': "1.b0gUs.0"},
+ 'expected_error': ValueError,
+ }),
+ ('too many parts', {
+ 'test_args': {'version': "1.2.3.4.5"},
+ 'expected_error': ValueError,
+ }),
]
def test_has_expected_version(self):
""" Should have default `version` attribute. """
- instance = version.ChangeLogEntry(**self.test_args)
- self.assertEqual(self.expected_version, instance.version)
+ with self.expected_error_context():
+ instance = version.ChangeLogEntry(**self.test_args)
+ if hasattr(self, 'expected_version'):
+ self.assertEqual(self.expected_version, instance.version)
-class ChangeLogEntry_maintainer_TestCase(
- testscenarios.WithScenarios, testtools.TestCase):
+class ChangeLogEntry_maintainer_TestCase(ChangeLogEntry_BaseTestCase):
""" Test cases for ‘ChangeLogEntry.maintainer’ attribute. """
scenarios = [
@@ -355,17 +406,13 @@
def test_has_expected_maintainer(self):
""" Should have default `maintainer` attribute. """
- if hasattr(self, 'expected_error'):
- self.assertRaises(
- self.expected_error,
- version.ChangeLogEntry, **self.test_args)
- else:
+ with self.expected_error_context():
instance = version.ChangeLogEntry(**self.test_args)
+ if hasattr(self, 'expected_maintainer'):
self.assertEqual(self.expected_maintainer, instance.maintainer)
-class ChangeLogEntry_body_TestCase(
- testscenarios.WithScenarios, testtools.TestCase):
+class ChangeLogEntry_body_TestCase(ChangeLogEntry_BaseTestCase):
""" Test cases for ‘ChangeLogEntry.body’ attribute. """
scenarios = [
@@ -386,7 +433,7 @@
class ChangeLogEntry_as_version_info_entry_TestCase(
- testscenarios.WithScenarios, testtools.TestCase):
+ ChangeLogEntry_BaseTestCase):
""" Test cases for ‘ChangeLogEntry.as_version_info_entry’ attribute. """
scenarios = [
@@ -697,15 +744,19 @@
}),
]
+ def expected_error_context(self):
+ """ Make a context manager to expect the nominated error. """
+ context = NoOpContextManager()
+ if hasattr(self, 'expected_error'):
+ context = testtools.ExpectedException(self.expected_error)
+ return context
+
def test_returns_expected_version_info(self):
""" Should return expected version info mapping. """
infile = StringIO(self.test_input)
- if hasattr(self, 'expected_error'):
- self.assertRaises(
- self.expected_error,
- version.changelog_to_version_info_collection, infile)
- else:
+ with self.expected_error_context():
result = version.changelog_to_version_info_collection(infile)
+ if hasattr(self, 'expected_version_info'):
self.assertThat(result, JsonEqual(self.expected_version_info))
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/python-daemon-2.0.5/version.py
new/python-daemon-2.0.6/version.py
--- old/python-daemon-2.0.5/version.py 2015-02-02 05:43:28.000000000 +0100
+++ new/python-daemon-2.0.6/version.py 2015-02-06 01:57:57.000000000 +0100
@@ -42,6 +42,7 @@
import distutils
import distutils.errors
import distutils.cmd
+import distutils.version
try:
# Python 2 has both ‘str’ (bytes) and ‘unicode’ (text).
basestring = basestring
@@ -143,6 +144,7 @@
self.validate_release_date(release_date)
self.release_date = release_date
+ self.validate_version(version)
self.version = version
self.validate_maintainer(maintainer)
@@ -166,6 +168,25 @@
datetime.datetime.strptime(value, ChangeLogEntry.date_format)
@classmethod
+ def validate_version(cls, value):
+ """ Validate the `version` value.
+
+ :param vaue: The prospective `version` value.
+ :return: ``None`` if the value is valid.
+ :raises ValueError: If the value is invalid.
+
+ """
+ if value in ["UNKNOWN", "NEXT"]:
+ # A valid non-version value.
+ return None
+
+ match = distutils.version.StrictVersion.version_re.match(value)
+ if match is None:
+ raise ValueError(
+ "not a valid version string {value!r}".format(
+ value=value))
+
+ @classmethod
def validate_maintainer(cls, value):
""" Validate the `maintainer` value.
@@ -182,7 +203,9 @@
valid = True
if not valid:
- raise ValueError("Not a valid person specification {value!r}")
+ raise ValueError(
+ "not a valid person specification {value!r}".format(
+ value=value))
else:
return None