From f5332fd0d1246d833ce6b7fa61dddef142432e63 Mon Sep 17 00:00:00 2001 From: Andreas Jaeger Date: Mon, 13 Apr 2020 16:36:58 +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. Remove extra build step from docs build - api-ref is build separate. - Cleanup doc/source/conf.py to remove now obsolete content. - Use newer openstackdocstheme version - Remove install_command from tox.ini, the default is fine Change-Id: I7bb95a8ebd7023046baae30595159254bac25690 --- doc/source/conf.py | 15 --------------- lower-constraints.txt | 2 +- releasenotes/source/conf.py | 2 -- setup.cfg | 12 +++--------- setup.py | 9 --------- test-requirements.txt | 10 ++++------ tox.ini | 3 +-- 7 files changed, 9 insertions(+), 44 deletions(-) diff --git a/doc/source/conf.py b/doc/source/conf.py index 8c1a8508..6d3d55eb 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -136,21 +136,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 = '%b %d, %Y' -git_cmd = ["git", "log", "--pretty=format:%ad, commit %h", "--date=local", - "-n1"] -#try: -# html_last_updated_fmt = subprocess.check_output(git_cmd).decode('utf-8') -#except Exception: -# warnings.warn('Cannot get last updated time from git repository. ' -# 'Not setting "html_last_updated_fmt".') -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 - # Custom sidebar templates, maps document names to template names. #html_sidebars = {} diff --git a/lower-constraints.txt b/lower-constraints.txt index 374de59c..c6831e8f 100644 --- a/lower-constraints.txt +++ b/lower-constraints.txt @@ -31,7 +31,7 @@ monotonic==1.4 msgpack==0.5.6 netaddr==0.7.19 netifaces==0.10.6 -openstackdocstheme==1.18.1 +openstackdocstheme==1.31.2 os-api-ref==1.4.0 oslo.cache==1.29.0 oslo.config==5.2.0 diff --git a/releasenotes/source/conf.py b/releasenotes/source/conf.py index e8e0d9b9..e027b1b7 100644 --- a/releasenotes/source/conf.py +++ b/releasenotes/source/conf.py @@ -34,8 +34,6 @@ repository_name = 'openstack/freezer-api' bug_project = 'freezer' bug_tag = 'release notes' -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 b1e1f7bb..ad958f5c 100644 --- a/setup.cfg +++ b/setup.cfg @@ -9,9 +9,12 @@ author = OpenStack author_email = openstack-discuss@lists.openstack.org home-page = https://docs.openstack.org/freezer/latest/ +python-requires = >=3.6 classifier = Environment :: OpenStack 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 @@ -37,12 +40,6 @@ classifier = packages = freezer_api -[build_sphinx] -source-dir = doc/source -build-dir = doc/build -all_files = 1 -warning-is-error = 1 - [entry_points] oslo.config.opts = freezer-api = freezer_api.common.config:list_opts @@ -62,6 +59,3 @@ freezer.db.backends = [pytests] where=tests verbosity=2 - -[pbr] -warnerrors = True 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 00fcaa1c..14cc675a 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -7,14 +7,12 @@ hacking!=0.13.0,<0.14,>=0.12.0 # Apache-2.0 coverage!=4.4,>=4.0 # Apache-2.0 fixtures>=3.0.0 # Apache-2.0/BSD oslotest>=3.3.0 # Apache-2.0 -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 testrepository>=0.0.18 # Apache-2.0/BSD testtools>=2.2.0 # MIT os-api-ref>=1.4.0 # Apache-2.0 reno>=2.5.0 # Apache-2.0 -openstackdocstheme>=1.18.1 # Apache-2.0 -astroid==1.6.5;python_version<"3.0" # LGPLv2.1 -astroid==2.1.0;python_version>="3.0" # LGPLv2.1 -pylint==1.9.2;python_version<"3.0" # GPLv2 -pylint==2.3.1;python_version>="3.0" # GPLv2 +openstackdocstheme>=1.31.2 # Apache-2.0 +astroid==2.1.0 # LGPLv2.1 +pylint==2.3.1 # GPLv2 PyMySQL>=0.7.6 # MIT License diff --git a/tox.ini b/tox.ini index 3f373519..6ddce93d 100644 --- a/tox.ini +++ b/tox.ini @@ -76,8 +76,7 @@ exclude = .venv,.tox,dist,doc,*egg,specs,build [testenv:docs] commands = rm -rf api-ref/build - python setup.py build_sphinx - sphinx-build -W -b html api-ref/source api-ref/build/html + sphinx-build -W -b html doc/source doc/build/html [testenv:api-ref] whitelist_externals = rm