Cleanup py27 support

This repo is now testing only with Python 3, so let's make
a few cleanups:
- Remove obsolete sections from setup.cfg
- Use newer openstackdocstheme and Sphinx versions for Python3
- Cleanup */source/conf.py to remove now obsolete content.
- Remove install_command from tox.ini, the default is fine
- Move python3 to testenv in tox.ini
- Switch to hacking 3, fix problems found.

Change-Id: I26fcab3b288b5ed64c74f7a6725b43036f195d44
This commit is contained in:
Andreas Jaeger 2020-04-17 17:31:14 +02:00
parent 727f643551
commit 7931f9818d
9 changed files with 17 additions and 37 deletions

View File

@ -135,7 +135,7 @@ class ExtraATCsTable(tables.Table):
return table
_PATTERN = re.compile('(?P<project>.+):\s+(?P<name>.+)\s\((?P<email>.+)\)\s\[(?P<expires_in>.*)\]')
_PATTERN = re.compile(r'(?P<project>.+):\s+(?P<name>.+)\s\((?P<email>.+)\)\s\[(?P<expires_in>.*)\]')
def setup(app):

View File

@ -41,7 +41,7 @@ def _get_last_updated_file(src_file):
try:
return datetime.datetime.strptime(last_updated_t,
'%Y-%m-%d %H:%M:%S')
except ValueError as err:
except ValueError:
LOG.info('[governance] Could not parse modification time of '
'%s: %r',
src_file, last_updated_t)

View File

@ -79,12 +79,12 @@ class TaggedProjectsDirective(rst.Directive):
def _build_projects_by_tag():
for proj_name, info in projects.get_project_data().items():
for tag in info.get('tags', []):
l = _projects_by_tag.setdefault(tag, [])
l.append((proj_name, None))
li = _projects_by_tag.setdefault(tag, [])
li.append((proj_name, None))
for name, deliverable in info.get('deliverables', {}).items():
for tag in deliverable.get('tags', []):
l = _projects_by_tag.setdefault(tag, [])
l.append((proj_name, name))
li = _projects_by_tag.setdefault(tag, [])
li.append((proj_name, name))
def setup(app):

View File

@ -14,7 +14,6 @@
# flake8: noqa
import datetime
import subprocess
import sys
import os
@ -142,10 +141,6 @@ html_static_path = ['_static']
html_extra_path = ['_extra']
# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
# using the given strftime format.
html_last_updated_fmt = '%Y-%m-%d'
# If true, SmartyPants will be used to convert quotes and dashes to
# typographically correct entities.
#html_use_smartypants = True

View File

@ -12,15 +12,6 @@ home-page = http://www.openstack.org/
packages =
openstack_governance
[build_sphinx]
all_files = 1
build-dir = doc/build
source-dir = doc/source
warning-is-error = 1
[pbr]
warnerrors = True
[flake8]
ignore = E501,E226,H405

View File

@ -1,12 +1,12 @@
# needed for doc build
docutils>=0.11,!=0.13.1 # OSI-Approved Open Source, Public Domain
openstackdocstheme>=1.25.0 # Apache 2.0
sphinx!=1.6.6,!=1.6.7,!=2.1.0,>=1.6.2
openstackdocstheme>=2.0.0 # Apache 2.0
sphinx!=2.1.0,>=2.0
PyYAML>=3.1.0
yamllint>=0.5.2
requests-cache
Pillow>=2.4.0 # PIL License
hacking!=0.13.0,<0.14,>=0.12.0 # Apache-2.0
hacking>=3.0,<3.1.0 # Apache-2.0
whereto>=0.3.0 # Apache-2.0
fixtures>=3.0.0 # Apache-2.0/BSD
@ -17,6 +17,3 @@ testtools>=1.4.0 # MIT
oslotest>=1.10.0 # Apache-2.0
coverage>=4.0 # Apache-2.0
# mocking framework
mock>=2.0 # BSD

View File

@ -88,5 +88,6 @@ def main():
projects.write_project_file(project_data, args.projects_file)
if __name__ == '__main__':
main()

View File

@ -41,13 +41,14 @@ Then open os_universe.svg in your favorite web browser.
import sys
import time
import pydot
import six
import yaml
if len(sys.argv) == 1:
print(__doc__.strip())
sys.exit(1)
import pydot
import six
import yaml
projects_file = sys.argv[1]
output_dot_file = sys.argv[2]

11
tox.ini
View File

@ -1,11 +1,12 @@
[tox]
envlist = docs,linters
minversion = 1.6
minversion = 3.1.1
skipsdist = True
ignore_basepython_conflict = True
[testenv]
usedevelop = True
install_command = pip install -U {opts} {packages}
basepython = python3
setenv =
VIRTUAL_ENV={envdir}
PYTHON=coverage run --source openstack_governance --parallel-mode
@ -38,28 +39,22 @@ commands =
{toxinidir}/tools/validate_repositories.py
[testenv:validate_atcs]
basepython = python3
commands = {toxinidir}/tools/validate_atcs.py
[testenv:pep8]
basepython = python3
commands =
flake8
[testenv:venv]
basepython = python3
commands = {posargs}
[testenv:docs]
basepython = python3
commands = sphinx-build -W -b html doc/source doc/build/html
[testenv:validate]
basepython = python3
commands = python3 tools/validate_tags.py
[testenv:check-review-status]
basepython = python3
deps =
requests
prettytable