Hello community, here is the log from the commit of package python-portend for openSUSE:Factory checked in at 2019-03-08 11:00:41 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-portend (Old) and /work/SRC/openSUSE:Factory/.python-portend.new.28833 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-portend" Fri Mar 8 11:00:41 2019 rev:2 rq:681737 version:2.3 Changes: -------- --- /work/SRC/openSUSE:Factory/python-portend/python-portend.changes 2017-04-28 10:45:58.105155453 +0200 +++ /work/SRC/openSUSE:Factory/.python-portend.new.28833/python-portend.changes 2019-03-08 11:00:44.004547198 +0100 @@ -1,0 +2,9 @@ +Tue Mar 5 12:56:25 UTC 2019 - Tomáš Chvátal <tchva...@suse.com> + +- Update to 2.3: + * Fix README rendering. + * Merge with skeleton, including embedded license file. + * #1: Removed portend._getaddrinfo and its usage in Checker.assert_free. + * #5: Restored use of portend.client_host during assert_free check on Windows, fixing check when the bind address is *ADDR_ANY. + +------------------------------------------------------------------- Old: ---- portend-1.8.tar.gz New: ---- portend-2.3.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-portend.spec ++++++ --- /var/tmp/diff_new_pack.eYz25z/_old 2019-03-08 11:00:45.496546960 +0100 +++ /var/tmp/diff_new_pack.eYz25z/_new 2019-03-08 11:00:45.528546955 +0100 @@ -1,7 +1,7 @@ # # spec file for package python-portend # -# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2019 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 @@ -12,27 +12,27 @@ # license that conforms to the Open Source Definition (Version 1.9) # published by the Open Source Initiative. -# Please submit bugfixes or comments via http://bugs.opensuse.org/ +# Please submit bugfixes or comments via https://bugs.opensuse.org/ +# %{?!python_module:%define python_module() python-%{**} python3-%{**}} Name: python-portend -Version: 1.8 +Version: 2.3 Release: 0 -License: MIT Summary: TCP port monitoring utilities -Url: https://github.com/jaraco/portend +License: MIT Group: Development/Languages/Python +URL: https://github.com/jaraco/portend Source: https://files.pythonhosted.org/packages/source/p/portend/portend-%{version}.tar.gz -BuildRequires: python-rpm-macros -BuildRequires: %{python_module setuptools} -BuildRequires: %{python_module setuptools_scm} BuildRequires: %{python_module pytest} +BuildRequires: %{python_module setuptools_scm} +BuildRequires: %{python_module setuptools} BuildRequires: %{python_module tempora} +BuildRequires: fdupes +BuildRequires: python-rpm-macros Requires: python-tempora -BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildArch: noarch - %python_subpackages %description @@ -47,18 +47,22 @@ %prep %setup -q -n portend-%{version} +# do not require cov/xdist/etc +sed -i -e '/addopts/d' pytest.ini %build %python_build %install %python_install +%python_expand %fdupes %{buildroot}%{$python_sitelib} %check %python_exec -m pytest test_portend.py %files %{python_files} -%defattr(-,root,root,-) +%license LICENSE +%doc CHANGES.rst README.rst %{python_sitelib}/* %changelog ++++++ portend-1.8.tar.gz -> portend-2.3.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/portend-1.8/.flake8 new/portend-2.3/.flake8 --- old/portend-1.8/.flake8 1970-01-01 01:00:00.000000000 +0100 +++ new/portend-2.3/.flake8 2018-06-09 22:02:47.000000000 +0200 @@ -0,0 +1,6 @@ +[flake8] +ignore = + # Allow tabs for indentation + W191 + # W503 violates spec https://github.com/PyCQA/pycodestyle/issues/513 + W503 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/portend-1.8/.readthedocs.yml new/portend-2.3/.readthedocs.yml --- old/portend-1.8/.readthedocs.yml 1970-01-01 01:00:00.000000000 +0100 +++ new/portend-2.3/.readthedocs.yml 2018-06-09 22:02:47.000000000 +0200 @@ -0,0 +1,5 @@ +python: + version: 3 + extra_requirements: + - docs + pip_install: true diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/portend-1.8/.travis.yml new/portend-2.3/.travis.yml --- old/portend-1.8/.travis.yml 2017-01-23 15:32:22.000000000 +0100 +++ new/portend-2.3/.travis.yml 2018-06-09 22:02:47.000000000 +0200 @@ -1,25 +1,39 @@ +dist: trusty sudo: false language: python + python: -- 2.6 - 2.7 -- 3.6 +- &latest_py3 3.6 + +jobs: + fast_finish: true + include: + - stage: deploy + if: tag IS present + python: *latest_py3 + install: skip + script: skip + deploy: + provider: pypi + on: + tags: true + all_branches: true + user: jaraco + password: + secure: vdFaBpjDV3pL+wS+uBguSyrWzIMYI238bovE6TFeEbCeXkAFpoS+Po+HKw76dpcVN4eTRwOqYuw9kZ+4spnl1RmgeTEsT8VwJQQTkpRmQ6KzikTMXya2KI3wFuKpB1x7ZFVaLasxtZ4+MULwgH5tE31YDulLWKPIJ6mn5sYcL0d3BbbKS7QPalF3KhJatWHEXjpj7j0XzW9wkjmeY1cmaVj+YQxNk5wMJQtFnrzS6Q0VI3ju+2RSRQUjXvnTPkK9bR0HUAJQOG9BWfNjcSGkPLvSp5BqAUiER8WYP7EAxjy51GHJZnXl95LGd1i9rJX3S3fN/e7QrYcGsmXA/jNK9qJ3C+QBhF70DqgZn2m9t8bmTWIQexV2DLNTZydU6VfrLvXUUiudXmQV6wk5/yhiR9jAKY2cJAsbTZ8wtsjAqQybEJBDZGyMRiUhTpUXBxYI9v5kpdvPVNe/gmGRCjwMmzwvwdcVBGSkVqfWoijvIRiE5+5fqEn2WnfLc8r4aFIvf0kusS1ZgSy9tt9UKQIPPNt9s12BfKx/vobDrEbFLZvDR6Cxyucq4znR12LWijosZINWVwSOpTXfgGJpFbDHwWzI8Z7/xfeSYoWjg8XJl2yeiXG+jCKKvYjpOU3e2Pw5d+MvhIyJJnRFBb7+kDyZktGqECVsIUfWrrlkFXuVfAQ= + distributions: dists + skip_cleanup: true + skip_upload_docs: true + +cache: pip + install: -- pip install tox "setuptools>=28.2" -script: -- tox -branches: - except: - - skeleton -deploy: - provider: pypi - server: https://upload.pypi.org/legacy/ - on: - tags: true - all_branches: true - python: 3.6 - user: jaraco - distributions: dists - skip_upload_docs: true - password: - secure: vdFaBpjDV3pL+wS+uBguSyrWzIMYI238bovE6TFeEbCeXkAFpoS+Po+HKw76dpcVN4eTRwOqYuw9kZ+4spnl1RmgeTEsT8VwJQQTkpRmQ6KzikTMXya2KI3wFuKpB1x7ZFVaLasxtZ4+MULwgH5tE31YDulLWKPIJ6mn5sYcL0d3BbbKS7QPalF3KhJatWHEXjpj7j0XzW9wkjmeY1cmaVj+YQxNk5wMJQtFnrzS6Q0VI3ju+2RSRQUjXvnTPkK9bR0HUAJQOG9BWfNjcSGkPLvSp5BqAUiER8WYP7EAxjy51GHJZnXl95LGd1i9rJX3S3fN/e7QrYcGsmXA/jNK9qJ3C+QBhF70DqgZn2m9t8bmTWIQexV2DLNTZydU6VfrLvXUUiudXmQV6wk5/yhiR9jAKY2cJAsbTZ8wtsjAqQybEJBDZGyMRiUhTpUXBxYI9v5kpdvPVNe/gmGRCjwMmzwvwdcVBGSkVqfWoijvIRiE5+5fqEn2WnfLc8r4aFIvf0kusS1ZgSy9tt9UKQIPPNt9s12BfKx/vobDrEbFLZvDR6Cxyucq4znR12LWijosZINWVwSOpTXfgGJpFbDHwWzI8Z7/xfeSYoWjg8XJl2yeiXG+jCKKvYjpOU3e2Pw5d+MvhIyJJnRFBb7+kDyZktGqECVsIUfWrrlkFXuVfAQ= +- pip install tox tox-venv + +before_script: + # Disable IPv6. Ref travis-ci/travis-ci#8361 + - if [ "${TRAVIS_OS_NAME}" == "linux" ]; then + sudo sh -c 'echo 0 > /proc/sys/net/ipv6/conf/all/disable_ipv6'; + fi +script: tox diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/portend-1.8/CHANGES.rst new/portend-2.3/CHANGES.rst --- old/portend-1.8/CHANGES.rst 2017-01-23 15:32:22.000000000 +0100 +++ new/portend-2.3/CHANGES.rst 2018-06-09 22:02:47.000000000 +0200 @@ -1,3 +1,36 @@ +2.3 +=== + +Package refresh. + +2.2 +=== + +Merge with skeleton, including embedded license file. + +2.1.2 +===== + +Fix README rendering. + +2.1.1 +===== + +#5: Restored use of ``portend.client_host`` during + ``assert_free`` check on Windows, fixing check + when the bind address is *ADDR_ANY. + +2.1 +=== + +Use tempora.timing.Timer from tempora 1.8, replacing +boilerplate code in occupied and free functions. + +#1: Removed ``portend._getaddrinfo`` and its usage in + ``Checker.assert_free``. + +Dropped support for Python 2.6. + 1.8 === diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/portend-1.8/LICENSE new/portend-2.3/LICENSE --- old/portend-1.8/LICENSE 1970-01-01 01:00:00.000000000 +0100 +++ new/portend-2.3/LICENSE 2018-06-09 22:02:47.000000000 +0200 @@ -0,0 +1,7 @@ +Copyright Jason R. Coombs + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/portend-1.8/PKG-INFO new/portend-2.3/PKG-INFO --- old/portend-1.8/PKG-INFO 2017-01-23 15:32:47.000000000 +0100 +++ new/portend-2.3/PKG-INFO 2018-06-09 22:03:11.000000000 +0200 @@ -1,6 +1,6 @@ -Metadata-Version: 1.1 +Metadata-Version: 2.1 Name: portend -Version: 1.8 +Version: 2.3 Summary: TCP port monitoring utilities Home-page: https://github.com/jaraco/portend Author: Jason R. Coombs @@ -11,10 +11,14 @@ .. image:: https://img.shields.io/pypi/pyversions/portend.svg - .. image:: https://img.shields.io/pypi/dm/portend.svg - .. image:: https://img.shields.io/travis/jaraco/portend/master.svg - :target: http://travis-ci.org/jaraco/portend + :target: https://travis-ci.org/jaraco/portend + + .. image:: https://img.shields.io/appveyor/ci/jaraco/portend/master.svg + :target: https://ci.appveyor.com/project/jaraco/portend/branch/master + + .. image:: https://readthedocs.org/projects/portend/badge/?version=latest + :target: https://portend.readthedocs.io/en/latest/?badge=latest por·tend pôrˈtend/ @@ -22,13 +26,6 @@ be a sign or warning that (something, especially something momentous or calamitous) is likely to happen. - License - ======= - - License is indicated in the project metadata (typically one or more - of the Trove classifiers). For more details, see `this explanation - <https://github.com/jaraco/skeleton/issues/1>`_. - Usage ===== @@ -60,19 +57,21 @@ print(port, "is available for binding") Portend additionally exposes the lower-level port checking functionality - in the :class:`Checker` class, which currently exposes only one public + in the ``Checker`` class, which currently exposes only one public method, ``assert_free``. portend.Checker().assert_free('localhost', 31923) If assert_free is passed a host/port combination that is occupied by a bound listener (i.e. a TCP connection is established to that host/port), - assert_free will raise a :class:`PortNotFree` exception. + assert_free will raise a ``PortNotFree`` exception. Platform: UNKNOWN Classifier: Development Status :: 5 - Production/Stable Classifier: Intended Audience :: Developers Classifier: License :: OSI Approved :: MIT License -Classifier: Programming Language :: Python :: 2.6 Classifier: Programming Language :: Python :: 2.7 Classifier: Programming Language :: Python :: 3 +Requires-Python: >=2.7 +Provides-Extra: docs +Provides-Extra: testing diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/portend-1.8/README.rst new/portend-2.3/README.rst --- old/portend-1.8/README.rst 2017-01-23 15:32:22.000000000 +0100 +++ new/portend-2.3/README.rst 2018-06-09 22:02:47.000000000 +0200 @@ -3,10 +3,14 @@ .. image:: https://img.shields.io/pypi/pyversions/portend.svg -.. image:: https://img.shields.io/pypi/dm/portend.svg - .. image:: https://img.shields.io/travis/jaraco/portend/master.svg - :target: http://travis-ci.org/jaraco/portend + :target: https://travis-ci.org/jaraco/portend + +.. image:: https://img.shields.io/appveyor/ci/jaraco/portend/master.svg + :target: https://ci.appveyor.com/project/jaraco/portend/branch/master + +.. image:: https://readthedocs.org/projects/portend/badge/?version=latest + :target: https://portend.readthedocs.io/en/latest/?badge=latest por·tend pôrˈtend/ @@ -14,13 +18,6 @@ be a sign or warning that (something, especially something momentous or calamitous) is likely to happen. -License -======= - -License is indicated in the project metadata (typically one or more -of the Trove classifiers). For more details, see `this explanation -<https://github.com/jaraco/skeleton/issues/1>`_. - Usage ===== @@ -52,11 +49,11 @@ print(port, "is available for binding") Portend additionally exposes the lower-level port checking functionality -in the :class:`Checker` class, which currently exposes only one public +in the ``Checker`` class, which currently exposes only one public method, ``assert_free``. portend.Checker().assert_free('localhost', 31923) If assert_free is passed a host/port combination that is occupied by a bound listener (i.e. a TCP connection is established to that host/port), -assert_free will raise a :class:`PortNotFree` exception. +assert_free will raise a ``PortNotFree`` exception. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/portend-1.8/appveyor.yml new/portend-2.3/appveyor.yml --- old/portend-1.8/appveyor.yml 1970-01-01 01:00:00.000000000 +0100 +++ new/portend-2.3/appveyor.yml 2018-06-09 22:02:47.000000000 +0200 @@ -0,0 +1,24 @@ +environment: + + APPVEYOR: true + + matrix: + - PYTHON: "C:\\Python36-x64" + - PYTHON: "C:\\Python27-x64" + +install: + # symlink python from a directory with a space + - "mklink /d \"C:\\Program Files\\Python\" %PYTHON%" + - "SET PYTHON=\"C:\\Program Files\\Python\"" + - "SET PATH=%PYTHON%;%PYTHON%\\Scripts;%PATH%" + +build: off + +cache: + - '%LOCALAPPDATA%\pip\Cache' + +test_script: + - "python -m pip install tox tox-venv" + - "tox" + +version: '{build}' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/portend-1.8/docs/conf.py new/portend-2.3/docs/conf.py --- old/portend-1.8/docs/conf.py 2017-01-23 15:32:22.000000000 +0100 +++ new/portend-2.3/docs/conf.py 2018-06-09 22:02:47.000000000 +0200 @@ -1,46 +1,31 @@ #!/usr/bin/env python3 # -*- coding: utf-8 -*- -import os -import sys -import subprocess - extensions = [ - 'sphinx.ext.autodoc', - 'rst.linker', + 'sphinx.ext.autodoc', + 'jaraco.packaging.sphinx', + 'rst.linker', ] -# General information about the project. - -root = os.path.join(os.path.dirname(__file__), '..') -setup_script = os.path.join(root, 'setup.py') -fields = ['--name', '--version', '--url', '--author'] -dist_info_cmd = [sys.executable, setup_script] + fields -output_bytes = subprocess.check_output(dist_info_cmd, cwd=root) -project, version, url, author = output_bytes.decode('utf-8').strip().split('\n') - -copyright = '2014-2017 ' + author - -# The full version, including alpha/beta/rc tags. -release = version - master_doc = 'index' link_files = { '../CHANGES.rst': dict( using=dict( GH='https://github.com', - project=project, - url=url, ), replace=[ dict( - pattern=r"(Issue )?#(?P<issue>\d+)", - url='{url}/issues/{issue}', + pattern=r'(Issue )?#(?P<issue>\d+)', + url='{package_url}/issues/{issue}', + ), + dict( + pattern=r'^(?m)((?P<scm_version>v?\d+(\.\d+){1,2}))\n[-=]+\n', + with_scm='{text}\n{rev[timestamp]:%d %b %Y}\n', ), dict( - pattern=r"^(?m)((?P<scm_version>v?\d+(\.\d+){1,2}))\n[-=]+\n", - with_scm="{text}\n{rev[timestamp]:%d %b %Y}\n", + pattern=r'PEP[- ](?P<pep_number>\d+)', + url='https://www.python.org/dev/peps/pep-{pep_number:0>4}/', ), ], ), diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/portend-1.8/docs/requirements.txt new/portend-2.3/docs/requirements.txt --- old/portend-1.8/docs/requirements.txt 2017-01-23 15:32:22.000000000 +0100 +++ new/portend-2.3/docs/requirements.txt 1970-01-01 01:00:00.000000000 +0100 @@ -1 +0,0 @@ -rst.linker diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/portend-1.8/portend.egg-info/PKG-INFO new/portend-2.3/portend.egg-info/PKG-INFO --- old/portend-1.8/portend.egg-info/PKG-INFO 2017-01-23 15:32:47.000000000 +0100 +++ new/portend-2.3/portend.egg-info/PKG-INFO 2018-06-09 22:03:11.000000000 +0200 @@ -1,6 +1,6 @@ -Metadata-Version: 1.1 +Metadata-Version: 2.1 Name: portend -Version: 1.8 +Version: 2.3 Summary: TCP port monitoring utilities Home-page: https://github.com/jaraco/portend Author: Jason R. Coombs @@ -11,10 +11,14 @@ .. image:: https://img.shields.io/pypi/pyversions/portend.svg - .. image:: https://img.shields.io/pypi/dm/portend.svg - .. image:: https://img.shields.io/travis/jaraco/portend/master.svg - :target: http://travis-ci.org/jaraco/portend + :target: https://travis-ci.org/jaraco/portend + + .. image:: https://img.shields.io/appveyor/ci/jaraco/portend/master.svg + :target: https://ci.appveyor.com/project/jaraco/portend/branch/master + + .. image:: https://readthedocs.org/projects/portend/badge/?version=latest + :target: https://portend.readthedocs.io/en/latest/?badge=latest por·tend pôrˈtend/ @@ -22,13 +26,6 @@ be a sign or warning that (something, especially something momentous or calamitous) is likely to happen. - License - ======= - - License is indicated in the project metadata (typically one or more - of the Trove classifiers). For more details, see `this explanation - <https://github.com/jaraco/skeleton/issues/1>`_. - Usage ===== @@ -60,19 +57,21 @@ print(port, "is available for binding") Portend additionally exposes the lower-level port checking functionality - in the :class:`Checker` class, which currently exposes only one public + in the ``Checker`` class, which currently exposes only one public method, ``assert_free``. portend.Checker().assert_free('localhost', 31923) If assert_free is passed a host/port combination that is occupied by a bound listener (i.e. a TCP connection is established to that host/port), - assert_free will raise a :class:`PortNotFree` exception. + assert_free will raise a ``PortNotFree`` exception. Platform: UNKNOWN Classifier: Development Status :: 5 - Production/Stable Classifier: Intended Audience :: Developers Classifier: License :: OSI Approved :: MIT License -Classifier: Programming Language :: Python :: 2.6 Classifier: Programming Language :: Python :: 2.7 Classifier: Programming Language :: Python :: 3 +Requires-Python: >=2.7 +Provides-Extra: docs +Provides-Extra: testing diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/portend-1.8/portend.egg-info/SOURCES.txt new/portend-2.3/portend.egg-info/SOURCES.txt --- old/portend-1.8/portend.egg-info/SOURCES.txt 2017-01-23 15:32:47.000000000 +0100 +++ new/portend-2.3/portend.egg-info/SOURCES.txt 2018-06-09 22:03:11.000000000 +0200 @@ -1,7 +1,12 @@ +.flake8 +.readthedocs.yml .travis.yml CHANGES.rst +LICENSE README.rst +appveyor.yml portend.py +pyproject.toml pytest.ini setup.cfg setup.py @@ -10,11 +15,9 @@ docs/conf.py docs/history.rst docs/index.rst -docs/requirements.txt portend.egg-info/PKG-INFO portend.egg-info/SOURCES.txt portend.egg-info/dependency_links.txt portend.egg-info/namespace_packages.txt portend.egg-info/requires.txt -portend.egg-info/top_level.txt -tests/requirements.txt \ No newline at end of file +portend.egg-info/top_level.txt \ No newline at end of file diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/portend-1.8/portend.egg-info/requires.txt new/portend-2.3/portend.egg-info/requires.txt --- old/portend-1.8/portend.egg-info/requires.txt 2017-01-23 15:32:47.000000000 +0100 +++ new/portend-2.3/portend.egg-info/requires.txt 2018-06-09 22:03:11.000000000 +0200 @@ -1,4 +1,12 @@ -tempora +tempora>=1.8 -[:python_version == "2.6"] -argparse +[docs] +sphinx +jaraco.packaging>=3.2 +rst.linker>=1.9 + +[testing] +pytest>=3.5 +pytest-sugar>=0.9.1 +collective.checkdocs +pytest-flake8 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/portend-1.8/portend.py new/portend-2.3/portend.py --- old/portend-1.8/portend.py 2017-01-23 15:32:22.000000000 +0100 +++ new/portend-2.3/portend.py 2018-06-09 22:02:47.000000000 +0200 @@ -8,14 +8,12 @@ import time import socket -import datetime import argparse import sys import itertools import contextlib import collections -import textwrap -import warnings +import platform from tempora import timing @@ -33,30 +31,6 @@ return server_host -def _getaddrinfo(host, port, *args, **kwargs): - """ - Provide a fallback when getaddrinfo fails. - """ - try: - return socket.getaddrinfo(host, port, *args, **kwargs) - except socket.gaierror: - msg = textwrap.dedent(""" - This functionality is being considered for removal. If you - encounter this message, please describe your use-case - at https://github.com/jaraco/portend/issues/1. - """).lstrip() - warnings.warn(msg) - host = client_host(host) - if ':' in host: - family = socket.AF_INET6 - addr = host, port, 0, 0 - else: - family = socket.AF_INET - addr = host, port - item = family, socket.SOCK_STREAM, 0, "", addr - return [item] - - class Checker(object): def __init__(self, timeout=1.0): self.timeout = timeout @@ -77,10 +51,19 @@ >>> addr = '::1', free_port, 0, 0 >>> Checker().assert_free(addr) + + Host might refer to a server bind address like '::', which + should use localhost to perform the check. + + >>> Checker().assert_free('::', free_port) """ if port is None and isinstance(host, collections.Sequence): host, port = host[:2] - info = _getaddrinfo(host, port, socket.AF_UNSPEC, socket.SOCK_STREAM) + if platform.system() == 'Windows': + host = client_host(host) + info = socket.getaddrinfo( + host, port, socket.AF_UNSPEC, socket.SOCK_STREAM, + ) list(itertools.starmap(self._connect, info)) def _connect(self, af, socktype, proto, canonname, sa): @@ -122,16 +105,9 @@ if not host: raise ValueError("Host values of '' or None are not allowed.") - if isinstance(timeout, datetime.timedelta): - timeout = timeout.total_seconds() - - if timeout is None: - # treat None as infinite timeout - timeout = float('Inf') - - watch = timing.Stopwatch() + timer = timing.Timer(timeout) - while total_seconds(watch.split()) < timeout: + while not timer.expired(): try: # Expect a free port, so use a small timeout Checker(timeout=0.1).assert_free(host, port) @@ -141,6 +117,8 @@ time.sleep(0.1) raise Timeout("Port {port} not free on {host}.".format(**locals())) + + wait_for_free_port = free @@ -153,24 +131,17 @@ Timeout may be specified in seconds or as a timedelta. If timeout is None or ∞, the routine will run indefinitely. - >>> occupied('localhost', find_available_local_port(), .1) # doctest: +IGNORE_EXCEPTION_DETAIL + >>> occupied('localhost', find_available_local_port(), .1) Traceback (most recent call last): - ... + ... Timeout: Port ... not bound on localhost. """ if not host: raise ValueError("Host values of '' or None are not allowed.") - if isinstance(timeout, datetime.timedelta): - timeout = timeout.total_seconds() + timer = timing.Timer(timeout) - if timeout is None: - # treat None as infinite timeout - timeout = float('Inf') - - watch = timing.Stopwatch() - - while total_seconds(watch.split()) < timeout: + while not timer.expired(): try: Checker(timeout=.5).assert_free(host, port) # Politely wait @@ -180,6 +151,8 @@ return raise Timeout("Port {port} not bound on {host}.".format(**locals())) + + wait_for_occupied_port = occupied @@ -227,7 +200,9 @@ def _main(): parser = argparse.ArgumentParser() - global_lookup = lambda key: globals()[key] + + def global_lookup(key): + return globals()[key] parser.add_argument('target', metavar='host:port', type=HostPort) parser.add_argument('func', metavar='state', type=global_lookup) parser.add_argument('-t', '--timeout', default=None, type=float) @@ -239,18 +214,5 @@ raise SystemExit(1) -# from jaraco.compat -def total_seconds(td): - """ - Python 2.7 adds a total_seconds method to timedelta objects. - See http://docs.python.org/library/datetime.html#datetime.timedelta.total_seconds - """ - try: - result = td.total_seconds() - except AttributeError: - result = (td.microseconds + (td.seconds + td.days * 24 * 3600) * 10**6) / 10**6 - return result - - if __name__ == '__main__': _main() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/portend-1.8/pyproject.toml new/portend-2.3/pyproject.toml --- old/portend-1.8/pyproject.toml 1970-01-01 01:00:00.000000000 +0100 +++ new/portend-2.3/pyproject.toml 2018-06-09 22:02:47.000000000 +0200 @@ -0,0 +1,2 @@ +[build-system] +requires = ["setuptools", "wheel", "setuptools_scm>=1.15"] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/portend-1.8/pytest.ini new/portend-2.3/pytest.ini --- old/portend-1.8/pytest.ini 2017-01-23 15:32:22.000000000 +0100 +++ new/portend-2.3/pytest.ini 2018-06-09 22:02:47.000000000 +0200 @@ -1,4 +1,4 @@ [pytest] -norecursedirs=dist build .tox docs -addopts=--doctest-modules -doctest_optionflags=ALLOW_UNICODE ELLIPSIS +norecursedirs=dist build .tox .eggs +addopts=--doctest-modules --flake8 -v +doctest_optionflags=ALLOW_UNICODE ELLIPSIS IGNORE_EXCEPTION_DETAIL diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/portend-1.8/setup.cfg new/portend-2.3/setup.cfg --- old/portend-1.8/setup.cfg 2017-01-23 15:32:47.000000000 +0100 +++ new/portend-2.3/setup.cfg 2018-06-09 22:03:11.000000000 +0200 @@ -2,11 +2,13 @@ release = dists upload dists = clean --all sdist bdist_wheel -[wheel] +[bdist_wheel] universal = 1 +[metadata] +license_file = LICENSE + [egg_info] tag_build = tag_date = 0 -tag_svn_revision = 0 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/portend-1.8/setup.py new/portend-2.3/setup.py --- old/portend-1.8/setup.py 2017-01-23 15:32:22.000000000 +0100 +++ new/portend-2.3/setup.py 2018-06-09 22:02:47.000000000 +0200 @@ -11,6 +11,11 @@ name = 'portend' description = 'TCP port monitoring utilities' +nspkg_technique = 'native' +""" +Does this package use "native" namespace packages or +pkg_resources "managed" namespace packages? +""" params = dict( name=name, @@ -22,14 +27,32 @@ url="https://github.com/jaraco/" + name, packages=setuptools.find_packages(), include_package_data=True, + namespace_packages=( + name.split('.')[:-1] if nspkg_technique == 'managed' + else [] + ), + python_requires='>=2.7', py_modules=['portend'], - namespace_packages=name.split('.')[:-1], install_requires=[ - 'tempora', + 'tempora>=1.8', ], extras_require={ - ':python_version == "2.6"': [ - 'argparse', + 'testing': [ + # upstream + 'pytest>=3.5', + 'pytest-sugar>=0.9.1', + 'collective.checkdocs', + 'pytest-flake8', + + # local + ], + 'docs': [ + # upstream + 'sphinx', + 'jaraco.packaging>=3.2', + 'rst.linker>=1.9', + + # local ], }, setup_requires=[ @@ -39,7 +62,6 @@ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", - "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", ], diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/portend-1.8/test_portend.py new/portend-2.3/test_portend.py --- old/portend-1.8/test_portend.py 2017-01-23 15:32:22.000000000 +0100 +++ new/portend-2.3/test_portend.py 2018-06-09 22:02:47.000000000 +0200 @@ -23,6 +23,7 @@ af, = info[:1] return str(af) + def build_addr_infos(): params = list(socket_infos()) ids = list(map(id_for_info, params)) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/portend-1.8/tests/requirements.txt new/portend-2.3/tests/requirements.txt --- old/portend-1.8/tests/requirements.txt 2017-01-23 15:32:22.000000000 +0100 +++ new/portend-2.3/tests/requirements.txt 1970-01-01 01:00:00.000000000 +0100 @@ -1,2 +0,0 @@ -pytest >= 2.8 -pytest-warnings diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/portend-1.8/tox.ini new/portend-2.3/tox.ini --- old/portend-1.8/tox.ini 2017-01-23 15:32:22.000000000 +0100 +++ new/portend-2.3/tox.ini 2018-06-09 22:02:47.000000000 +0200 @@ -1,6 +1,22 @@ +[tox] +envlist = python +minversion = 2.4 + [testenv] deps = - -rtests/requirements.txt - -commands = py.test {posargs} + setuptools>=31.0.1 + # workaround for yaml/pyyaml#126 + # git+https://github.com/yaml/pyyaml@master#egg=pyyaml;python_version=="3.7" +commands = + py.test {posargs} + python setup.py checkdocs usedevelop = True +extras = testing + +[testenv:build-docs] +extras = + docs + testing +changedir = docs +commands = + python -m sphinx . {toxinidir}/build/html