From 038a7f29b4e5b14e923ca01add263a93c88dad54 Mon Sep 17 00:00:00 2001 From: Andreas Jaeger Date: Sat, 25 Apr 2020 15:17:36 +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 - Use newer openstackdocstheme and Sphinx versions, enable build warnings and fix problems - Cleanup */source/conf.py to remove now obsolete content. - Remove install_command from tox.ini, the default is fine - Remove usage of pip_install role, this is retired now Change-Id: I64133e987965d02faa25102b98ad102ff9ef142b --- bindep.txt | 22 +++++++++------------- doc/requirements.txt | 4 ++-- doc/source/conf.py | 24 +----------------------- doc/source/index.rst | 6 ------ releasenotes/source/conf.py | 9 --------- setup.cfg | 11 ----------- setup.py | 9 --------- tests/ansible-role-requirements.yml | 4 ---- tox.ini | 10 +++++----- 9 files changed, 17 insertions(+), 82 deletions(-) diff --git a/bindep.txt b/bindep.txt index f59c70c..8f144fc 100644 --- a/bindep.txt +++ b/bindep.txt @@ -3,7 +3,7 @@ # # See the following for details: # - https://docs.openstack.org/infra/bindep/ -# - https://git.openstack.org/cgit/openstack-infra/bindep +# - https://opendev.org/openstack-infra/bindep # # Even if the role does not make use of this facility, it # is better to have this file empty, otherwise OpenStack-CI @@ -12,7 +12,7 @@ # # Note: # This file is maintained in the openstack-ansible-tests repository. -# https://git.openstack.org/cgit/openstack/openstack-ansible-tests/tree/bindep.txt +# https://opendev.org/openstack/openstack-ansible-tests/src/bindep.txt # If you need to remove or add extra dependencies, you should modify # the central file instead and once your change is accepted then update # this file as well. The purpose of this file is to ensure that Python and @@ -26,29 +26,25 @@ gcc # Base requirements for Ubuntu -git-core [platform:dpkg] +git-core [platform:dpkg platform:suse] libssl-dev [platform:dpkg] libffi-dev [platform:dpkg] -python2.7 [platform:dpkg] -python-apt [platform:dpkg] -python-dev [platform:dpkg] python3 [platform:dpkg] python3-apt [platform:dpkg] python3-dev [platform:dpkg] # Base requirements for RPM distros gcc-c++ [platform:rpm] -git [platform:rpm] +git [platform:rpm !platform:suse] libffi-devel [platform:rpm] openssl-devel [platform:rpm] -python-devel [platform:rpm] -python2-dnf [platform:fedora] +python3-dnf [platform:fedora] +python3-devel [platform:rpm] + +# Base requirements for Gentoo +git [platform:gentoo] # For SELinux libselinux-python3 [platform:redhat] libsemanage-python3 [platform:redhat] iptables [platform:redhat] - - -# Required for compressing collected log files in CI -gzip diff --git a/doc/requirements.txt b/doc/requirements.txt index 71c0d0d..6e3f8f9 100644 --- a/doc/requirements.txt +++ b/doc/requirements.txt @@ -3,7 +3,7 @@ # process, which may cause wedges in the gate later. # this is required for the docs build jobs -sphinx!=1.6.6,!=1.6.7,>=1.6.2 # 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 doc8>=0.6.0 # Apache-2.0 diff --git a/doc/source/conf.py b/doc/source/conf.py index 9709903..fe89b0b 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. -import pbr.version - # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. @@ -66,22 +64,6 @@ role_name = 'qdrouterd' target_name = 'ansible-role' + role_name title = 'OpenStack-Ansible Documentation: ' + role_name + 'role' -# The link to the browsable source code (for the left hand menu) -oslosphinx_cgit_link = ( - 'https://git.openstack.org/cgit/openstack/{}'.format(target_name) -) - -# 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_info = pbr.version.VersionInfo(target_name) -# The full version, including alpha/beta/rc tags. -release = version_info.version_string_with_vcs() -# The short X.Y version. -version = version_info.canonical_version_string() - # openstackdocstheme options repository_name = 'openstack/' + target_name bug_project = project.lower() @@ -165,17 +147,13 @@ html_theme = 'openstackdocs' # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". -html_static_path = ['_static'] +# html_static_path = ['_static'] # Add any extra paths that contain custom files (such as robots.txt or # .htaccess) here, relative to this directory. These files are copied # directly to the root of the documentation. # html_extra_path = [] -# If not '', a 'Last updated on:' timestamp is inserted at every page bottom, -# using the given strftime format. -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/doc/source/index.rst b/doc/source/index.rst index 68b7ef8..255be1b 100644 --- a/doc/source/index.rst +++ b/doc/source/index.rst @@ -25,9 +25,3 @@ Dependencies ~~~~~~~~~~~~ This role needs pip >= 7.1 installed on the target host. - -Example playbook -~~~~~~~~~~~~~~~~ - -.. literalinclude:: ../../examples/playbook.yml - :language: yaml diff --git a/releasenotes/source/conf.py b/releasenotes/source/conf.py index f9a8aa6..f79c801 100644 --- a/releasenotes/source/conf.py +++ b/releasenotes/source/conf.py @@ -62,11 +62,6 @@ role_name = 'rabbitmq_server' target_name = 'openstack-ansible-' + role_name title = 'OpenStack-Ansible Release Notes: ' + role_name + 'role' -# The link to the browsable source code (for the left hand menu) -oslosphinx_cgit_link = ( - 'https://git.openstack.org/cgit/openstack/{}'.format(target_name) -) - # Release notes do not need a version number in the title, they # cover multiple releases. # The full version, including alpha/beta/rc tags. @@ -158,10 +153,6 @@ html_theme = 'openstackdocs' # directly to the root of the documentation. # html_extra_path = [] -# If not '', a 'Last updated on:' timestamp is inserted at every page bottom, -# using the given strftime format. -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 1b19590..ee34254 100644 --- a/setup.cfg +++ b/setup.cfg @@ -8,14 +8,3 @@ classifier = Intended Audience :: System Administrators License :: OSI Approved :: Apache Software License Operating System :: POSIX :: Linux - -[build_sphinx] -all_files = 1 -build-dir = doc/build -source-dir = doc/source - -[pbr] -warnerrors = True - -[wheel] -universal = 1 diff --git a/setup.py b/setup.py index d24e556..c03df58 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/tests/ansible-role-requirements.yml b/tests/ansible-role-requirements.yml index f53bcd3..49618c1 100644 --- a/tests/ansible-role-requirements.yml +++ b/tests/ansible-role-requirements.yml @@ -3,10 +3,6 @@ src: https://opendev.org/openstack/openstack-ansible-apt_package_pinning scm: git version: master -- name: pip_install - src: https://opendev.org/openstack/openstack-ansible-pip_install - scm: git - version: master - name: openstack_hosts src: https://opendev.org/openstack/openstack-ansible-openstack_hosts scm: git diff --git a/tox.ini b/tox.ini index 102f76b..8af44db 100644 --- a/tox.ini +++ b/tox.ini @@ -6,8 +6,6 @@ envlist = docs,linters,functional [testenv] usedevelop = True -install_command = - pip install -c{env:UPPER_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master} {opts} {packages} commands = /usr/bin/find . -type f -name "*.pyc" -delete passenv = @@ -31,11 +29,13 @@ setenv = [testenv:docs] basepython = python3 -deps = -r{toxinidir}/doc/requirements.txt +deps = + -c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master} + -r{toxinidir}/doc/requirements.txt commands= bash -c "rm -rf doc/build" doc8 doc - sphinx-build -b html doc/source doc/build/html + sphinx-build -W -b html doc/source doc/build/html [doc8] @@ -45,7 +45,7 @@ extensions = .rst [testenv:releasenotes] basepython = python3 -deps = -r{toxinidir}/doc/requirements.txt +deps = {[testenv:docs]deps} commands = sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html