From 0f9a50ed8d0bae92be1ddac449cfad4e54ea6040 Mon Sep 17 00:00:00 2001 From: Andreas Jaeger Date: Fri, 17 Apr 2020 19:56:28 +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 - 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 - Use newer openstackdocstheme and Sphinx versions - Cleanup */source/conf.py to remove now obsolete content. Change-Id: Icab2b68608002968bbc56791faedd119db7516e7 --- doc/source/conf.py | 14 -------------- lower-constraints.txt | 4 ++-- releasenotes/source/conf.py | 1 - setup.cfg | 12 +++--------- setup.py | 9 --------- test-requirements.txt | 5 ++--- tox.ini | 3 ++- 7 files changed, 9 insertions(+), 39 deletions(-) diff --git a/doc/source/conf.py b/doc/source/conf.py index 6fcd368..5bacde5 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -22,15 +22,11 @@ # All configuration values have a default; values that are commented out # serve to show the default. -from __future__ import print_function - import os import sys import django -import neutron_fwaas_dashboard.version - PROJECT = 'neutron-fwaas-dashboard' BASE_DIR = os.path.dirname(os.path.abspath(__file__)) ROOT = os.path.abspath(os.path.join(BASE_DIR, "..", "..")) @@ -70,7 +66,6 @@ extensions = [ repository_name = 'openstack/neutron-fwaas-dashboard' bug_project = 'neutron-fwaas-dashboard' bug_tag = 'doc' -html_last_updated_fmt = '%Y-%m-%d %H:%M' # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates'] @@ -88,15 +83,6 @@ master_doc = 'index' project = u'Neutron FWaaS 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. -# -# The short X.Y version. -version = neutron_fwaas_dashboard.version.version_info.version_string() -# The full version, including alpha/beta/rc tags. -release = neutron_fwaas_dashboard.version.version_info.release_string() - # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. # language = None diff --git a/lower-constraints.txt b/lower-constraints.txt index 3c3b4ba..84293a5 100644 --- a/lower-constraints.txt +++ b/lower-constraints.txt @@ -50,7 +50,7 @@ msgpack-python==0.4.0 munch==2.1.0 netaddr==0.7.18 netifaces==0.10.4 -openstackdocstheme==1.18.1 +openstackdocstheme==2.0.0 openstacksdk==0.11.2 os-client-config==1.28.0 os-service-types==1.2.0 @@ -109,7 +109,7 @@ semantic-version==2.3.1 simplejson==3.5.1 six==1.10.0 snowballstemmer==1.2.1 -Sphinx==1.6.2 +Sphinx==2.0.0 sphinxcontrib-websupport==1.0.1 statsd==3.2.1 stevedore==1.20.0 diff --git a/releasenotes/source/conf.py b/releasenotes/source/conf.py index 7076e2c..c3745d6 100644 --- a/releasenotes/source/conf.py +++ b/releasenotes/source/conf.py @@ -46,7 +46,6 @@ extensions = [ repository_name = 'openstack/neutron-fwaas-dashboard' bug_project = 'neutron-fwaas-dashboard' bug_tag = 'doc' -html_last_updated_fmt = '%Y-%m-%d %H:%M' # Add any paths that contain templates here, relative to this directory. # templates_path = ['_templates'] diff --git a/setup.cfg b/setup.cfg index 1be79f4..9e369c4 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/neutron-fwaas-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,12 +23,3 @@ classifier = [files] packages = neutron_fwaas_dashboard - -[build_sphinx] -source-dir = doc/source -build-dir = doc/build -all-files = 1 -warning-is-error = 1 - -[upload_sphinx] -upload-dir = doc/build/html 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 a9c39d5..c8d9383 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -8,9 +8,8 @@ hacking>=3.0,<3.1.0 # Apache-2.0 coverage!=4.4,>=4.0 # Apache-2.0 flake8-import-order==0.13 # LGPLv3 mock>=2.0.0 # BSD -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>=2.0.0,!=2.1.0 # BSD +openstackdocstheme>=2.0.0 # Apache-2.0 reno>=2.5.0 # Apache-2.0 # integration tests requirements diff --git a/tox.ini b/tox.ini index 7e79cc9..bd284c9 100644 --- a/tox.ini +++ b/tox.ini @@ -49,7 +49,8 @@ basepython = python3 commands = {envpython} {toxinidir}/manage.py test neutron_fwaas_dashboard --tag integration {posargs} [testenv:docs] -commands = python setup.py build_sphinx +commands = + sphinx-build -W -b html doc/source doc/build/html [testenv:pdf-docs] envdir = {toxworkdir}/docs