From 1cf29b9d0dffbd2b82025f8a62e039fde793b911 Mon Sep 17 00:00:00 2001 From: Andreas Jaeger Date: Fri, 17 Apr 2020 20:23:21 +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 - Switch to using sphinx-build - Use newer openstackdocstheme and Sphinx versions - Cleanup */source/conf.py to remove now obsolete content. - Remove install_command from tox.ini, the default is fine - Remove mccabe from lower-constraints, we don't need it there, it is constrainted by hacking. - Add xml and xslt libs to bindep, these are needed for building some requirements Change-Id: Ia78b92c3b807623e70d85c3bce44e3b7011ca282 --- bindep.txt | 4 ++++ doc/requirements.txt | 4 ++-- lower-constraints.txt | 5 ++--- setup.cfg | 16 +++------------- setup.py | 9 --------- test-requirements.txt | 4 ++-- tox.ini | 4 ++-- 7 files changed, 15 insertions(+), 31 deletions(-) diff --git a/bindep.txt b/bindep.txt index 6eba0aa..49a67e1 100644 --- a/bindep.txt +++ b/bindep.txt @@ -5,3 +5,7 @@ libvirt-dev [platform:dpkg] python-libvirt [platform:dpkg] pkg-config [platform:dpkg] + +libxml2-dev [platform:dpkg test] +libxslt-devel [platform:rpm test] +libxslt1-dev [platform:dpkg test] diff --git a/doc/requirements.txt b/doc/requirements.txt index 9d92aff..97e24d5 100644 --- a/doc/requirements.txt +++ b/doc/requirements.txt @@ -1,8 +1,8 @@ # 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,>=1.6.2 # BSD -openstackdocstheme>=1.24.0 # Apache-2.0 +sphinx>=2.0.0,!=2.1.0 # BSD +openstackdocstheme>=2.0.0 # Apache-2.0 # releasenotes reno>=2.5.0 # Apache-2.0 diff --git a/lower-constraints.txt b/lower-constraints.txt index baf09ed..6f91b44 100644 --- a/lower-constraints.txt +++ b/lower-constraints.txt @@ -35,7 +35,6 @@ keystoneauth1==3.4.0 libvirt-python==3.5.0 linecache2==1.0.0 MarkupSafe==1.0 -mccabe==0.2.1 mock==2.0.0 monotonic==1.4 mox3==0.25.0 @@ -44,6 +43,7 @@ munch==2.2.0 netaddr==0.7.19 netifaces==0.10.6 lxml==3.4.1 +openstackdocstheme==2.0.0 openstacksdk==0.13.0 os-client-config==1.29.0 os-service-types==1.2.0 @@ -60,7 +60,6 @@ oslo.privsep==1.23.0 oslo.serialization==2.25.0 oslo.service==1.24.0 oslo.utils==3.33.0 -oslosphinx==4.7.0 oslotest==3.2.0 packaging==17.1 Paste==2.0.3 @@ -92,7 +91,7 @@ Routes==2.4.1 simplejson==3.13.2 six==1.10.0 snowballstemmer==1.2.1 -Sphinx==1.6.2 +Sphinx==2.0.0 sphinxcontrib-websupport==1.0.1 statsd==3.2.2 stestr==2.0.0 diff --git a/setup.cfg b/setup.cfg index d843c3a..0ecb998 100644 --- a/setup.cfg +++ b/setup.cfg @@ -6,6 +6,7 @@ description-file = author = OpenStack author-email = openstack-dev@lists.openstack.org home-page = http://www.openstack.org/ +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 @@ -41,14 +44,6 @@ hostmonitor.driver = simple = masakarimonitors.hostmonitor.host_handler.handle_host:HandleHost default = masakarimonitors.hostmonitor.host_handler.handle_host:HandleHost -[build_sphinx] -source-dir = doc/source -build-dir = doc/build -all_files = 1 - -[upload_sphinx] -upload-dir = doc/build/html - [compile_catalog] directory = masakarimonitors/locale domain = masakarimonitors @@ -62,8 +57,3 @@ input_file = masakarimonitors/locale/masakarimonitors.pot keywords = _ gettext ngettext l_ lazy_gettext mapping_file = babel.cfg output_file = masakarimonitors/locale/masakarimonitors.pot - -[build_releasenotes] -all_files = 1 -build-dir = releasenotes/build -source-dir = releasenotes/source 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 6f59c5e..354ec47 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -6,8 +6,8 @@ hacking>=3.0,<3.1.0 # Apache-2.0 coverage!=4.4,>=4.0 # Apache-2.0 python-subunit>=1.0.0 # Apache-2.0/BSD -sphinx!=1.6.6,!=1.6.7,>=1.6.2 # BSD -oslosphinx>=4.7.0 # Apache-2.0 +sphinx>=2.0.0,!=2.1.0 # BSD +openstackdocstheme>=2.0.0 # Apache-2.0 oslotest>=3.2.0 # Apache-2.0 os-testr>=1.0.0 # Apache-2.0 testrepository>=0.0.18 # Apache-2.0/BSD diff --git a/tox.ini b/tox.ini index 9d7589a..d350bd0 100644 --- a/tox.ini +++ b/tox.ini @@ -58,10 +58,10 @@ commands = [testenv:docs] deps = -r{toxinidir}/doc/requirements.txt -commands = python setup.py build_sphinx +commands = sphinx-build -W -b html doc/source doc/build/html [testenv:releasenotes] -deps = -r{toxinidir}/doc/requirements.txt +deps = {[testenv:docs]deps} commands = rm -fr releasenotes/build sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html