Hello community,
here is the log from the commit of package python-certbot-nginx for
openSUSE:Factory checked in at 2019-03-19 10:00:55
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-certbot-nginx (Old)
and /work/SRC/openSUSE:Factory/.python-certbot-nginx.new.28833 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-certbot-nginx"
Tue Mar 19 10:00:55 2019 rev:5 rq:686084 version:0.32.0
Changes:
--------
---
/work/SRC/openSUSE:Factory/python-certbot-nginx/python-certbot-nginx.changes
2019-02-11 21:27:24.859014923 +0100
+++
/work/SRC/openSUSE:Factory/.python-certbot-nginx.new.28833/python-certbot-nginx.changes
2019-03-19 10:01:03.279912118 +0100
@@ -1,0 +2,6 @@
+Mon Mar 18 12:06:47 UTC 2019 - Marketa Calabkova <[email protected]>
+
+- update to version 0.32.0
+ * Tests execution now relies on pytest.
+
+-------------------------------------------------------------------
Old:
----
certbot-nginx-0.31.0.tar.gz
New:
----
certbot-nginx-0.32.0.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-certbot-nginx.spec ++++++
--- /var/tmp/diff_new_pack.cXMkws/_old 2019-03-19 10:01:03.791911584 +0100
+++ /var/tmp/diff_new_pack.cXMkws/_new 2019-03-19 10:01:03.823911551 +0100
@@ -18,7 +18,7 @@
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
Name: python-certbot-nginx
-Version: 0.31.0
+Version: 0.32.0
Release: 0
Summary: Nginx plugin for Certbot
License: Apache-2.0
@@ -27,6 +27,7 @@
Source:
https://files.pythonhosted.org/packages/source/c/certbot-nginx/certbot-nginx-%{version}.tar.gz
BuildRequires: %{python_module certbot >= 0.22.0}
BuildRequires: %{python_module mock}
+BuildRequires: %{python_module pytest}
BuildRequires: %{python_module setuptools}
BuildRequires: fdupes
BuildRequires: nginx
@@ -54,7 +55,7 @@
%python_expand %fdupes %{buildroot}%{$python_sitelib}
%check
-%python_exec setup.py test
+%pytest
%files %{python_files}
%doc README.rst
++++++ certbot-nginx-0.31.0.tar.gz -> certbot-nginx-0.32.0.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/certbot-nginx-0.31.0/PKG-INFO
new/certbot-nginx-0.32.0/PKG-INFO
--- old/certbot-nginx-0.31.0/PKG-INFO 2019-02-07 22:20:46.000000000 +0100
+++ new/certbot-nginx-0.32.0/PKG-INFO 2019-03-06 21:18:24.000000000 +0100
@@ -1,6 +1,6 @@
Metadata-Version: 2.1
Name: certbot-nginx
-Version: 0.31.0
+Version: 0.32.0
Summary: Nginx plugin for Certbot
Home-page: https://github.com/letsencrypt/letsencrypt
Author: Certbot Project
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/certbot-nginx-0.31.0/certbot_nginx/configurator.py
new/certbot-nginx-0.32.0/certbot_nginx/configurator.py
--- old/certbot-nginx-0.31.0/certbot_nginx/configurator.py 2019-02-07
22:20:29.000000000 +0100
+++ new/certbot-nginx-0.32.0/certbot_nginx/configurator.py 2019-03-06
21:18:08.000000000 +0100
@@ -13,6 +13,7 @@
from acme import challenges
from acme import crypto_util as acme_crypto_util
+from certbot import compat
from certbot import constants as core_constants
from certbot import crypto_util
from certbot import errors
@@ -164,9 +165,7 @@
util.lock_dir_until_exit(self.conf('server-root'))
except (OSError, errors.LockError):
logger.debug('Encountered error:', exc_info=True)
- raise errors.PluginError(
- 'Unable to lock %s', self.conf('server-root'))
-
+ raise errors.PluginError('Unable to lock
{0}'.format(self.conf('server-root')))
# Entry point in main.py for installing cert
def deploy_cert(self, domain, cert_path, key_path,
@@ -899,7 +898,7 @@
have permissions of root.
"""
- uid = os.geteuid()
+ uid = compat.os_geteuid()
util.make_or_verify_dir(
self.config.work_dir, core_constants.CONFIG_DIRS_MODE, uid)
util.make_or_verify_dir(
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/certbot-nginx-0.31.0/certbot_nginx/parser.py
new/certbot-nginx-0.32.0/certbot_nginx/parser.py
--- old/certbot-nginx-0.31.0/certbot_nginx/parser.py 2019-02-07
22:20:29.000000000 +0100
+++ new/certbot-nginx-0.32.0/certbot_nginx/parser.py 2019-03-06
21:18:08.000000000 +0100
@@ -81,9 +81,9 @@
"""
if not os.path.isabs(path):
- return os.path.join(self.root, path)
+ return os.path.normpath(os.path.join(self.root, path))
else:
- return path
+ return os.path.normpath(path)
def _build_addr_to_ssl(self):
"""Builds a map from address to whether it listens on ssl in any
server block
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/certbot-nginx-0.31.0/certbot_nginx/tests/configurator_test.py
new/certbot-nginx-0.32.0/certbot_nginx/tests/configurator_test.py
--- old/certbot-nginx-0.31.0/certbot_nginx/tests/configurator_test.py
2019-02-07 22:20:29.000000000 +0100
+++ new/certbot-nginx-0.32.0/certbot_nginx/tests/configurator_test.py
2019-03-06 21:18:08.000000000 +0100
@@ -1,7 +1,6 @@
# pylint: disable=too-many-public-methods
"""Test for certbot_nginx.configurator."""
import os
-import shutil
import unittest
import mock
@@ -33,12 +32,6 @@
self.config = util.get_nginx_configurator(
self.config_path, self.config_dir, self.work_dir, self.logs_dir)
- def tearDown(self):
- shutil.rmtree(self.temp_dir)
- shutil.rmtree(self.config_dir)
- shutil.rmtree(self.work_dir)
- shutil.rmtree(self.logs_dir)
-
@mock.patch("certbot_nginx.configurator.util.exe_exists")
def test_prepare_no_install(self, mock_exe_exists):
mock_exe_exists.return_value = False
@@ -69,8 +62,11 @@
def test_prepare_locked(self):
server_root = self.config.conf("server-root")
+
+ from certbot import util as certbot_util
+ certbot_util._LOCKS[server_root].release() # pylint:
disable=protected-access
+
self.config.config_test = mock.Mock()
- os.remove(os.path.join(server_root, ".certbot.lock"))
certbot_test_util.lock_and_call(self._test_prepare_locked, server_root)
@mock.patch("certbot_nginx.configurator.util.exe_exists")
@@ -88,11 +84,11 @@
def test_get_all_names(self, mock_gethostbyaddr):
mock_gethostbyaddr.return_value = ('155.225.50.69.nephoscale.net', [],
[])
names = self.config.get_all_names()
- self.assertEqual(names, set(
- ["155.225.50.69.nephoscale.net", "www.example.org",
"another.alias",
+ self.assertEqual(names, {
+ "155.225.50.69.nephoscale.net", "www.example.org", "another.alias",
"migration.com", "summer.com", "geese.com", "sslon.com",
"globalssl.com", "globalsslsetssl.com", "ipv6.com", "ipv6ssl.com",
- "headers.com"]))
+ "headers.com"})
def test_supported_enhancements(self):
self.assertEqual(['redirect', 'ensure-http-header', 'staple-ocsp'],
@@ -171,6 +167,7 @@
'abc.www.foo.com': "etc_nginx/foo.conf",
'www.bar.co.uk': "etc_nginx/nginx.conf",
'ipv6.com': "etc_nginx/sites-enabled/ipv6.com"}
+ conf_path = {key: os.path.normpath(value) for key, value in
conf_path.items()}
vhost = self.config.choose_vhosts(name)[0]
path = os.path.relpath(vhost.filep, self.temp_dir)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/certbot-nginx-0.31.0/certbot_nginx/tests/http_01_test.py
new/certbot-nginx-0.32.0/certbot_nginx/tests/http_01_test.py
--- old/certbot-nginx-0.31.0/certbot_nginx/tests/http_01_test.py
2019-02-07 22:20:29.000000000 +0100
+++ new/certbot-nginx-0.32.0/certbot_nginx/tests/http_01_test.py
2019-03-06 21:18:08.000000000 +0100
@@ -1,6 +1,5 @@
"""Tests for certbot_nginx.http_01"""
import unittest
-import shutil
import mock
import six
@@ -54,11 +53,6 @@
from certbot_nginx import http_01
self.http01 = http_01.NginxHttp01(config)
- def tearDown(self):
- shutil.rmtree(self.temp_dir)
- shutil.rmtree(self.config_dir)
- shutil.rmtree(self.work_dir)
-
def test_perform0(self):
responses = self.http01.perform()
self.assertEqual([], responses)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/certbot-nginx-0.31.0/certbot_nginx/tests/parser_test.py
new/certbot-nginx-0.32.0/certbot_nginx/tests/parser_test.py
--- old/certbot-nginx-0.31.0/certbot_nginx/tests/parser_test.py 2019-02-07
22:20:29.000000000 +0100
+++ new/certbot-nginx-0.32.0/certbot_nginx/tests/parser_test.py 2019-03-06
21:18:08.000000000 +0100
@@ -67,9 +67,15 @@
def test_abs_path(self):
nparser = parser.NginxParser(self.config_path)
- self.assertEqual('/etc/nginx/*', nparser.abs_path('/etc/nginx/*'))
- self.assertEqual(os.path.join(self.config_path, 'foo/bar/'),
- nparser.abs_path('foo/bar/'))
+ if os.name != 'nt':
+ self.assertEqual('/etc/nginx/*', nparser.abs_path('/etc/nginx/*'))
+ self.assertEqual(os.path.join(self.config_path, 'foo/bar'),
+ nparser.abs_path('foo/bar'))
+ else:
+ self.assertEqual('C:\\etc\\nginx\\*',
nparser.abs_path('C:\\etc\\nginx\\*'))
+ self.assertEqual(os.path.join(self.config_path, 'foo\\bar'),
+ nparser.abs_path('foo\\bar'))
+
def test_filedump(self):
nparser = parser.NginxParser(self.config_path)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/certbot-nginx-0.31.0/certbot_nginx/tests/tls_sni_01_test.py
new/certbot-nginx-0.32.0/certbot_nginx/tests/tls_sni_01_test.py
--- old/certbot-nginx-0.31.0/certbot_nginx/tests/tls_sni_01_test.py
2019-02-07 22:20:29.000000000 +0100
+++ new/certbot-nginx-0.32.0/certbot_nginx/tests/tls_sni_01_test.py
2019-03-06 21:18:08.000000000 +0100
@@ -1,6 +1,5 @@
"""Tests for certbot_nginx.tls_sni_01"""
import unittest
-import shutil
import mock
import six
@@ -55,11 +54,6 @@
from certbot_nginx import tls_sni_01
self.sni = tls_sni_01.NginxTlsSni01(config)
- def tearDown(self):
- shutil.rmtree(self.temp_dir)
- shutil.rmtree(self.config_dir)
- shutil.rmtree(self.work_dir)
-
@mock.patch("certbot_nginx.configurator"
".NginxConfigurator.choose_vhosts")
def test_perform(self, mock_choose):
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/certbot-nginx-0.31.0/certbot_nginx/tests/util.py
new/certbot-nginx-0.32.0/certbot_nginx/tests/util.py
--- old/certbot-nginx-0.31.0/certbot_nginx/tests/util.py 2019-02-07
22:20:29.000000000 +0100
+++ new/certbot-nginx-0.32.0/certbot_nginx/tests/util.py 2019-03-06
21:18:08.000000000 +0100
@@ -4,6 +4,8 @@
import pkg_resources
import tempfile
import unittest
+import shutil
+import warnings
import josepy as jose
import mock
@@ -33,6 +35,22 @@
self.rsa512jwk = jose.JWKRSA.load(test_util.load_vector(
"rsa512_key.pem"))
+ def tearDown(self):
+ # On Windows we have various files which are not correctly closed at
the time of tearDown.
+ # For know, we log them until a proper file close handling is written.
+ # Useful for development only, so no warning when we are on a CI
process.
+ def onerror_handler(_, path, excinfo):
+ """On error handler"""
+ if not os.environ.get('APPVEYOR'): # pragma: no cover
+ message = ('Following error occurred when deleting path {0}'
+ 'during tearDown process: {1}'.format(path,
str(excinfo)))
+ warnings.warn(message)
+
+ shutil.rmtree(self.temp_dir, onerror=onerror_handler)
+ shutil.rmtree(self.config_dir, onerror=onerror_handler)
+ shutil.rmtree(self.work_dir, onerror=onerror_handler)
+ shutil.rmtree(self.logs_dir, onerror=onerror_handler)
+
def get_data_filename(filename):
"""Gets the filename of a test data file."""
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/certbot-nginx-0.31.0/certbot_nginx.egg-info/PKG-INFO
new/certbot-nginx-0.32.0/certbot_nginx.egg-info/PKG-INFO
--- old/certbot-nginx-0.31.0/certbot_nginx.egg-info/PKG-INFO 2019-02-07
22:20:46.000000000 +0100
+++ new/certbot-nginx-0.32.0/certbot_nginx.egg-info/PKG-INFO 2019-03-06
21:18:24.000000000 +0100
@@ -1,6 +1,6 @@
Metadata-Version: 2.1
Name: certbot-nginx
-Version: 0.31.0
+Version: 0.32.0
Summary: Nginx plugin for Certbot
Home-page: https://github.com/letsencrypt/letsencrypt
Author: Certbot Project
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/certbot-nginx-0.31.0/setup.py
new/certbot-nginx-0.32.0/setup.py
--- old/certbot-nginx-0.31.0/setup.py 2019-02-07 22:20:31.000000000 +0100
+++ new/certbot-nginx-0.32.0/setup.py 2019-03-06 21:18:09.000000000 +0100
@@ -1,8 +1,10 @@
from setuptools import setup
from setuptools import find_packages
+from setuptools.command.test import test as TestCommand
+import sys
-version = '0.31.0'
+version = '0.32.0'
# Remember to update local-oldest-requirements.txt when changing the minimum
# acme/certbot version.
@@ -21,6 +23,22 @@
'sphinx_rtd_theme',
]
+
+class PyTest(TestCommand):
+ user_options = []
+
+ def initialize_options(self):
+ TestCommand.initialize_options(self)
+ self.pytest_args = ''
+
+ def run_tests(self):
+ import shlex
+ # import here, cause outside the eggs aren't loaded
+ import pytest
+ errno = pytest.main(shlex.split(self.pytest_args))
+ sys.exit(errno)
+
+
setup(
name='certbot-nginx',
version=version,
@@ -64,4 +82,6 @@
],
},
test_suite='certbot_nginx',
+ tests_require=["pytest"],
+ cmdclass={"test": PyTest},
)