From 98a67d5b9602bdc61b504dae9edbb637a4c3649b Mon Sep 17 00:00:00 2001 From: Andreas Jaeger Date: Fri, 27 Mar 2020 16:57:33 +0100 Subject: [PATCH] Cleanup Python 2.7 support OpenStack is dropping the py2.7 support in ussuri cycle. 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 section from setup.cfg: Wheel is not needed for python 3 only repo - Remove ancient sections from setup.cfg - Update requirements - Update api-ref/source/conf.py for current openstackdocstheme - Don't test for broken po files, this is done in the infra scripts since a long time - Change shebang lines to use python3 Change-Id: If5276a47b8822c5c19d045fbc5c41394f4a9dd2d --- api-ref/source/conf.py | 5 +---- doc/requirements.txt | 2 +- setup.cfg | 9 +-------- setup.py | 8 -------- tacker/cmd/eventlet/tacker_server.py | 2 -- tools/install_venv.py | 3 +-- tox.ini | 1 - 7 files changed, 4 insertions(+), 26 deletions(-) diff --git a/api-ref/source/conf.py b/api-ref/source/conf.py index 0bd81ddfe..847d15c34 100644 --- a/api-ref/source/conf.py +++ b/api-ref/source/conf.py @@ -25,8 +25,6 @@ import os import sys -import openstackdocstheme - # 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. @@ -41,14 +39,13 @@ sys.path.insert(0, os.path.abspath('./')) extensions = [ 'os_api_ref', + 'openstackdocstheme' ] html_theme = 'openstackdocs' -html_theme_path = [openstackdocstheme.get_html_theme_path()] html_theme_options = { "sidebar_mode": "toc", } -html_context = {'bug_project': 'tacker', 'bug_tag': 'api-ref'} # The suffix of source filenames. source_suffix = '.rst' diff --git a/doc/requirements.txt b/doc/requirements.txt index 8139c63e3..3e7b5f4e4 100644 --- a/doc/requirements.txt +++ b/doc/requirements.txt @@ -1,7 +1,7 @@ # The order of packages is significant, because pip processes them in the order # of appearance. Changing the order has an impact on the overall integration # process, which may cause wedges in the gate later. -sphinx!=1.6.6,!=1.6.7,!=2.1.0,>=1.6.2;python_version>='3.4' # BSD +sphinx!=1.6.6,!=1.6.7,!=2.1.0,>=1.6.2 # BSD sphinxcontrib-apidoc>=0.2.0 # BSD openstackdocstheme>=1.20.0 # Apache-2.0 os-api-ref>=1.4.0 # Apache-2.0 diff --git a/setup.cfg b/setup.cfg index 239f0d921..bf24e0e3b 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/tacker/ +python-requires = >=3.6 classifier = Environment :: OpenStack Intended Audience :: Information Technology @@ -104,11 +105,6 @@ oslo.policy.policies = # aggregate method. tacker = tacker.policies:list_rules -[build_releasenotes] -all_files = 1 -build-dir = releasenotes/build -source-dir = releasenotes/source - [extract_messages] keywords = _ gettext ngettext l_ lazy_gettext mapping_file = babel.cfg @@ -122,6 +118,3 @@ domain = tacker domain = tacker output_dir = tacker/locale input_file = tacker/locale/tacker.pot - -[wheel] -universal = 1 diff --git a/setup.py b/setup.py index 566d84432..f63cc23c5 100644 --- a/setup.py +++ b/setup.py @@ -16,14 +16,6 @@ # 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/tacker/cmd/eventlet/tacker_server.py b/tacker/cmd/eventlet/tacker_server.py index 1d120957d..0cb40f864 100644 --- a/tacker/cmd/eventlet/tacker_server.py +++ b/tacker/cmd/eventlet/tacker_server.py @@ -1,5 +1,3 @@ -#!/usr/bin/env python - # Copyright 2011 VMware, Inc. # All Rights Reserved. # diff --git a/tools/install_venv.py b/tools/install_venv.py index 8313474d1..7127b2a01 100644 --- a/tools/install_venv.py +++ b/tools/install_venv.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. @@ -22,7 +22,6 @@ """ Installation script for Tacker's development virtualenv """ -from __future__ import print_function import os import sys diff --git a/tox.ini b/tox.ini index 584d60da1..60e7f343a 100644 --- a/tox.ini +++ b/tox.ini @@ -47,7 +47,6 @@ commands = flake8 doc8 -e .rst doc/source/ CONTRIBUTING.rst HACKING.rst README.rst TESTING.rst tacker-db-manage check_migration - bash -c "find tacker -type f -regex '.*\.pot?' -print0|xargs -0 --no-run-if-empty -n 1 msgfmt --check-format -o /dev/null" whitelist_externals = bash [testenv:i18n]