diff --git a/blazar_dashboard/content/hosts/tests.py b/blazar_dashboard/content/hosts/tests.py index bb3fa42..d3bf305 100644 --- a/blazar_dashboard/content/hosts/tests.py +++ b/blazar_dashboard/content/hosts/tests.py @@ -10,8 +10,9 @@ # License for the specific language governing permissions and limitations # under the License. +from unittest import mock + from django.urls import reverse -import mock from openstack_dashboard import api from blazar_dashboard import api as blazar_api diff --git a/blazar_dashboard/content/leases/forms.py b/blazar_dashboard/content/leases/forms.py index a63e0f8..e0f11e5 100644 --- a/blazar_dashboard/content/leases/forms.py +++ b/blazar_dashboard/content/leases/forms.py @@ -324,14 +324,14 @@ class UpdateForm(forms.SelfHandlingForm): reservations = cleaned_data.get("reservations", None) if start_time: - valid = re.match('^[+-]\d+[dhm]$', start_time) + valid = re.match(r'^[+-]\d+[dhm]$', start_time) if not valid: raise forms.ValidationError("The start/end time must be " "a form of +/- number d/h/m. " "(e.g. +1h)") if end_time: - valid = re.match('^[+-]\d+[dhm]$', end_time) + valid = re.match(r'^[+-]\d+[dhm]$', end_time) if not valid: raise forms.ValidationError("The start/end time must be " "a form of +/- number d/h/m. " diff --git a/blazar_dashboard/content/leases/tests.py b/blazar_dashboard/content/leases/tests.py index 54f0f01..3a120a9 100644 --- a/blazar_dashboard/content/leases/tests.py +++ b/blazar_dashboard/content/leases/tests.py @@ -11,9 +11,9 @@ # under the License. from datetime import datetime +from unittest import mock from django.urls import reverse -import mock import pytz from blazar_dashboard import api diff --git a/blazar_dashboard/test/test_data/blazar_data.py b/blazar_dashboard/test/test_data/blazar_data.py index 173e351..ee225dd 100644 --- a/blazar_dashboard/test/test_data/blazar_data.py +++ b/blazar_dashboard/test/test_data/blazar_data.py @@ -176,6 +176,7 @@ class DummyHypervisor(object): def __init__(self, host_name): self.hypervisor_hostname = host_name + hypervisor_sample1 = DummyHypervisor('compute-1') hypervisor_sample2 = DummyHypervisor('compute-2') diff --git a/doc/requirements.txt b/doc/requirements.txt index 400ef40..ab877bb 100644 --- a/doc/requirements.txt +++ b/doc/requirements.txt @@ -2,7 +2,7 @@ # of appearance. Changing the order has an impact on the overall integration # process, which may cause wedges in the gate later. -openstackdocstheme>=1.18.1 # Apache-2.0 -sphinx>=1.8.0,!=2.1.0;python_version>='3.4' # BSD +openstackdocstheme>=1.31.2 # Apache-2.0 +sphinx>=1.8.0,!=2.1.0 # BSD reno>=2.5.0 # Apache-2.0 sphinxcontrib-httpdomain>=1.3.0 # BSD diff --git a/doc/source/conf.py b/doc/source/conf.py index 9848732..0859358 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -22,8 +22,6 @@ # All configuration values have a default; values that are commented out # serve to show the default. -from blazar_dashboard.version import version_info as blazar_dashboard_version - # -- General configuration ---------------------------------------------------- # If your documentation needs a minimal Sphinx version, state it here. @@ -57,15 +55,6 @@ master_doc = 'index' project = u'Blazar dashboard' copyright = u'2017, OpenStack Foundation' -# The version info for the project you're documenting, acts as replacement for -# |version| and |release|, also used in various other places throughout the -# built documents. -# -# Version info -release = blazar_dashboard_version.release_string() -# The short X.Y version. -version = blazar_dashboard_version.version_string() - # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. # language = None @@ -137,9 +126,6 @@ html_theme = 'openstackdocs' # so a file named "default.css" will overwrite the builtin "default.css". # html_static_path = ['_static'] -# Must set this variable to include year, month, day, hours, and minutes. -html_last_updated_fmt = '%Y-%m-%d %H:%M' - # If true, SmartyPants will be used to convert quotes and dashes to # typographically correct entities. # html_use_smartypants = True diff --git a/lower-constraints.txt b/lower-constraints.txt index a39cf18..5189eeb 100644 --- a/lower-constraints.txt +++ b/lower-constraints.txt @@ -13,14 +13,11 @@ django-pyscss==2.0.2 Django==2.2 extras==1.0.0 fixtures==3.0.0 -flake8==2.5.5 -hacking==1.1.0 horizon==17.1.0 idna==2.6 iso8601==0.1.12 keystoneauth1==3.4.0 linecache2==1.0.0 -mccabe==0.2.1 mock==2.0.0 monotonic==1.4 mox3==0.20.0 @@ -38,9 +35,7 @@ oslo.utils==3.36.0 packaging==17.1 Parsley==1.3 pbr==2.0.0 -pep8==1.5.7 prettytable==0.7.2 -pyflakes==0.8.1 pyinotify==0.9.6 pyparsing==2.2.0 pyperclip==1.6.0 diff --git a/releasenotes/source/conf.py b/releasenotes/source/conf.py index 8a51f06..e5bf311 100644 --- a/releasenotes/source/conf.py +++ b/releasenotes/source/conf.py @@ -148,9 +148,6 @@ html_theme = 'openstackdocs' # directly to the root of the documentation. # html_extra_path = [] -# Must set this variable to include year, month, day, hours, and minutes. -html_last_updated_fmt = '%Y-%m-%d %H:%M' - # If true, SmartyPants will be used to convert quotes and dashes to # typographically correct entities. # html_use_smartypants = True diff --git a/setup.cfg b/setup.cfg index 1906487..8048cc6 100644 --- a/setup.cfg +++ b/setup.cfg @@ -6,6 +6,7 @@ description-file = author = OpenStack author-email = openstack-discuss@lists.openstack.org home-page = https://docs.openstack.org/blazar-dashboard/latest/ +python-requires = >=3.6 classifier = Environment :: OpenStack Intended Audience :: Information Technology @@ -13,6 +14,8 @@ classifier = License :: OSI Approved :: Apache Software License Operating System :: POSIX :: Linux 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 @@ -20,9 +23,3 @@ classifier = [files] packages = blazar_dashboard - -[build_sphinx] -all_files = 1 -build-dir = doc/build -source-dir = doc/source -warning-is-error = 1 diff --git a/setup.py b/setup.py index 566d844..cd35c3c 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 41d825b..b993b1e 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -7,7 +7,7 @@ # be installed in a specific order. # # Hacking should appear first in case something else depends on pep8 -hacking>=1.1.0,<1.2.0 # Apache-2.0 +hacking>=3.0,<3.1.0 # Apache-2.0 # coverage!=4.4,>=4.0 # Apache-2.0 mock>=2.0.0 # BSD diff --git a/tox.ini b/tox.ini index fbc9b0e..b715fce 100644 --- a/tox.ini +++ b/tox.ini @@ -44,7 +44,7 @@ commands = deps = -c{env:UPPER_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master} -r{toxinidir}/doc/requirements.txt -commands = python setup.py build_sphinx +commands = sphinx-build -W -b html doc/source doc/build/pdf [testenv:pdf-docs] deps = -r{toxinidir}/doc/requirements.txt @@ -63,7 +63,8 @@ commands = sphinx-build -a -E -W -d releasenotes/build/doctrees --keep-going -b [flake8] # F405 TEMPLATES may be undefined, or defined from star imports # (because it is not easy to avoid this in openstack_dashboard.test.settings) -ignore = F405 +# W504 line break after binary operator +ignore = F405,W504 exclude = .venv,.git,.tox,dist,*lib/python*,*egg,build,node_modules max-complexity = 20