Hello community,
here is the log from the commit of package python-python-daemon for
openSUSE:Factory checked in at 2020-03-03 10:15:08
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-python-daemon (Old)
and /work/SRC/openSUSE:Factory/.python-python-daemon.new.26092 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-python-daemon"
Tue Mar 3 10:15:08 2020 rev:22 rq:780388 version:2.2.4
Changes:
--------
---
/work/SRC/openSUSE:Factory/python-python-daemon/python-python-daemon.changes
2019-05-16 22:06:42.790469503 +0200
+++
/work/SRC/openSUSE:Factory/.python-python-daemon.new.26092/python-python-daemon.changes
2020-03-03 10:15:28.686555743 +0100
@@ -1,0 +2,11 @@
+Fri Feb 28 21:41:00 UTC 2020 - Dirk Mueller <[email protected]>
+
+- update to 2.2.4:
+ * Run the Setuptools `egg-info` command as part of the `build`
+ command.
+ * Create the socket and catch “non-socket” errors.
+ * Only deal with a range of file descriptors if the range is not empty.
+ * Declare Twine as a build dependency.
+ * Reformat the change log entries with keepachangelog.com sub-sections.
+
+-------------------------------------------------------------------
Old:
----
python-daemon-2.2.3.tar.gz
New:
----
python-daemon-2.2.4.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-python-daemon.spec ++++++
--- /var/tmp/diff_new_pack.nscawS/_old 2020-03-03 10:15:30.914560352 +0100
+++ /var/tmp/diff_new_pack.nscawS/_new 2020-03-03 10:15:30.946560418 +0100
@@ -1,7 +1,7 @@
#
# spec file for package python-python-daemon
#
-# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2020 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -19,7 +19,7 @@
%define oldpython python
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
Name: python-python-daemon
-Version: 2.2.3
+Version: 2.2.4
Release: 0
Summary: Library to implement a well-behaved Unix daemon process
License: Apache-2.0 AND GPL-3.0-only
@@ -33,6 +33,7 @@
BuildRequires: %{python_module setuptools}
BuildRequires: %{python_module testscenarios >= 0.4}
BuildRequires: %{python_module testtools}
+BuildRequires: %{python_module twine}
BuildRequires: fdupes
BuildRequires: python-rpm-macros
Requires: python-lockfile >= 0.10
++++++ python-daemon-2.2.3.tar.gz -> python-daemon-2.2.4.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/python-daemon-2.2.3/ChangeLog
new/python-daemon-2.2.4/ChangeLog
--- old/python-daemon-2.2.3/ChangeLog 2019-01-21 01:29:14.000000000 +0100
+++ new/python-daemon-2.2.4/ChangeLog 2019-10-27 05:03:40.000000000 +0100
@@ -8,20 +8,65 @@
.. _Semantic Versioning: https://semver.org/
+Version 2.2.4
+=============
+
+:Released: 2019-10-27
+:Maintainer: Ben Finney <[email protected]>
+
+Bugs Fixed:
+
+* Run the Setuptools `egg-info` command as part of the `build`
+ command.
+
+ Closes: Pagure #31. Thanks to Stanislav Levin for the bug report and
+ diagnosis.
+
+* Create the socket and catch “non-socket” errors.
+
+ Closes: Pagure #34. Thanks to Miro Hrončok for the bug report and
+ patch.
+
+* Only deal with a range of file descriptors if the range is not empty.
+
+ Closes: Pagure #39. Thanks to Alex Pyrgiotis for the test scenario.
+
+* Declare Twine as a build dependency.
+
+* Reformat the change log entries with keepachangelog.com sub-sections.
+
+Changed:
+
+* Upgrade Tox dependency to version “3.7.0”.
+
+ Thanks to Miro Hrončok for the contribution.
+
+* Significant speed-up to discovery of file descriptors to close.
+
+ By using a native `tuple` for the heavily-used file descriptor range
+ representation, this gives approximately 5× faster calls to
+ `close_all_open_files` in the typical case. This partially addresses
+ Pagure #40.
+
+ Thanks to Alex Pyrgiotis for testing various alternative proposals.
+
+* Refactor the build system to use Makefile modules for each topic.
+
+
Version 2.2.3
=============
:Released: 2019-01-21
:Maintainer: Ben Finney <[email protected]>
-Bug Fixes:
+Bugs Fixed:
* Use custom fake file type for testing `fileno` behaviour.
This works around an incompatibility in Python 2.7 `file` type that
caused test cases to fail.
-Changes:
+Deprecated:
* Promote the warning for `runner` module to a `DeprecationWarning`.
This has been an unofficial example module from the beginning, and
@@ -34,12 +79,12 @@
:Released: 2019-01-19
:Maintainer: Ben Finney <[email protected]>
-Bug Fixes:
+Bugs Fixed:
* Remove from the build system specification a white space character
not permitted in TOML format.
-Additions:
+Added:
* Implement test suite automation in virtualenvs, using Tox.
@@ -50,7 +95,7 @@
:Released: 2019-01-18
:Maintainer: Ben Finney <[email protected]>
-Additions:
+Added:
* Add a :PEP:`518` conformant build system specification (the
``pyproject.toml`` file).
@@ -62,7 +107,7 @@
:Released: 2018-08-15
:Maintainer: Ben Finney <[email protected]>
-Bug Fixes:
+Bugs Fixed:
* Correct the description of the return value for
`daemon.is_detach_process_context_required`.
@@ -76,7 +121,7 @@
Closes: Pagure #2.
-Changes:
+Changed:
* The test suite now relies on the test discovery feature in
‘unittest’. This feature is in Python version 2.7 and later.
@@ -94,19 +139,22 @@
:Released: 2016-10-26
:Maintainer: Ben Finney <[email protected]>
-Additions:
+Added:
* Add a README document for the code base.
-Changes:
+Changed:
* Migrate code project hosting to Pagure.
Record the change of homepage URL in PyPI metadata.
+
+Deprecated:
+
* Raise a warning that the ‘runner’ module is pending deprecation.
This has been an unofficial example module from the beginning, and
it will be removed in a future version.
-Bug Fixes:
+Bugs Fixed:
* Ensure custom types are part of the Python type hierarchy.
* Avoid a circular dependency for the version string at install time.
@@ -119,7 +167,7 @@
:Released: 2016-01-30
:Maintainer: Ben Finney <[email protected]>
-Bug Fixes:
+Bugs Fixed:
* Default ‘initgroups’ option to False. Using ‘os.initgroups’ requires
permission to set process GID, so this now needs to be explicitly
@@ -132,7 +180,7 @@
:Released: 2015-11-26
:Maintainer: Ben Finney <[email protected]>
-Additions:
+Added:
* Add a DaemonContext option, ‘initgroups’, which specifies whether to
set the daemon process's supplementary groups.
@@ -147,13 +195,13 @@
:Released: 2015-08-30
:Maintainer: Ben Finney <[email protected]>
-Changes:
+Changed:
* 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.
-Bug Fixes:
+Bugs Fixed:
* Use current Python concept of “basestring” to test for an attribute name.
Thanks to Arthur de Jong for the bug report.
@@ -165,7 +213,7 @@
:Released: 2015-02-02
:Maintainer: Ben Finney <[email protected]>
-Bug Fixes:
+Bugs Fixed:
* Refine compatibility of exceptions for file operations.
* Specify the text encoding when opening the changelog file.
@@ -177,11 +225,11 @@
:Released: 2015-01-23
:Maintainer: Ben Finney <[email protected]>
-Changes:
+Changed:
* Record version info via Setuptools commands.
-Removals:
+Removed:
* Remove the custom Setuptools entry points.
This closes Alioth bug#314948.
@@ -193,16 +241,16 @@
:Released: 2015-01-14
:Maintainer: Ben Finney <[email protected]>
-Changes:
+Changed:
* Refactor all initial metadata functionality to ‘daemon._metadata’.
* Build a “universal” (Python 2 and Python 3) wheel.
-Removals:
+Removed:
* Distribute ‘version’ (and its tests) only in source, not install.
-Bug Fixes:
+Bugs Fixed:
* Break circular import dependency for ‘setup.py’.
@@ -213,12 +261,12 @@
:Released: 2015-01-13
:Maintainer: Ben Finney <[email protected]>
-Additions:
+Added:
* Include unit tests for ‘version’ module with source distribution.
* Record version info consistent with distribution metadata.
-Bug Fixes:
+Bugs Fixed:
* Declare test-time dependency on recent ‘unittest2’.
* Declare packaging-time dependency on ‘docutils’ library.
@@ -230,7 +278,7 @@
:Released: 2015-01-11
:Maintainer: Ben Finney <[email protected]>
-Bug Fixes:
+Bugs Fixed:
* Include the ‘version’ module with source distribution.
@@ -241,7 +289,7 @@
:Released: 2015-01-10
:Maintainer: Ben Finney <[email protected]>
-Additions:
+Added:
* Support both Python 3 (version 3.2 or later) and Python 2 (version
2.7 or later).
@@ -259,7 +307,7 @@
* Add unit tests for metadata.
* Store and retrieve version info in Setuptools metadata.
-Changes:
+Changed:
* Depend on Python 3 compatible libraries.
* Update package homepage to Alioth hosted project page.
@@ -280,7 +328,7 @@
* Move package metadata to ‘daemon/_metadata.py’.
* Migrate to JSON (instead of Python) for serialised version info.
-Removals:
+Removed:
* Remove ASCII translation of package description, not needed now the
docstring is a proper Unicode text value.
@@ -293,11 +341,11 @@
:Released: 2014-08-04
:Maintainer: Ben Finney <[email protected]>
-Additions:
+Added:
* Add editor hints for most files.
-Changes:
+Changed:
* Distinguish continuation-line indentation versus block indentation.
* Use unicode literals by default, specifying bytes where necessary.
@@ -310,7 +358,7 @@
* Change license of library code to Apache License 2.0. Rationale at
<URL:http://wiki.python.org/moin/PythonSoftwareFoundationLicenseFaq#Contributing_Code_to_Python>.
-Bug Fixes:
+Bugs Fixed:
* Use unambiguous “except FooType as foo” syntax.
This is to ease the port to Python 3, where the ambiguous comma
@@ -326,12 +374,12 @@
:Released: 2010-05-10
:Maintainer: Ben Finney <[email protected]>
-Additions:
+Added:
* FAQ: Add some entries and re-structure the document.
* MANIFEST.in: Include the documentation in the distribution.
-Changes:
+Changed:
* Use absolute imports to disambiguate provenance of names.
* setup.py: Require ‘lockfile >=0.9’.
@@ -339,7 +387,7 @@
* Use ‘unicode’ data type for all text values.
* Prepare for Python 3 upgrade by tweaking some names and imports.
-Removals:
+Removed:
* daemon/pidfile.py: Renamed from ‘daemon/pidlockfile.py’. Change
references elsewhere to use this new name.
@@ -355,7 +403,7 @@
:Released: 2010-03-02
:Maintainer: Ben Finney <[email protected]>
-Bug Fixes:
+Bugs Fixed:
* Stop using ‘pkg_resources’ and revert to pre-1.5.3 version-string
handling, until a better way that doesn't break everyone else's
@@ -368,7 +416,7 @@
:Released: 2010-02-27
:Maintainer: Ben Finney <[email protected]>
-Bug Fixes:
+Bugs Fixed:
* MANIFEST.in: Explicitly include version data file, otherwise
everything breaks for users of the sdist.
@@ -380,19 +428,19 @@
:Released: 2010-02-26
:Maintainer: Ben Finney <[email protected]>
-Additions:
+Added:
* version: New plain-text data file to store project version string.
* Add ‘pylint’ configuration for this project.
-Changes:
+Changed:
* setup.py: Read version string from data file.
* daemon/version/__init__.py: Query version string with ‘pkg_resources’.
* Update copyright notices.
-Bug Fixes:
+Bugs Fixed:
* daemon/daemon.py: Invoke the pidfile context manager's ‘__exit__’
method with the correct arguments (as per
@@ -406,11 +454,11 @@
:Released: 2009-10-24
:Maintainer: Ben Finney <[email protected]>
-Additions:
+Added:
* Add initial Frequently Asked Questions document.
-Bug Fixes:
+Bugs Fixed:
* Ensure we only prevent core dumps if ‘prevent_core’ is true.
Thanks to Denis Bilenko for reporting the lacking implementation of
@@ -423,7 +471,7 @@
:Released: 2009-09-26
:Maintainer: Ben Finney <[email protected]>
-Additions:
+Added:
* Make a separate collection of DaemonRunner test scenarios.
* Handle a start request with a timeout on the PID file lock acquire.
@@ -439,11 +487,11 @@
:Released: 2009-09-24
:Maintainer: Ben Finney <[email protected]>
-Additions:
+Added:
* Make a separate collection of PIDLockFile test scenarios.
-Changes:
+Changed:
* Refactor code to ‘_terminate_daemon_process’ method.
* Improve explanations in comments and docstrings.
@@ -453,7 +501,7 @@
* Manage the excluded file descriptors as a set (not a list).
-Bug Fixes:
+Bugs Fixed:
* Raise specific errors on ‘DaemonRunner’ failures.
* Distinguish different conditions on reading and parsing PID file.
@@ -470,23 +518,23 @@
:Released: 2009-09-17
:Maintainer: Ben Finney <[email protected]>
-Additions:
+Added:
* Document requirement for ensuring any operating-system specific
signal handlers are considered.
* Add specific license terms for unit test suite scaffold.
-Changes:
+Changed:
* Refactor ‘fork_then_exit_parent’ functionality to avoid duplicate
code.
-Removals:
+Removed:
* Remove redundant imports.
* Remove unused code from unit test suite scaffold.
-Bug Fixes:
+Bugs Fixed:
* Remove child-exit signal (‘SIGCLD’, ‘SIGCHLD’) from default signal
map. Thanks to Joel Martin for pinpointing this issue.
@@ -498,11 +546,11 @@
:Released: 2009-09-03
:Maintainer: Ben Finney <[email protected]>
-Removals:
+Removed:
* Exclude ‘test’ package from distribution installation.
-Bug Fixes:
+Bugs Fixed:
* Fix keywords argument for distribution setup.
@@ -513,7 +561,7 @@
:Released: 2009-06-21
:Maintainer: Ben Finney <[email protected]>
-Additions:
+Added:
* Update documentation for changes from latest PEP 3143 revision.
* Implement DaemonContext.is_open method.
@@ -525,14 +573,14 @@
:Released: 2009-05-17
:Maintainer: Ben Finney <[email protected]>
-Additions:
+Added:
* Improve docstrings by reference to, and copy from, PEP 3143.
* Use mock checking capabilities of newer ‘MiniMock’ library.
* Automate building a versioned distribution tarball.
* Include developer documentation files in source distribution.
-Bug Fixes:
+Bugs Fixed:
* Register DaemonContext.close method for atexit processing.
* Move PID file cleanup to close method.
@@ -544,13 +592,13 @@
:Released: 2009-03-26
:Maintainer: Ben Finney <[email protected]>
-Changes:
+Changed:
* Conform to current PEP version, now released as PEP 3143 “Standard
daemon process library”.
* Redirect standard streams to null device by default.
-Bug Fixes:
+Bugs Fixed:
* Ensure UID and GID are set in correct order.
* Delay closing all open files until just before re-binding standard
@@ -563,7 +611,7 @@
:Released: 2009-03-19
:Maintainer: Ben Finney <[email protected]>
-Bug Fixes:
+Bugs Fixed:
* Close the PID file context on exit.
@@ -574,7 +622,7 @@
:Released: 2009-03-18
:Maintainer: Ben Finney <[email protected]>
-Additions:
+Added:
* Context manager methods for DaemonContext.
@@ -585,7 +633,7 @@
:Released: 2009-03-18
:Maintainer: Ben Finney <[email protected]>
-Changes:
+Changed:
* Improvements to docstrings.
* Further conformance with draft PEP.
@@ -597,11 +645,11 @@
:Released: 2009-03-17
:Maintainer: Ben Finney <[email protected]>
-Additions:
+Added:
* Complete statement coverage from unit test suite.
-Changes:
+Changed:
* Implement the interface from a draft PEP for process daemonisation.
@@ -612,16 +660,16 @@
:Released: 2009-03-12
:Maintainer: Ben Finney <[email protected]>
-Additions:
+Added:
* Huge increase in unit test suite.
-Changes:
+Changed:
* Separate controller (now ‘DaemonRunner’) from daemon process
context (now ‘DaemonContext’).
-Bug Fixes:
+Bugs Fixed:
* Fix many corner cases and bugs.
@@ -632,11 +680,11 @@
:Released: 2009-01-27
:Maintainer: Ben Finney <[email protected]>
-Additions:
+Added:
* Begin unit test suite.
-Changes:
+Changed:
* Initial release of this project forked from ‘bda.daemon’. Thanks,
Robert Niederreiter.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/python-daemon-2.2.3/PKG-INFO
new/python-daemon-2.2.4/PKG-INFO
--- old/python-daemon-2.2.3/PKG-INFO 2019-01-21 01:30:09.000000000 +0100
+++ new/python-daemon-2.2.4/PKG-INFO 2019-10-27 05:05:45.000000000 +0100
@@ -1,6 +1,6 @@
-Metadata-Version: 1.1
+Metadata-Version: 2.1
Name: python-daemon
-Version: 2.2.3
+Version: 2.2.4
Summary: Library to implement a well-behaved Unix daemon process.
Home-page: https://pagure.io/python-daemon/
Author: Ben Finney
@@ -36,3 +36,5 @@
Classifier: Programming Language :: Python :: 3
Classifier: Intended Audience :: Developers
Classifier: Topic :: Software Development :: Libraries :: Python Modules
+Description-Content-Type: text/x-rst
+Provides-Extra: test
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/python-daemon-2.2.3/daemon/daemon.py
new/python-daemon-2.2.4/daemon/daemon.py
--- old/python-daemon-2.2.3/daemon/daemon.py 2019-01-19 08:22:59.000000000
+0100
+++ new/python-daemon-2.2.4/daemon/daemon.py 2019-10-27 05:02:59.000000000
+0100
@@ -13,7 +13,6 @@
from __future__ import (absolute_import, unicode_literals)
import atexit
-import collections
import errno
import os
import pwd
@@ -761,9 +760,8 @@
"""
result = False
- file_socket = socket.fromfd(fd, socket.AF_INET, socket.SOCK_RAW)
-
try:
+ file_socket = socket.fromfd(fd, socket.AF_INET, socket.SOCK_RAW)
file_socket.getsockopt(socket.SOL_SOCKET, socket.SO_TYPE)
except socket.error as exc:
exc_errno = exc.args[0]
@@ -891,10 +889,6 @@
return candidates
-FileDescriptorRange = collections.namedtuple(
- 'FileDescriptorRange', ['low', 'high'])
-
-
def _get_candidate_file_descriptor_ranges(exclude):
""" Get the collection of candidate file descriptor ranges.
@@ -913,35 +907,42 @@
"""
candidates_list = sorted(_get_candidate_file_descriptors(exclude))
ranges = []
- this_range = FileDescriptorRange(
- low=min(candidates_list),
- high=(min(candidates_list) + 1))
+
+ def append_range_if_needed(candidate_range):
+ (low, high) = candidate_range
+ if (low < high):
+ # The range is not empty.
+ ranges.append(candidate_range)
+
+ this_range = (
+ (min(candidates_list), (min(candidates_list) + 1))
+ if candidates_list else (0, 0))
for fd in candidates_list[1:]:
high = fd + 1
- if this_range.high == fd:
+ if this_range[1] == fd:
# This file descriptor extends the current range.
- this_range = this_range._replace(high=high)
+ this_range = (this_range[0], high)
else:
# The previous range has ended at a gap.
- ranges.append(this_range)
+ append_range_if_needed(this_range)
# This file descriptor begins a new range.
- this_range = FileDescriptorRange(low=fd, high=high)
- ranges.append(this_range)
+ this_range = (fd, high)
+ append_range_if_needed(this_range)
return ranges
def _close_file_descriptor_ranges(ranges):
""" Close file descriptors described by `ranges`.
- :param ranges: A sequence of `FileDescriptorRange` instances,
- each describing a range of file descriptors to close.
+ :param ranges: A sequence of tuples `(low, high)`, each
+ describing a range of file descriptors to close.
:return: ``None``.
Attempt to close each open file descriptor – starting from
`low` and ending before `high` – from each range in `ranges`.
"""
for range in ranges:
- os.closerange(range.low, range.high)
+ os.closerange(range[0], range[1])
def close_all_open_files(exclude=None):
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/python-daemon-2.2.3/doc/CREDITS
new/python-daemon-2.2.4/doc/CREDITS
--- old/python-daemon-2.2.3/doc/CREDITS 2019-01-19 07:05:08.000000000 +0100
+++ new/python-daemon-2.2.4/doc/CREDITS 2019-10-05 05:17:59.000000000 +0200
@@ -1,7 +1,7 @@
Credits for contributors to ‘python-daemon’
###########################################
-:Updated: 2017-10-12
+:Updated: 2019-06-09
The ‘python-daemon’ library is the work of many contributors.
@@ -32,8 +32,11 @@
People who have also contributed substantial improvements:
+* Alex Pyrgiotis
* Darek Działak
* Malcolm Purvis
+* Miro Hrončok
+* Stanislav Levin
..
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/python-daemon-2.2.3/doc/module.mk
new/python-daemon-2.2.4/doc/module.mk
--- old/python-daemon-2.2.3/doc/module.mk 1970-01-01 01:00:00.000000000
+0100
+++ new/python-daemon-2.2.4/doc/module.mk 2019-10-05 05:21:52.000000000
+0200
@@ -0,0 +1,33 @@
+# doc/module.mk
+# Part of ‘python-daemon’, an implementation of PEP 3143.
+#
+# This is free software, and you are welcome to redistribute it under
+# certain conditions; see the end of this file for copyright
+# information, grant of license, and disclaimer of warranty.
+
+# Makefile module for documentation.
+
+MODULE_DIR := $(CURDIR)/doc
+
+include ${MODULE_DIR}/sphinx.mk
+
+
+.PHONY: doc
+doc: sphinx-dirhtml
+
+build: doc
+
+
+# Copyright © 2006–2019 Ben Finney <[email protected]>
+#
+# This is free software: you may copy, modify, and/or distribute this work
+# under the terms of the GNU General Public License as published by the
+# Free Software Foundation; version 3 of that license or any later version.
+# No warranty expressed or implied. See the file ‘LICENSE.GPL-3’ for details.
+
+
+# Local Variables:
+# coding: utf-8
+# mode: makefile
+# End:
+# vim: fileencoding=utf-8 filetype=make :
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/python-daemon-2.2.3/doc/sphinx.mk
new/python-daemon-2.2.4/doc/sphinx.mk
--- old/python-daemon-2.2.3/doc/sphinx.mk 1970-01-01 01:00:00.000000000
+0100
+++ new/python-daemon-2.2.4/doc/sphinx.mk 2019-10-05 05:21:52.000000000
+0200
@@ -0,0 +1,70 @@
+# doc/sphinx.mk
+# Part of ‘python-daemon’, an implementation of PEP 3143.
+#
+# This is free software, and you are welcome to redistribute it under
+# certain conditions; see the end of this file for copyright
+# information, grant of license, and disclaimer of warranty.
+
+# Makefile module for Sphinx documentation.
+
+SPHINX_BUILD = $(PYTHON) -m sphinx
+SPHINX_BUILD_OPTS =
+
+PAPER =
+SPHINX_SOURCE_DIR = ${DOC_DIR}/source
+SPHINX_BUILD_DIR = ${DOC_DIR}/build
+SPHINX_CACHE_DIR = ${SPHINX_BUILD_DIR}/.cache
+
+GENERATED_FILES += ${SPHINX_BUILD_DIR}
+
+PAPEROPT_a4 = -D latex_paper_size=a4
+PAPEROPT_letter = -D latex_paper_size=letter
+SPHINX_BUILD_NOCACHE_OPTS = ${PAPEROPT_${PAPER}} ${SPHINX_BUILD_OPTS}
${SPHINX_SOURCE_DIR}
+SPHINX_BUILD_ALL_OPTS = -d ${SPHINX_CACHE_DIR} ${SPHINX_BUILD_NOCACHE_OPTS}
+
+.PHONY: sphinx-html
+sphinx-html:
+ $(SPHINX_BUILD) -b html ${SPHINX_BUILD_ALL_OPTS}
${SPHINX_BUILD_DIR}/html
+
+.PHONY: sphinx-dirhtml
+sphinx-dirhtml:
+ $(SPHINX_BUILD) -b dirhtml ${SPHINX_BUILD_ALL_OPTS}
${SPHINX_BUILD_DIR}/dirhtml
+
+.PHONY: sphinx-singlehtml
+sphinx-singlehtml:
+ $(SPHINX_BUILD) -b singlehtml ${SPHINX_BUILD_ALL_OPTS}
${SPHINX_BUILD_DIR}/singlehtml
+
+.PHONY: sphinx-text
+sphinx-text:
+ $(SPHINX_BUILD) -b text ${SPHINX_BUILD_ALL_OPTS}
${SPHINX_BUILD_DIR}/text
+
+.PHONY: sphinx-gettext
+sphinx-gettext:
+ $(SPHINX_BUILD) -b gettext ${SPHINX_BUILD_NOCACHE_OPTS}
${SPHINX_BUILD_DIR}/locale
+
+.PHONY: sphinx-linkcheck
+sphinx-linkcheck:
+ $(SPHINX_BUILD) -b linkcheck ${SPHINX_BUILD_ALL_OPTS}
${SPHINX_BUILD_DIR}/linkcheck
+
+.PHONY: sphinx-doctest
+sphinx-doctest:
+ $(SPHINX_BUILD) -b doctest ${SPHINX_BUILD_ALL_OPTS}
${SPHINX_BUILD_DIR}/doctest
+
+.PHONY: sphinx-coverage
+sphinx-coverage:
+ $(SPHINX_BUILD) -b coverage ${SPHINX_BUILD_ALL_OPTS}
${SPHINX_BUILD_DIR}/coverage
+
+
+# Copyright © 2006–2019 Ben Finney <[email protected]>
+#
+# This is free software: you may copy, modify, and/or distribute this work
+# under the terms of the GNU General Public License as published by the
+# Free Software Foundation; version 3 of that license or any later version.
+# No warranty expressed or implied. See the file ‘LICENSE.GPL-3’ for details.
+
+
+# Local Variables:
+# coding: utf-8
+# mode: makefile
+# End:
+# vim: fileencoding=utf-8 filetype=make :
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/python-daemon-2.2.3/python_daemon.egg-info/PKG-INFO
new/python-daemon-2.2.4/python_daemon.egg-info/PKG-INFO
--- old/python-daemon-2.2.3/python_daemon.egg-info/PKG-INFO 2019-01-21
01:30:09.000000000 +0100
+++ new/python-daemon-2.2.4/python_daemon.egg-info/PKG-INFO 2019-10-27
05:05:45.000000000 +0100
@@ -1,6 +1,6 @@
-Metadata-Version: 1.1
+Metadata-Version: 2.1
Name: python-daemon
-Version: 2.2.3
+Version: 2.2.4
Summary: Library to implement a well-behaved Unix daemon process.
Home-page: https://pagure.io/python-daemon/
Author: Ben Finney
@@ -36,3 +36,5 @@
Classifier: Programming Language :: Python :: 3
Classifier: Intended Audience :: Developers
Classifier: Topic :: Software Development :: Libraries :: Python Modules
+Description-Content-Type: text/x-rst
+Provides-Extra: test
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/python-daemon-2.2.3/python_daemon.egg-info/SOURCES.txt
new/python-daemon-2.2.4/python_daemon.egg-info/SOURCES.txt
--- old/python-daemon-2.2.3/python_daemon.egg-info/SOURCES.txt 2019-01-21
01:30:09.000000000 +0100
+++ new/python-daemon-2.2.4/python_daemon.egg-info/SOURCES.txt 2019-10-27
05:05:45.000000000 +0100
@@ -17,6 +17,8 @@
doc/FAQ
doc/TODO
doc/hacking.txt
+doc/module.mk
+doc/sphinx.mk
python_daemon.egg-info/PKG-INFO
python_daemon.egg-info/SOURCES.txt
python_daemon.egg-info/dependency_links.txt
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/python-daemon-2.2.3/python_daemon.egg-info/requires.txt
new/python-daemon-2.2.4/python_daemon.egg-info/requires.txt
--- old/python-daemon-2.2.3/python_daemon.egg-info/requires.txt 2019-01-21
01:30:09.000000000 +0100
+++ new/python-daemon-2.2.4/python_daemon.egg-info/requires.txt 2019-10-27
05:05:45.000000000 +0100
@@ -1,3 +1,11 @@
docutils
lockfile>=0.10
setuptools
+
+[test]
+coverage
+docutils
+mock>=1.3
+testscenarios>=0.4
+testtools
+unittest2>=0.5.1
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/python-daemon-2.2.3/setup.py
new/python-daemon-2.2.4/setup.py
--- old/python-daemon-2.2.3/setup.py 2019-01-21 00:59:50.000000000 +0100
+++ new/python-daemon-2.2.4/setup.py 2019-10-05 05:21:52.000000000 +0200
@@ -43,6 +43,16 @@
suite = loader.discover(os.path.curdir, pattern='test_*.py')
return suite
+
+test_requirements = [
+ "unittest2 >=0.5.1",
+ "testtools",
+ "testscenarios >=0.4",
+ "mock >=1.3",
+ "coverage",
+ "docutils",
+ ]
+
setup_kwargs = dict(
distclass=version.ChangelogAwareDistribution,
@@ -58,19 +68,17 @@
zip_safe=False,
setup_requires=[
"docutils",
+ "twine",
],
test_suite="setup.test_suite",
- tests_require=[
- "unittest2 >=0.5.1",
- "testtools",
- "testscenarios >=0.4",
- "mock >=1.3",
- "docutils",
- ],
+ tests_require=test_requirements,
install_requires=[
"setuptools",
"lockfile >=0.10",
],
+ extras_require={
+ 'test': test_requirements,
+ },
# PyPI metadata.
author=metadata.author_name,
@@ -80,6 +88,7 @@
keywords="daemon fork unix".split(),
url=metadata.url,
long_description=long_description,
+ long_description_content_type="text/x-rst",
classifiers=[
# Reference: <URL:https://pypi.org/classifiers/>
"Development Status :: 5 - Production/Stable",
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/python-daemon-2.2.3/test/test_daemon.py
new/python-daemon-2.2.4/test/test_daemon.py
--- old/python-daemon-2.2.3/test/test_daemon.py 2019-01-20 13:17:49.000000000
+0100
+++ new/python-daemon-2.2.4/test/test_daemon.py 2019-10-27 05:02:59.000000000
+0100
@@ -18,7 +18,6 @@
import io
import os
import pwd
-import random
import resource
import signal
import socket
@@ -1441,6 +1440,19 @@
return fake_default_maxfd
+def make_get_maximum_file_descriptors_patch(self, fake_maxfd):
+ """ Make a `get_maximum_file_descriptors` patch for the `testcase`.
+
+ :param testcase: The `unittest.TestCase` instance to patch.
+ :param fake_maxfd: The fake maximum file descriptor value.
+ :return: The `unittest.mock.patch` object.
+ """
+ func_patcher = mock.patch.object(
+ daemon.daemon, "get_maximum_file_descriptors",
+ return_value=fake_maxfd)
+ return func_patcher
+
+
class _get_candidate_file_descriptors_TestCase(scaffold.TestCaseWithScenarios):
""" Test cases for function `_get_candidate_file_descriptors`. """
@@ -1470,9 +1482,7 @@
def test_returns_expected_file_descriptors(self):
""" Should return the expected set of file descriptors. """
- with mock.patch.object(
- daemon.daemon, "get_maximum_file_descriptors",
- return_value=self.fake_maxfd):
+ with make_get_maximum_file_descriptors_patch(self, self.fake_maxfd):
result = daemon.daemon._get_candidate_file_descriptors(
**self.test_kwargs)
self.assertEqual(result, self.expected_result)
@@ -1483,7 +1493,21 @@
""" Test cases for function `_get_candidate_file_descriptor_ranges`. """
scenarios = [
- ('exclude-three', {
+ ('exclude-none', {
+ 'fake_maxfd': 5,
+ 'test_kwargs': {
+ 'exclude': set(),
+ },
+ 'expected_result': [(0, 5)],
+ }),
+ ('exclude-all', {
+ 'fake_maxfd': 5,
+ 'test_kwargs': {
+ 'exclude': {0, 1, 2, 3, 4},
+ },
+ 'expected_result': [],
+ }),
+ ('exclude-three-discrete', {
'fake_maxfd': 10,
'test_kwargs': {
'exclude': {3, 5, 8},
@@ -1495,6 +1519,35 @@
(9, 10),
],
}),
+ ('exclude-three-consecutive', {
+ 'fake_maxfd': 10,
+ 'test_kwargs': {
+ 'exclude': {3, 4, 5},
+ },
+ 'expected_result': [
+ (0, 3),
+ (6, 10),
+ ],
+ }),
+ ('exclude-lowest', {
+ 'fake_maxfd': 5,
+ 'test_kwargs': {
+ 'exclude': {0},
+ },
+ 'expected_result': [
+ (1, 5),
+ ],
+ }),
+ ('exclude-middle', {
+ 'fake_maxfd': 5,
+ 'test_kwargs': {
+ 'exclude': {1, 2, 3},
+ },
+ 'expected_result': [
+ (0, 1),
+ (4, 5),
+ ],
+ }),
('exclude-highest', {
'fake_maxfd': 5,
'test_kwargs': {
@@ -1504,20 +1557,29 @@
(0, 4),
],
}),
- ('exclude-none', {
+ ('exclude-maxfd', {
'fake_maxfd': 5,
'test_kwargs': {
- 'exclude': set(),
- },
- 'expected_result': [(0, 5)],
+ 'exclude': {5},
+ },
+ 'expected_result': [
+ (0, 5),
+ ],
+ }),
+ ('exclude-out-of-bounds', {
+ 'fake_maxfd': 5,
+ 'test_kwargs': {
+ 'exclude': {-9, -3, 6, 10},
+ },
+ 'expected_result': [
+ (0, 5),
+ ],
}),
]
def test_returns_expected_file_descriptors(self):
""" Should return the expected set of file descriptors. """
- with mock.patch.object(
- daemon.daemon, "get_maximum_file_descriptors",
- return_value=self.fake_maxfd):
+ with make_get_maximum_file_descriptors_patch(self, self.fake_maxfd):
result = daemon.daemon._get_candidate_file_descriptor_ranges(
**self.test_kwargs)
self.assertEqual(result, self.expected_result)
@@ -1531,7 +1593,7 @@
('ranges-one', {
'test_kwargs': {
'ranges': [
- daemon.daemon.FileDescriptorRange(0, 10),
+ (0, 10),
],
},
'expected_os_closerange_calls': [
@@ -1541,9 +1603,9 @@
('ranges-three', {
'test_kwargs': {
'ranges': [
- daemon.daemon.FileDescriptorRange(5, 10),
- daemon.daemon.FileDescriptorRange(0, 3),
- daemon.daemon.FileDescriptorRange(15, 20),
+ (5, 10),
+ (0, 3),
+ (15, 20),
],
},
'expected_os_closerange_calls': [
@@ -1571,16 +1633,13 @@
""" Set up test fixtures. """
super(close_all_open_files_TestCase, self).setUp()
- self.patch_get_maximum_file_descriptors(self.fake_maxfd)
- self.patch_os_closerange()
+ get_maximum_file_descriptors_patch = (
+ make_get_maximum_file_descriptors_patch(
+ self, fake_maxfd=self.fake_maxfd))
+ get_maximum_file_descriptors_patch.start()
+ self.addCleanup(get_maximum_file_descriptors_patch.stop)
- def patch_get_maximum_file_descriptors(self, fake_maxfd):
- """ Patch `get_maximum_file_descriptors` for this test case. """
- func_patcher = mock.patch.object(
- daemon.daemon, "get_maximum_file_descriptors",
- return_value=fake_maxfd)
- self.mock_func_get_maximum_file_descriptors = func_patcher.start()
- self.addCleanup(func_patcher.stop)
+ self.patch_os_closerange()
def patch_os_closerange(self):
""" Patch `os.closerange` function for this test case. """
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/python-daemon-2.2.3/test_version.py
new/python-daemon-2.2.4/test_version.py
--- old/python-daemon-2.2.3/test_version.py 2019-01-20 13:51:35.000000000
+0100
+++ new/python-daemon-2.2.4/test_version.py 2019-10-05 05:17:59.000000000
+0200
@@ -1479,29 +1479,40 @@
set.issubset, "{0} should be a subset of {1}")
-class EggInfoCommand_TestCase(testtools.TestCase):
- """ Test cases for ‘EggInfoCommand’ class. """
+class Command_BaseTestCase:
+ """ Base for test cases for distutils command classes. """
- def setUp(self):
- """ Set up test fixtures. """
- super(EggInfoCommand_TestCase, self).setUp()
-
- self.test_distribution = distutils.dist.Distribution()
- self.test_instance = version.EggInfoCommand(self.test_distribution)
-
- def test_subclass_of_setuptools_egg_info(self):
- """ Should be a subclass of Setuptools ‘egg_info’. """
- self.assertIsInstance(
- self.test_instance, setuptools.command.egg_info.egg_info)
+ def test_subclass_of_base_command(self):
+ """ Should be a subclass of expected base command class.. """
+ self.assertIsInstance(self.test_instance, self.base_command_class)
def test_sub_commands_include_base_class_sub_commands(self):
""" Should include base class's sub-commands in this sub_commands. """
- base_command = setuptools.command.egg_info.egg_info
- expected_sub_commands = base_command.sub_commands
+ expected_sub_commands = self.base_command_class.sub_commands
self.assertThat(
set(expected_sub_commands),
IsSubset(set(self.test_instance.sub_commands)))
+
+class EggInfoCommand_BaseTestCase(testtools.TestCase):
+ """ Base for test cases for class ‘EggInfoCommand’. """
+
+ command_class = version.EggInfoCommand
+ base_command_class = setuptools.command.egg_info.egg_info
+
+ def setUp(self):
+ """ Set up test fixtures. """
+ super(EggInfoCommand_BaseTestCase, self).setUp()
+
+ self.test_distribution = distutils.dist.Distribution()
+ self.test_instance = self.command_class(self.test_distribution)
+
+
+class EggInfoCommand_TestCase(
+ EggInfoCommand_BaseTestCase,
+ Command_BaseTestCase):
+ """ Test cases for ‘EggInfoCommand’ class. """
+
def test_sub_commands_includes_write_version_info_command(self):
""" Should include sub-command named ‘write_version_info’. """
commands_by_name = dict(self.test_instance.sub_commands)
@@ -1509,51 +1520,98 @@
expected_item = ('write_version_info', expected_predicate)
self.assertIn(expected_item, commands_by_name.items())
-
[email protected](setuptools.command.egg_info.egg_info, "run")
-class EggInfoCommand_run_TestCase(testtools.TestCase):
+
[email protected](
+ setuptools.command.egg_info.egg_info, "run",
+ return_value=None,
+ )
+class EggInfoCommand_run_TestCase(EggInfoCommand_BaseTestCase):
""" Test cases for ‘EggInfoCommand.run’ method. """
def setUp(self):
""" Set up test fixtures. """
super(EggInfoCommand_run_TestCase, self).setUp()
- self.test_distribution = distutils.dist.Distribution()
- self.test_instance = version.EggInfoCommand(self.test_distribution)
-
- base_command = setuptools.command.egg_info.egg_info
patcher_func_egg_info_get_sub_commands = mock.patch.object(
- base_command, "get_sub_commands")
+ self.base_command_class, "get_sub_commands")
patcher_func_egg_info_get_sub_commands.start()
self.addCleanup(patcher_func_egg_info_get_sub_commands.stop)
patcher_func_egg_info_run_command = mock.patch.object(
- base_command, "run_command")
+ self.base_command_class, "run_command")
patcher_func_egg_info_run_command.start()
self.addCleanup(patcher_func_egg_info_run_command.stop)
- self.fake_sub_commands = ["spam", "eggs", "beans"]
- base_command.get_sub_commands.return_value = self.fake_sub_commands
-
def test_returns_none(self, mock_func_egg_info_run):
""" Should return ``None``. """
result = self.test_instance.run()
self.assertIs(result, None)
- def test_runs_each_command_in_sub_commands(
- self, mock_func_egg_info_run):
- """ Should run each command in ‘self.get_sub_commands()’. """
- base_command = setuptools.command.egg_info.egg_info
- self.test_instance.run()
- expected_calls = [mock.call(name) for name in self.fake_sub_commands]
- base_command.run_command.assert_has_calls(expected_calls)
-
def test_calls_base_class_run(self, mock_func_egg_info_run):
""" Should call base class's ‘run’ method. """
self.test_instance.run()
mock_func_egg_info_run.assert_called_with()
+class BuildCommand_BaseTestCase(testtools.TestCase):
+ """ Base for test cases for class ‘BuildCommand’. """
+
+ command_class = version.BuildCommand
+ base_command_class = distutils.command.build.build
+
+ def setUp(self):
+ """ Set up test fixtures. """
+ super(BuildCommand_BaseTestCase, self).setUp()
+
+ self.test_distribution = distutils.dist.Distribution()
+ self.test_instance = self.command_class(self.test_distribution)
+
+
+class BuildCommand_TestCase(
+ BuildCommand_BaseTestCase,
+ Command_BaseTestCase):
+ """ Test cases for ‘BuildCommand’ class. """
+
+ def test_sub_commands_includes_egg_info_command(self):
+ """ Should include sub-command named ‘egg_info’. """
+ commands_by_name = dict(self.test_instance.sub_commands)
+ expected_predicate = None
+ expected_item = ('egg_info', expected_predicate)
+ self.assertIn(expected_item, commands_by_name.items())
+
+
[email protected](
+ distutils.command.build.build, "run",
+ return_value=None,
+ )
+class BuildCommand_run_TestCase(BuildCommand_BaseTestCase):
+ """ Test cases for ‘BuildCommand.run’ method. """
+
+ def setUp(self):
+ """ Set up test fixtures. """
+ super(BuildCommand_run_TestCase, self).setUp()
+
+ patcher_func_build_get_sub_commands = mock.patch.object(
+ self.base_command_class, "get_sub_commands")
+ patcher_func_build_get_sub_commands.start()
+ self.addCleanup(patcher_func_build_get_sub_commands.stop)
+
+ patcher_func_build_run_command = mock.patch.object(
+ self.base_command_class, "run_command")
+ patcher_func_build_run_command.start()
+ self.addCleanup(patcher_func_build_run_command.stop)
+
+ def test_returns_none(self, mock_func_build_run):
+ """ Should return ``None``. """
+ result = self.test_instance.run()
+ self.assertIs(result, None)
+
+ def test_calls_base_class_run(self, mock_func_build_run):
+ """ Should call base class's ‘run’ method. """
+ self.test_instance.run()
+ mock_func_build_run.assert_called_with()
+
+
# Copyright © 2008–2019 Ben Finney <[email protected]>
#
# This is free software: you may copy, modify, and/or distribute this work
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/python-daemon-2.2.3/version.py
new/python-daemon-2.2.4/version.py
--- old/python-daemon-2.2.3/version.py 2019-01-20 13:55:08.000000000 +0100
+++ new/python-daemon-2.2.4/version.py 2019-10-05 05:17:59.000000000 +0200
@@ -586,7 +586,7 @@
sub_commands = (
distutils.command.build.build.sub_commands + [
- ('write_version_info', has_changelog),
+ ('egg_info', None),
])
@@ -597,13 +597,6 @@
('write_version_info', has_changelog),
] + setuptools.command.egg_info.egg_info.sub_commands)
- def run(self):
- """ Execute this command. """
- super(EggInfoCommand, self).run()
-
- for command_name in self.get_sub_commands():
- self.run_command(command_name)
-
version_info_filename = "version_info.json"