From c127687d3d01a36cf9ae6f0f899e1ce13cf11cdc Mon Sep 17 00:00:00 2001 From: Andreas Jaeger Date: Sat, 11 Apr 2020 14:41:38 +0200 Subject: [PATCH] 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 - Remove obsolete sections from setup.cfg - Update requirements, no need for python_version anymore - Cleanup doc/source/conf.py to remove now obsolete content. - Use newer openstackdocstheme version - Remove install_command from tox.ini, the default is fine; move contraints into deps - Move python3 into base tox environment. Change-Id: Ibd243ce5be8415147c24f596b4059ec3fb68a89c --- doc/source/conf.py | 3 --- lower-constraints.txt | 2 +- setup.cfg | 9 --------- setup.py | 9 --------- test-requirements.txt | 5 ++--- tox.ini | 8 +++----- 6 files changed, 6 insertions(+), 30 deletions(-) diff --git a/doc/source/conf.py b/doc/source/conf.py index 975fcb1..31f120a 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -14,7 +14,6 @@ import os import sys -import openstackdocstheme sys.path.insert(0, os.path.abspath('../..')) # -- General configuration ---------------------------------------------------- @@ -31,7 +30,6 @@ extensions = [ repository_name = 'openstack/manila-image-elements' bug_project = 'manila-image-elements' bug_tag = 'docs' -html_last_updated_fmt = '%Y-%m-%d %H:%M' # autodoc generation is a bit aggressive and a nuisance when doing heavy # text edit cycles. @@ -63,7 +61,6 @@ pygments_style = 'sphinx' # Sphinx are currently 'default' and 'sphinxdoc'. # html_theme_path = ["."] html_theme = 'openstackdocs' -html_theme_path = [openstackdocstheme.get_html_theme_path()] # html_static_path = ['static'] # Output file base name for HTML help builder. diff --git a/lower-constraints.txt b/lower-constraints.txt index ed4630f..3babf3a 100644 --- a/lower-constraints.txt +++ b/lower-constraints.txt @@ -15,7 +15,7 @@ Jinja2==2.10 MarkupSafe==1.0 mccabe==0.2.1 networkx==1.11 -openstackdocstheme==1.18.1 +openstackdocstheme==1.31.2 pbr==2.0.0 pep8==1.5.7 pyflakes==0.8.1 diff --git a/setup.cfg b/setup.cfg index a3a1487..02ab478 100644 --- a/setup.cfg +++ b/setup.cfg @@ -18,12 +18,3 @@ scripts = data_files = share/manila-elements/elements = elements/* - -[build_sphinx] -all_files = 1 -build-dir = doc/build -source-dir = doc/source -warning-is-error = 1 - -[wheel] -universal = 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 40f6ae7..0733a62 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -6,6 +6,5 @@ bashate>=0.5.1 # Apache-2.0 hacking>=3.0,<3.1.0 # Apache-2.0 docutils>=0.11 # OSI-Approved Open Source, Public Domain -sphinx!=1.6.6,!=1.6.7,>=1.6.2,<2.0.0;python_version=='2.7' # BSD -sphinx!=1.6.6,!=1.6.7,!=2.1.0,>=1.6.2;python_version>='3.4' # BSD -openstackdocstheme>=1.18.1 # Apache-2.0 +sphinx!=1.6.6,!=1.6.7,!=2.1.0,>=1.6.2 # BSD +openstackdocstheme>=1.31.2 # Apache-2.0 diff --git a/tox.ini b/tox.ini index 78f227d..2658950 100644 --- a/tox.ini +++ b/tox.ini @@ -4,11 +4,12 @@ minversion = 1.6 skipsdist = True [testenv] +basepython = python3 usedevelop = True -install_command = pip install -c{env:UPPER_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master} {opts} {packages} setenv = VIRTUAL_ENV={envdir} deps = + -c{env:UPPER_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master} -r{toxinidir}/requirements.txt -r{toxinidir}/test-requirements.txt @@ -17,22 +18,20 @@ whitelist_externals = bash commands = {toxinidir}/tools/run_bashate.sh [testenv:docs] -basepython = python3 commands = sphinx-build -W -d doc/build/doctrees -b html doc/source/ doc/build/html [testenv:pep8] -basepython = python3 commands = flake8 {posargs} {toxinidir}/tools/run_bashate.sh [testenv:venv] -basepython = python3 commands = {posargs} [testenv:buildimage] commands = manila-image-create {posargs} deps = + -c{env:UPPER_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master} -r{toxinidir}/requirements.txt [testenv:buildimage-docker] @@ -44,7 +43,6 @@ builtins = _ exclude=.venv,.git,.tox,dist,doc,*openstack/common*,*lib/python*,*egg,tools [testenv:lower-constraints] -basepython = python3 deps = -c{toxinidir}/lower-constraints.txt -r{toxinidir}/test-requirements.txt