Cleanup py27 support

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 apidoc instead of autodoc for API docs, use sphinx-build.

Change-Id: Ie6107bc80961a7306957b17ac2eda44417b53d3e
This commit is contained in:
Andreas Jaeger 2020-04-05 17:47:02 +02:00
parent f3b96dc3f8
commit a235a15346
8 changed files with 20 additions and 27 deletions

View File

@ -5,9 +5,10 @@
# Add any Sphinx extension module names here, as strings. They can be # Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom ones. # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
extensions = ['sphinx.ext.autodoc', extensions = [
'sphinx.ext.viewcode', 'sphinx.ext.viewcode',
'openstackdocstheme', 'openstackdocstheme',
'sphinxcontrib.apidoc'
] ]
wsme_protocols = ['restjson'] wsme_protocols = ['restjson']
@ -52,6 +53,14 @@ add_module_names = True
# The name of the Pygments (syntax highlighting) style to use. # The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx' pygments_style = 'sphinx'
# -- sphinxcontrib.apidoc configuration --------------------------------------
apidoc_module_dir = '../../ironic_lib'
apidoc_output_dir = 'reference/api'
apidoc_excluded_paths = [
'tests',
]
# -- Options for HTML output -------------------------------------------------- # -- Options for HTML output --------------------------------------------------
# The theme to use for HTML and HTML Help pages. Major themes that come with # The theme to use for HTML and HTML Help pages. Major themes that come with

View File

@ -5,4 +5,4 @@ Autogenerated API Reference
.. toctree:: .. toctree::
:maxdepth: 1 :maxdepth: 1
api/autoindex api/modules.rst

View File

@ -63,6 +63,7 @@ rfc3986==0.3.1
Routes==2.3.1 Routes==2.3.1
snowballstemmer==1.2.1 snowballstemmer==1.2.1
Sphinx==1.6.2 Sphinx==1.6.2
sphinxcontrib-apidoc==0.2.0
sphinxcontrib-websupport==1.0.1 sphinxcontrib-websupport==1.0.1
stestr==1.0.0 stestr==1.0.0
stevedore==1.20.0 stevedore==1.20.0

View File

@ -11,4 +11,4 @@ oslo.service!=1.28.1,>=1.24.0 # Apache-2.0
oslo.utils>=3.33.0 # Apache-2.0 oslo.utils>=3.33.0 # Apache-2.0
requests>=2.14.2 # Apache-2.0 requests>=2.14.2 # Apache-2.0
oslo.log>=3.36.0 # Apache-2.0 oslo.log>=3.36.0 # Apache-2.0
zeroconf>=0.24.0;python_version>='3.0' # LGPL zeroconf>=0.24.0 # LGPL

View File

@ -6,6 +6,7 @@ description-file =
author = OpenStack Ironic author = OpenStack Ironic
author-email = openstack-discuss@lists.openstack.org author-email = openstack-discuss@lists.openstack.org
home-page = https://docs.openstack.org/ironic-lib/ home-page = https://docs.openstack.org/ironic-lib/
python-requires = >=3.6
classifier = classifier =
Environment :: OpenStack Environment :: OpenStack
Intended Audience :: Information Technology Intended Audience :: Information Technology
@ -13,6 +14,8 @@ classifier =
License :: OSI Approved :: Apache Software License License :: OSI Approved :: Apache Software License
Operating System :: POSIX :: Linux Operating System :: POSIX :: Linux
Programming Language :: Python Programming Language :: Python
Programming Language :: Python :: Implementation :: CPython
Programming Language :: Python :: 3 :: Only
Programming Language :: Python :: 3 Programming Language :: Python :: 3
Programming Language :: Python :: 3.6 Programming Language :: Python :: 3.6
Programming Language :: Python :: 3.7 Programming Language :: Python :: 3.7
@ -32,16 +35,3 @@ oslo.config.opts =
ironic_lib.metrics = ironic_lib.metrics_utils:list_opts ironic_lib.metrics = ironic_lib.metrics_utils:list_opts
ironic_lib.metrics_statsd = ironic_lib.metrics_statsd:list_opts ironic_lib.metrics_statsd = ironic_lib.metrics_statsd:list_opts
ironic_lib.utils = ironic_lib.utils:list_opts ironic_lib.utils = ironic_lib.utils:list_opts
[pbr]
autodoc_index_modules = True
autodoc_exclude_modules =
ironic_lib.common.i18n
ironic_lib.tests.*
api_doc_dir = reference/api
[build_sphinx]
all_files = 1
build-dir = doc/build
source-dir = doc/source
warning-is-error = 1

View File

@ -13,17 +13,8 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
# THIS FILE IS MANAGED BY THE GLOBAL REQUIREMENTS REPO - DO NOT EDIT
import setuptools 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( setuptools.setup(
setup_requires=['pbr>=2.0.0'], setup_requires=['pbr>=2.0.0'],
pbr=True) pbr=True)

View File

@ -14,5 +14,6 @@ testtools>=2.2.0 # MIT
# Doc requirements # Doc requirements
doc8>=0.6.0 # Apache-2.0 doc8>=0.6.0 # Apache-2.0
sphinx!=1.6.6,!=1.6.7,>=1.6.2;python_version>='3.4' # BSD sphinx!=1.6.6,!=1.6.7,>=1.6.2 # BSD
openstackdocstheme>=1.20.0 # Apache-2.0 openstackdocstheme>=1.20.0 # Apache-2.0
sphinxcontrib-apidoc>=0.2.0 # BSD

View File

@ -58,7 +58,8 @@ setenv = PYTHONHASHSEED=0
sitepackages = False sitepackages = False
envdir = {toxworkdir}/venv envdir = {toxworkdir}/venv
commands = commands =
python setup.py build_sphinx sphinx-build -W -b html doc/source doc/build/html
[testenv:pdf-docs] [testenv:pdf-docs]
whitelist_externals = make whitelist_externals = make