Drop python 2.7 support and testing

Ussuri Communtiy-wide goal:
https://governance.openstack.org/tc/goals/selected/ussuri/drop-py27.html

Include small cleanups:
* remove install_command from tox.ini, this is the default
* Use sphinx-build as modern way to run sphinx, remove setup.cfg
  settings for build-sphinx
* Use sphinxcontrib-apidoc for docs with newer sphinx
* Remove obsolete doc/source/conf.py broken
* Add python-requires to setup.cfg to make Python 3.6 requirement
  explicit
* Remove obsolete pbr setup-hooks

Co-Authored-By: Andreas Jaeger <aj@suse.com>
Change-Id: Iec8c47b82022b616b8361651bf23f853b0ce5624
This commit is contained in:
pengyuesheng 2019-12-25 17:37:09 +08:00 committed by Andreas Jaeger
parent 9d1c08e1f2
commit 939253044a
7 changed files with 26 additions and 35 deletions

View File

@ -1,10 +1,8 @@
- project: - project:
templates: templates:
- check-requirements - check-requirements
- lib-forward-testing
- lib-forward-testing-python3 - lib-forward-testing-python3
- openstack-cover-jobs - openstack-cover-jobs
- openstack-lower-constraints-jobs - openstack-lower-constraints-jobs
- openstack-python-jobs
- openstack-python3-ussuri-jobs - openstack-python3-ussuri-jobs
- publish-openstack-docs-pti - publish-openstack-docs-pti

View File

