Merge "Cleanup py27 and docs support"

This commit is contained in:
Zuul 2020-06-09 05:56:17 +00:00 committed by Gerrit Code Review
commit 1a95c3f93f
9 changed files with 36 additions and 58 deletions

1
.gitignore vendored
View File

@ -1,6 +1,7 @@
.coverage .coverage
coverage.xml coverage.xml
cover/* cover/*
doc/source/developer/api/
*~ *~
.testrepository .testrepository
*.sw? *.sw?

View File

@ -3,6 +3,6 @@
# process, which may cause wedges in the gate later. # process, which may cause wedges in the gate later.
openstackdocstheme>=1.18.1 # Apache-2.0 openstackdocstheme>=1.18.1 # Apache-2.0
sphinx!=1.6.6,!=1.6.7,>=1.6.2,<2.0.0;python_version=='2.7' # BSD sphinx!=1.6.6,!=1.6.7,!=2.1.0,>=1.6.2 # BSD
sphinx!=1.6.6,!=1.6.7,!=2.1.0,>=1.6.2;python_version>='3.4' # BSD
reno>=2.5.0 # Apache-2.0 reno>=2.5.0 # Apache-2.0
sphinxcontrib-apidoc>=0.2.0 # BSD

View File

@ -5,7 +5,11 @@ import os
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones. # ones.
sys.path.append(os.path.abspath('../lib')) sys.path.append(os.path.abspath('../lib'))
extensions = ['openstackdocstheme', 'element_deps', 'sphinx.ext.autodoc'] extensions = ['openstackdocstheme',
'element_deps',
'sphinx.ext.autodoc',
'sphinxcontrib.apidoc'
]
# Add any paths that contain templates here, relative to this directory. # Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates'] templates_path = ['_templates']
@ -29,18 +33,6 @@ bug_project = 'diskimage-builder'
bug_tag = '' bug_tag = ''
html_last_updated_fmt = '%Y-%m-%d %H:%M' html_last_updated_fmt = '%Y-%m-%d %H:%M'
# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
import pbr.version
version_info = pbr.version.VersionInfo('diskimage-builder')
# The short X.Y version.
release = version_info.release_string()
# The full version, including alpha/beta/rc tags.
version = version_info.version_string()
# 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.
@ -244,3 +236,14 @@ texinfo_documents = [
# If true, do not generate a @detailmenu in the "Top" node's menu. # If true, do not generate a @detailmenu in the "Top" node's menu.
#texinfo_no_detailmenu = False #texinfo_no_detailmenu = False
# -- sphinxcontrib.apidoc configuration --------------------------------------
apidoc_module_dir = '../../diskimage_builder'
apidoc_output_dir = 'developer/api'
apidoc_excluded_paths = [
'tests',
'block_device.tests',
'elements',
'lib',
]

View File

@ -12,6 +12,7 @@ Developer Guide
dib_lint dib_lint
stable_interfaces stable_interfaces
vhd_creation vhd_creation
Module index <api/modules>
This documentation explains how to get started with creating your own This documentation explains how to get started with creating your own
disk-image-builder elements as well as some high level concepts for element disk-image-builder elements as well as some high level concepts for element
@ -40,7 +41,7 @@ Python module documentation
--------------------------- ---------------------------
For internal documentation on the DIB python components, see the For internal documentation on the DIB python components, see the
:ref:`modindex` :ref:`modindex`.
Finding Work Finding Work
@ -48,5 +49,5 @@ Finding Work
We maintain a list of low-hanging-fruit tags on launchpad: We maintain a list of low-hanging-fruit tags on launchpad:
* `https://bugs.launchpad.net/diskimage-builder/+bugs?field.tag=low-hanging-fruit` * `https://bugs.launchpad.net/diskimage-builder/+bugs?field.tag=low-hanging-fruit
<https://bugs.launchpad.net/diskimage-builder/+bugs?field.tag=low-hanging-fruit> <https://bugs.launchpad.net/diskimage-builder/+bugs?field.tag=low-hanging-fruit>`_

View File

@ -1,9 +1,8 @@
# The order of packages is significant, because pip processes them in the order # 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 # of appearance. Changing the order has an impact on the overall integration
# process, which may cause wedges in the gate later. # process, which may cause wedges in the gate later.
# NOTE(fdegir): NetworkX 2.3 dropped support for Python 2
networkx>=1.10,<2.3;python_version<'3.0' # BSD networkx>=1.10 # BSD
networkx>=1.10;python_version>='3.4' # BSD
pbr!=2.1.0,>=2.0.0 # Apache-2.0 pbr!=2.1.0,>=2.0.0 # Apache-2.0
PyYAML>=3.12 # MIT PyYAML>=3.12 # MIT
six>=1.10.0 # MIT six>=1.10.0 # MIT

View File

@ -15,26 +15,10 @@ classifier =
Programming Language :: Python :: 3.5 Programming Language :: Python :: 3.5
Programming Language :: Python :: 3.6 Programming Language :: Python :: 3.6
Programming Language :: Python :: 3.7 Programming Language :: Python :: 3.7
Programming Language :: Python :: 3.8
Environment :: Console Environment :: Console
python-requires = >=3.5 python-requires = >=3.5
[build_sphinx]
all_files = 1
build-dir = doc/build
source-dir = doc/source
warning-is-error = 1
[pbr]
autodoc_index_modules = 1
autodoc_exclude_modules =
setup.py
diskimage_builder.tests.*
diskimage_builder.block_device.tests.*
# elements are a weird mix of scripts & python
diskimage_builder.elements.*
# this is non-pythony stuff
diskimage_builder.lib.*
[files] [files]
packages = packages =
diskimage_builder diskimage_builder

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

@ -2,8 +2,7 @@
# of appearance. Changing the order has an impact on the overall integration # of appearance. Changing the order has an impact on the overall integration
# process, which may cause wedges in the gate later. # process, which may cause wedges in the gate later.
pylint==1.7.6;python_version=='2.7' # GPLv2 pylint>=1.7.1 #GPLv2
pylint;python_version>'3.0' #GPLv2
fixtures>=3.0.0 # Apache-2.0/BSD fixtures>=3.0.0 # Apache-2.0/BSD
mock>=2.0.0 # BSD mock>=2.0.0 # BSD

18
tox.ini
View File

@ -1,13 +1,14 @@
[tox] [tox]
envlist = pep8,pylint,py35,py36,py37,py38 envlist = pep8,pylint,py35,py36,py37,py38
minversion = 2.0 minversion = 3.1.1
skipsdist = True skipsdist = True
ignore_basepython_conflict = True
[testenv] [testenv]
usedevelop = True usedevelop = True
install_command = pip install {opts} {packages} basepython = python3
deps= deps=
-c{env:UPPER_CONSTRAINTS_FILE:https://opendev.org/openstack/requirements/raw/branch/master/upper-constraints.txt} -c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
-r{toxinidir}/requirements.txt -r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt -r{toxinidir}/test-requirements.txt
commands= commands=
@ -20,17 +21,14 @@ deps = bindep
commands = bindep test commands = bindep test
[testenv:pep8] [testenv:pep8]
basepython = python3
commands = commands =
flake8 {posargs} flake8 {posargs}
dib-lint dib-lint
[testenv:pylint] [testenv:pylint]
basepython = python3
commands = pylint --rcfile pylint.cfg diskimage_builder commands = pylint --rcfile pylint.cfg diskimage_builder
[testenv:venv] [testenv:venv]
basepython = python3
commands = {posargs} commands = {posargs}
[testenv:func] [testenv:func]
@ -45,7 +43,11 @@ basepython = python3
commands = python setup.py test --coverage --coverage-package-name diskimage_builder --testr-args='{posargs}' commands = python setup.py test --coverage --coverage-package-name diskimage_builder --testr-args='{posargs}'
[testenv:docs] [testenv:docs]
deps= -r{toxinidir}/doc/requirements.txt deps=
-c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
-r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
-r{toxinidir}/doc/requirements.txt
basepython = python3 basepython = python3
whitelist_externals = whitelist_externals =
rm rm
@ -55,7 +57,6 @@ commands =
[testenv:releasenotes] [testenv:releasenotes]
deps = {[testenv:docs]deps} deps = {[testenv:docs]deps}
basepython = python3
commands = sphinx-build -a -W -E -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html commands = sphinx-build -a -W -E -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
[flake8] [flake8]
@ -63,7 +64,6 @@ ignore = E125,E126,E127,H202,H803,W503,W504
exclude = .venv,.git,.tox,dist,doc/build,doc/source,*lib/python*,*egg,build,conf.py exclude = .venv,.git,.tox,dist,doc/build,doc/source,*lib/python*,*egg,build,conf.py
[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