Cleanup py27 and docs 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
- Remove obsolete sections from setup.cfg
- Update classifiers
- Update requirements, no need for python_version anymore
- Cleanup doc/source/conf.py to remove now obsolete content,
  use sphinxcontrib.apidoc to build module index again (this
  seems to have been broken when switching to sphinx-build).
- Remove install_command from tox.ini, the default is fine
- Use TOX_CONSTRAINTS_FILE instead of obsolete UPPER_CONSTRAINTS_FILE.
- Update tox.ini for python3 only support.

Change-Id: Id8738ecfb0f578d2a7953c63ffe10779f835bcaf
This commit is contained in:
Andreas Jaeger 2020-06-05 09:51:28 +02:00
parent 7c73557d72
commit e7885499dd
9 changed files with 36 additions and 58 deletions

1
.gitignore vendored
View File

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

View File

@ -3,6 +3,6 @@
# process, which may cause wedges in the gate later.
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;python_version>='3.4' # BSD
sphinx!=1.6.6,!=1.6.7,!=2.1.0,>=1.6.2 # BSD
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
# ones.
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.
templates_path = ['_templates']
@ -29,18 +33,6 @@ bug_project = 'diskimage-builder'
bug_tag = ''
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
# 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.
#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
stable_interfaces
vhd_creation
Module index <api/modules>
This documentation explains how to get started with creating your own
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
:ref:`modindex`
:ref:`modindex`.
Finding Work
@ -48,5 +49,5 @@ Finding Work
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
# of appearance. Changing the order has an impact on the overall integration
# 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;python_version>='3.4' # BSD
networkx>=1.10 # BSD
pbr!=2.1.0,>=2.0.0 # Apache-2.0
PyYAML>=3.12 # MIT
six>=1.10.0 # MIT

View File

@ -15,26 +15,10 @@ classifier =
Programming Language :: Python :: 3.5
Programming Language :: Python :: 3.6
Programming Language :: Python :: 3.7
Programming Language :: Python :: 3.8
Environment :: Console
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]
packages =
diskimage_builder

View File

@ -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)

View File

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

18
tox.ini
View File

@ -1,13 +1,14 @@
[tox]
envlist = pep8,pylint,py35,py36,py37,py38
minversion = 2.0
minversion = 3.1.1
skipsdist = True
ignore_basepython_conflict = True
[testenv]
usedevelop = True
install_command = pip install {opts} {packages}
basepython = python3
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}/test-requirements.txt
commands=
@ -20,17 +21,14 @@ deps = bindep
commands = bindep test
[testenv:pep8]
basepython = python3
commands =
flake8 {posargs}
dib-lint
[testenv:pylint]
basepython = python3
commands = pylint --rcfile pylint.cfg diskimage_builder
[testenv:venv]
basepython = python3
commands = {posargs}
[testenv:func]
@ -45,7 +43,11 @@ basepython = python3
commands = python setup.py test --coverage --coverage-package-name diskimage_builder --testr-args='{posargs}'
[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
whitelist_externals =
rm
@ -55,7 +57,6 @@ commands =
[testenv:releasenotes]
deps = {[testenv:docs]deps}
basepython = python3
commands = sphinx-build -a -W -E -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
[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
[testenv:lower-constraints]
basepython = python3
deps =
-c{toxinidir}/lower-constraints.txt
-r{toxinidir}/test-requirements.txt