Browse Source

Cleanup py27 support

This repo is now testing only with Python 3, so let's make
a few cleanups:
- Remove python 2.7 stanza from setup.py
- Add requires on python >= 3.6 to setup.cfg so that pypi and pip
  know about the requirement
- Remove obsolete sections from setup.cfg
- Update classifiers
- Update requirements, no need for python_version anymore
- Switch to using sphinx-build
- Cleanup doc/source/conf.py to remove now obsolete content.
- Use newer openstackdocstheme version
- Update hacking to version 3.0; remove hacking and friends
  from requirements, they are not needed; fix warnings found
- Use unittest.mock

Change-Id: I379c086a15477da4b0223fddd48035c829992c88
changes/63/719463/4 3.0.0
Andreas Jaeger 2 years ago committed by Pierre Riteau
parent
commit
26fda6b697
  1. 3
      blazar_dashboard/content/hosts/tests.py
  2. 4
      blazar_dashboard/content/leases/forms.py
  3. 2
      blazar_dashboard/content/leases/tests.py
  4. 1
      blazar_dashboard/test/test_data/blazar_data.py
  5. 4
      doc/requirements.txt
  6. 14
      doc/source/conf.py
  7. 5
      lower-constraints.txt
  8. 3
      releasenotes/source/conf.py
  9. 9
      setup.cfg
  10. 9
      setup.py
  11. 2
      test-requirements.txt
  12. 5
      tox.ini

3
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

4
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. "

2
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

1
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')

4
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

14
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

5
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

3
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

9
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

9
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)

2
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

5
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

Loading…
Cancel
Save