From a98989b2ef3a7473473a92d762a22dfe6d704ada Mon Sep 17 00:00:00 2001 From: Andreas Jaeger Date: Mon, 13 Apr 2020 15:17:50 +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; fix build warnings - Cleanup doc/source/conf.py to remove now obsolete content. - Use newer openstackdocstheme version - Raise oslo.utils version, 3.36.5 introduced uuidsentinel. Change-Id: I8c81e0c1944c239e460befbf886993270902ee04 --- doc/source/conf.py | 4 +++- doc/source/reference/index.rst | 7 +++++++ lower-constraints.txt | 4 ++-- requirements.txt | 2 +- setup.cfg | 11 +++-------- setup.py | 9 --------- test-requirements.txt | 4 ++-- tox.ini | 5 +++-- 8 files changed, 21 insertions(+), 25 deletions(-) diff --git a/doc/source/conf.py b/doc/source/conf.py index a16e078a..b9eaaf2d 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -82,7 +82,9 @@ copyright = u'2013-present, OpenStack Foundation' # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. -exclude_patterns = [] +exclude_patterns = [ + 'images/source/README.rst' +] # The reST default role (used for this markup: `text`) to use for all documents. #default_role = None diff --git a/doc/source/reference/index.rst b/doc/source/reference/index.rst index e9a218ac..80986acc 100644 --- a/doc/source/reference/index.rst +++ b/doc/source/reference/index.rst @@ -12,3 +12,10 @@ Internals The following is a dive into some of the internals in blazar. * :doc:`/reference/api-microversion-history`: How blazar uses API microversion. + + +.. toctree:: + :hidden: + :maxdepth: 2 + + api-microversion-history diff --git a/lower-constraints.txt b/lower-constraints.txt index 14c8e658..b895a716 100644 --- a/lower-constraints.txt +++ b/lower-constraints.txt @@ -46,7 +46,7 @@ mox3==0.25.0 msgpack==0.5.6 netaddr==0.7.18 netifaces==0.10.6 -openstackdocstheme==1.18.1 +openstackdocstheme==1.31.2 os-api-ref==1.4.0 os-client-config==1.29.0 oslo.cache==1.29.0 @@ -62,7 +62,7 @@ oslo.policy==1.30.0 oslo.serialization==2.18.0 oslo.service==1.24.0 oslo.upgradecheck==0.1.0 -oslo.utils==3.33.0 +oslo.utils==3.36.5 oslotest==3.2.0 Paste==2.0.3 PasteDeploy==1.5.2 diff --git a/requirements.txt b/requirements.txt index 9c6af816..bf80bc71 100644 --- a/requirements.txt +++ b/requirements.txt @@ -23,7 +23,7 @@ oslo.policy>=1.30.0 # Apache-2.0 oslo.serialization!=2.19.1,>=2.18.0 # Apache-2.0 oslo.service!=1.28.1,>=1.24.0 # Apache-2.0 oslo.upgradecheck>=0.1.0 # Apache-2.0 -oslo.utils>=3.33.0 # Apache-2.0 +oslo.utils>=3.36.5 # Apache-2.0 python-neutronclient>=6.0.0 # Apache-2.0 python-novaclient>=9.1.0 # Apache-2.0 netaddr>=0.7.18 # BSD diff --git a/setup.cfg b/setup.cfg index 1c8ea2ac..fa5c7a84 100644 --- a/setup.cfg +++ b/setup.cfg @@ -3,8 +3,11 @@ name = blazar summary = Reservation Service for OpenStack clouds description-file = README.rst license = Apache Software License +python-requires = >=3.6 classifiers = 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 @@ -19,9 +22,6 @@ author = OpenStack author_email = openstack-discuss@lists.openstack.org home-page = https://docs.openstack.org/blazar/latest/ -[global] -setup-hooks = pbr.hooks.setup_hook - [files] packages = blazar @@ -58,11 +58,6 @@ oslo.policy.policies = wsgi_scripts = blazar-api-wsgi = blazar.api.wsgi_app:init_app -[build_sphinx] -all_files = 1 -build-dir = doc/build -source-dir = doc/source - [extract_messages] keywords = _ mapping_file = babel.cfg 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 263c3e21..e28468d8 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -15,6 +15,6 @@ oslo.context>=2.19.2 # Apache-2.0 # Documentation reno>=2.5.0 # Apache-2.0 -sphinx>=1.8.0,!=2.1.0;python_version>='3.4' # BSD -openstackdocstheme>=1.18.1 # Apache-2.0 +sphinx>=1.8.0,!=2.1.0 # BSD +openstackdocstheme>=1.31.2 # Apache-2.0 os-api-ref>=1.4.0 # Apache-2.0 diff --git a/tox.ini b/tox.ini index bc22535f..55c03abb 100644 --- a/tox.ini +++ b/tox.ini @@ -9,7 +9,8 @@ basepython = python3 usedevelop = True whitelist_externals = rm install_command = pip install -c{env:UPPER_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master} {opts} {packages} -deps = -r{toxinidir}/test-requirements.txt +deps = + -r{toxinidir}/test-requirements.txt -r{toxinidir}/requirements.txt setenv = VIRTUAL_ENV={envdir} DISCOVER_DIRECTORY=blazar/tests @@ -45,7 +46,7 @@ deps = commands = rm -rf doc/html doc/build rm -rf doc/source/apidoc doc/source/api - python setup.py build_sphinx + sphinx-build -W -b html doc/source doc/build [testenv:pdf-docs] deps = {[testenv:docs]deps}