diff --git a/doc/source/conf.py b/doc/source/conf.py index 58927011..6292467d 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -64,13 +64,10 @@ pygments_style = 'sphinx' # Sphinx are currently 'default' and 'sphinxdoc'. # html_theme_path = ["."] html_theme = 'openstackdocs' -html_static_path = ['_static'] # Output file base name for HTML help builder. htmlhelp_basename = '%sdoc' % project -html_last_updated_fmt = '%Y-%m-%d %H:%M' - # Grouping the document tree into LaTeX files. List of tuples # (source start file, target name, title, author, documentclass # [howto/manual]). diff --git a/lower-constraints.txt b/lower-constraints.txt index 2e5f0e96..2249d872 100644 --- a/lower-constraints.txt +++ b/lower-constraints.txt @@ -26,7 +26,7 @@ mox3==0.20.0 msgpack-python==0.4.0 netaddr==0.7.18 netifaces==0.10.4 -openstackdocstheme==1.18.1 +openstackdocstheme==1.31.2 os-client-config==1.28.0 oslo.concurrency==3.26.0 oslo.config==5.2.0 diff --git a/os_win/tests/unit/utils/test_pathutils.py b/os_win/tests/unit/utils/test_pathutils.py index 64393429..8f052b40 100644 --- a/os_win/tests/unit/utils/test_pathutils.py +++ b/os_win/tests/unit/utils/test_pathutils.py @@ -155,8 +155,7 @@ class PathUtilsTestCase(test_base.OsWinBaseTestCase): @mock.patch('os.path.isdir') @mock.patch('os.path.islink') def _test_check_symlink(self, mock_is_symlink, mock_is_dir, - is_symlink=True, python_version=(2, 7), - is_dir=True): + is_symlink=True, is_dir=True): fake_path = r'c:\\fake_path' if is_symlink: f_attr = 0x400 @@ -167,17 +166,8 @@ class PathUtilsTestCase(test_base.OsWinBaseTestCase): mock_is_symlink.return_value = is_symlink self._mock_run.return_value = f_attr - with mock.patch('sys.version_info', python_version): - ret_value = self._pathutils.is_symlink(fake_path) - - if python_version >= (3, 2): - mock_is_symlink.assert_called_once_with(fake_path) - else: - self._mock_run.assert_called_once_with( - pathutils.kernel32.GetFileAttributesW, - fake_path, - error_ret_vals=[w_const.INVALID_FILE_ATTRIBUTES], - kernel32_lib_func=True) + ret_value = self._pathutils.is_symlink(fake_path) + mock_is_symlink.assert_called_once_with(fake_path) self.assertEqual(is_symlink, ret_value) @@ -187,9 +177,6 @@ class PathUtilsTestCase(test_base.OsWinBaseTestCase): def test_is_not_symlink(self): self._test_check_symlink(is_symlink=False) - def test_is_symlink_python_gt_3_2(self): - self._test_check_symlink(python_version=(3, 3)) - def test_create_sym_link(self): tg_is_dir = False self._pathutils.create_sym_link(mock.sentinel.path, diff --git a/os_win/utils/io/ioutils.py b/os_win/utils/io/ioutils.py index 2b7db971..39b33cd8 100644 --- a/os_win/utils/io/ioutils.py +++ b/os_win/utils/io/ioutils.py @@ -15,7 +15,6 @@ import ctypes import struct -import sys from eventlet import patcher from oslo_log import log as logging @@ -34,11 +33,7 @@ kernel32 = w_lib.get_shared_lib_handle(w_lib.KERNEL32) LOG = logging.getLogger(__name__) -# Avoid using six.moves.queue as we need a non monkey patched class -if sys.version_info > (3, 0): - Queue = patcher.original('queue') -else: - Queue = patcher.original('Queue') +Queue = patcher.original('queue') WAIT_PIPE_DEFAULT_TIMEOUT = 5 # seconds WAIT_IO_COMPLETION_TIMEOUT = 2 * units.k diff --git a/os_win/utils/pathutils.py b/os_win/utils/pathutils.py index 0b62a829..a6f916bb 100644 --- a/os_win/utils/pathutils.py +++ b/os_win/utils/pathutils.py @@ -17,7 +17,6 @@ import contextlib import ctypes import os import shutil -import sys import tempfile from oslo_log import log as logging @@ -153,17 +152,7 @@ class PathUtils(object): self.rmtree(path) def is_symlink(self, path): - if sys.version_info >= (3, 2): - return os.path.islink(path) - - file_attr = self._win32_utils.run_and_check_output( - kernel32.GetFileAttributesW, - path, - error_ret_vals=[w_const.INVALID_FILE_ATTRIBUTES], - kernel32_lib_func=True) - - return bool(os.path.isdir(path) and ( - file_attr & w_const.FILE_ATTRIBUTE_REPARSE_POINT)) + return os.path.islink(path) def create_sym_link(self, link, target, target_is_dir=True): """If target_is_dir is True, a junction will be created. diff --git a/setup.cfg b/setup.cfg index 31f504ea..41d26434 100644 --- a/setup.cfg +++ b/setup.cfg @@ -6,6 +6,7 @@ description-file = author = OpenStack author-email = openstack-discuss@lists.openstack.org home-page = http://www.cloudbase.it/ +python-requires = >=3.6 classifier = Environment :: OpenStack Intended Audience :: Information Technology @@ -13,6 +14,8 @@ classifier = License :: OSI Approved :: Apache Software License Operating System :: Microsoft :: Windows Programming Language :: Python + Programming Language :: Python :: Implementation :: CPython + Programming Language :: Python :: 3 :: Only Programming Language :: Python :: 3 Programming Language :: Python :: 3.6 Programming Language :: Python :: 3.7 @@ -25,14 +28,6 @@ packages = oslo.config.opts = os_win = os_win.conf:list_opts -[build_sphinx] -source-dir = doc/source -build-dir = doc/build -all_files = 1 - -[upload_sphinx] -upload-dir = doc/build/html - [compile_catalog] directory = os_win/locale domain = os-win diff --git a/setup.py b/setup.py index 566d8443..cd35c3c3 100644 --- a/setup.py +++ b/setup.py @@ -13,17 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -# THIS FILE IS MANAGED BY THE GLOBAL REQUIREMENTS REPO - DO NOT EDIT import setuptools -# In python < 2.7.4, a lazy loading of package `pbr` will break -# setuptools if some other modules registered functions in `atexit`. -# solution from: http://bugs.python.org/issue15881#msg170215 -try: - import multiprocessing # noqa -except ImportError: - pass - setuptools.setup( setup_requires=['pbr>=2.0.0'], pbr=True) diff --git a/test-requirements.txt b/test-requirements.txt index 691a1b34..ece7c098 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -13,6 +13,6 @@ oslotest>=3.2.0 # Apache-2.0 stestr>=2.0.0 # Apache-2.0 testscenarios>=0.4 # Apache-2.0/BSD testtools>=2.2.0 # MIT -openstackdocstheme>=1.18.1 # Apache-2.0 +openstackdocstheme>=1.31.2 # Apache-2.0 # releasenotes reno>=2.5.0 # Apache-2.0 diff --git a/tox.ini b/tox.ini index 6302ec89..06728ae3 100644 --- a/tox.ini +++ b/tox.ini @@ -4,8 +4,8 @@ envlist = py37,pep8 skipsdist = True [testenv] +basepython = python3 usedevelop = True -install_command = pip install {opts} {packages} deps = -c{env:UPPER_CONSTRAINTS_FILE:https://opendev.org/openstack/requirements/raw/branch/master/upper-constraints.txt} -r{toxinidir}/test-requirements.txt @@ -13,27 +13,21 @@ deps = commands = stestr run --slowest {posargs} [testenv:pep8] -basepython = python3 commands = flake8 [testenv:venv] -basepython = python3 commands = {posargs} [testenv:cover] -basepython = python3 commands = python setup.py test --coverage --testr-args='{posargs}' [testenv:docs] -basepython = python3 -commands = python setup.py build_sphinx +commands = sphinx-build -W -b html doc/source doc/build/html [testenv:releasenotes] -basepython = python3 commands = sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html [testenv:debug] -basepython = python3 commands = oslo_debug_helper -t os_win/tests/unit {posargs} [flake8]