@ -29,6 +29,7 @@ os.environ['DJANGO_SETTINGS_MODULE'] = 'openstack_dashboard.settings'
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones. # coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
extensions = [ extensions = [
'sphinx.ext.autodoc', 'sphinx.ext.autodoc',
'sphinxcontrib.apidoc',
#'sphinx.ext.intersphinx', #'sphinx.ext.intersphinx',
'sphinx.ext.todo', 'sphinx.ext.todo',
'sphinx.ext.coverage', 'sphinx.ext.coverage',
@ -57,9 +58,9 @@ copyright = u'2014, OpenStack Foundation'
# built documents. # built documents.
# #
# The short X.Y version. # The short X.Y version.
version = '1.0' # version = '1.0'
# The full version, including alpha/beta/rc tags. # The full version, including alpha/beta/rc tags.
release = '1.0' # release = '1.0'
# The language for content autogenerated by Sphinx. Refer to documentation # The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages. # for a list of supported languages.
@ -140,7 +141,7 @@ html_theme_options = {
# If not '', a 'Last updated on:' timestamp is inserted at every page bottom, # If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
# using the given strftime format. # using the given strftime format.
#html_last_updated_fmt = '%b %d, %Y' #html_last_updated_fmt = '%b %d, %Y'
html_last_updated_fmt = '%Y-%m-%d %H:%M' # html_last_updated_fmt = '%Y-%m-%d %H:%M'
# If true, SmartyPants will be used to convert quotes and dashes to # If true, SmartyPants will be used to convert quotes and dashes to
# typographically correct entities. # typographically correct entities.
@ -182,6 +183,11 @@ html_last_updated_fmt = '%Y-%m-%d %H:%M'
# Output file base name for HTML help builder. # Output file base name for HTML help builder.
htmlhelp_basename = 'pyCADFdoc' htmlhelp_basename = 'pyCADFdoc'
apidoc_module_dir = '../../pycadf'
apidoc_output_dir = 'api'
apidoc_excluded_paths = [
'tests',
]
# -- Options for LaTeX output -------------------------------------------------- # -- Options for LaTeX output --------------------------------------------------

View File

@ -46,6 +46,7 @@ rfc3986==0.3.1
six==1.10.0 six==1.10.0
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
stevedore==1.20.0 stevedore==1.20.0
stestr==2.0.0 stestr==2.0.0

View File

@ -0,0 +1,5 @@
---
upgrade:
- |
Python 2.7 support has been dropped. The minimum version of Python now
supported by pycadf is Python 3.6.

View File

@ -6,6 +6,7 @@ summary = CADF Library
description-file = description-file =
README.rst README.rst
home-page = https://docs.openstack.org/pycadf/latest/ home-page = https://docs.openstack.org/pycadf/latest/
python-requires = >=3.6
classifier = classifier =
Development Status :: 3 - Alpha Development Status :: 3 - Alpha
Environment :: OpenStack Environment :: OpenStack
@ -14,8 +15,6 @@ classifier =
License :: OSI Approved :: Apache Software License License :: OSI Approved :: Apache Software License
Operating System :: OS Independent Operating System :: OS Independent
Programming Language :: Python Programming Language :: Python
Programming Language :: Python :: 2
Programming Language :: Python :: 2.7
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,21 +31,3 @@ data_files =
etc/pycadf/trove_api_audit_map.conf etc/pycadf/trove_api_audit_map.conf
etc/pycadf/ceilometer_api_audit_map.conf etc/pycadf/ceilometer_api_audit_map.conf
etc/pycadf/swift_api_audit_map.conf etc/pycadf/swift_api_audit_map.conf
[global]
setup-hooks =
pbr.hooks.setup_hook
[build_sphinx]
source-dir = doc/source
build-dir = doc/build
all_files = 1
warning-is-error = 1
[upload_sphinx]
upload-dir = doc/build/html
[pbr]
warnerrors = True
autodoc_tree_index_modules = True
autodoc_tree_root = ./pycadf

View File

@ -15,3 +15,4 @@ testtools>=2.2.0 # MIT
# this is required for the docs build jobs # this is required for the docs build jobs
openstackdocstheme>=1.18.1 # Apache-2.0 openstackdocstheme>=1.18.1 # Apache-2.0
sphinx!=1.6.6,!=1.6.7,>=1.6.2 # BSD sphinx!=1.6.6,!=1.6.7,>=1.6.2 # BSD
sphinxcontrib-apidoc>=0.2.0 # BSD

19
tox.ini
View File

@ -1,9 +1,10 @@
[tox] [tox]
minversion = 2.0 minversion = 3.1.1
envlist = py27,py37,pep8 envlist = py37,pep8
ignore_basepython_conflict = True
[testenv] [testenv]
install_command = pip install {opts} {packages} basepython = python3
deps = deps =
-c{env:UPPER_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master} -c{env:UPPER_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
-r{toxinidir}/test-requirements.txt -r{toxinidir}/test-requirements.txt
@ -11,15 +12,16 @@ deps =
commands = stestr run --slowest {posargs} commands = stestr run --slowest {posargs}
[testenv:pep8] [testenv:pep8]
basepython = python3
commands = flake8 commands = flake8
[testenv:docs] [testenv:docs]
basepython = python3 whitelist_externals =
commands = python setup.py build_sphinx rm
commands =
rm -rf doc/build/html doc/build/doctrees
sphinx-build -W --keep-going -b html -d doc/build/doctrees doc/source doc/build/html
[testenv:cover] [testenv:cover]
basepython = python3
setenv = setenv =
PYTHON=coverage run --source pycadf --parallel-mode PYTHON=coverage run --source pycadf --parallel-mode
commands = commands =
@ -29,11 +31,9 @@ commands =
coverage xml -o cover/coverage.xml coverage xml -o cover/coverage.xml
[testenv:venv] [testenv:venv]
basepython = python3
commands = {posargs} commands = {posargs}
[testenv:debug] [testenv:debug]
basepython = python3
commands = oslo_debug_helper {posargs} commands = oslo_debug_helper {posargs}
[flake8] [flake8]
@ -58,7 +58,6 @@ ignore = H405,D100,D101,D102,D103,D104,D105,D200,D202,D203,D204,D205,D208,D400,D
exclude = .tox,dist,doc,*.egg,build exclude = .tox,dist,doc,*.egg,build
[testenv:lower-constraints] [testenv:lower-constraints]
basepython = python3
deps = deps =
-c{toxinidir}/lower-constraints.txt -c{toxinidir}/lower-constraints.txt
-r{toxinidir}/test-requirements.txt -r{toxinidir}/test-requirements.txt