summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore2
-rw-r--r--.pre-commit-config.yaml39
-rw-r--r--.zuul.yaml3
-rw-r--r--[-rwxr-xr-x]doc/source/conf.py5
-rw-r--r--doc/source/configuration/index.rst6
-rw-r--r--lower-constraints.txt43
-rw-r--r--oslo_middleware/tests/test_catch_errors.py2
-rw-r--r--releasenotes/source/conf.py10
-rw-r--r--releasenotes/source/index.rst1
-rw-r--r--releasenotes/source/wallaby.rst6
-rw-r--r--test-requirements.txt2
-rw-r--r--tox.ini12
12 files changed, 66 insertions, 65 deletions
diff --git a/.gitignore b/.gitignore
index ef39dd9..034ae82 100644
--- a/.gitignore
+++ b/.gitignore
@@ -56,3 +56,5 @@ ChangeLog
# reno build
releasenotes/build
+RELEASENOTES.rst
+releasenotes/notes/reno.cache
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
new file mode 100644
index 0000000..66a040f
--- /dev/null
+++ b/.pre-commit-config.yaml
@@ -0,0 +1,39 @@
+# We from the Oslo project decided to pin repos based on the
+# commit hash instead of the version tag to prevend arbitrary
+# code from running in developer's machines. To update to a
+# newer version, run `pre-commit autoupdate` and then replace
+# the newer versions with their commit hash.
+
+default_language_version:
+ python: python3
+
+repos:
+ - repo: https://github.com/pre-commit/pre-commit-hooks
+ rev: ebc15addedad713c86ef18ae9632c88e187dd0af # v3.1.0
+ hooks:
+ - id: trailing-whitespace
+ # Replaces or checks mixed line ending
+ - id: mixed-line-ending
+ args: ['--fix', 'lf']
+ exclude: '.*\.(svg)$'
+ # Forbid files which have a UTF-8 byte-order marker
+ - id: check-byte-order-marker
+ # Checks that non-binary executables have a proper shebang
+ - id: check-executables-have-shebangs
+ # Check for files that contain merge conflict strings.
+ - id: check-merge-conflict
+ # Check for debugger imports and py37+ breakpoint()
+ # calls in python source
+ - id: debug-statements
+ - id: check-yaml
+ files: .*\.(yaml|yml)$
+ - repo: local
+ hooks:
+ - id: flake8
+ name: flake8
+ additional_dependencies:
+ - hacking>=3.0.1,<3.1.0
+ language: python
+ entry: flake8
+ files: '^.*\.py$'
+ exclude: '^(doc|releasenotes|tools)/.*$'
diff --git a/.zuul.yaml b/.zuul.yaml
index 1155b74..84bb45c 100644
--- a/.zuul.yaml
+++ b/.zuul.yaml
@@ -2,8 +2,7 @@
templates:
- check-requirements
- lib-forward-testing-python3
- - openstack-lower-constraints-jobs
- - openstack-python3-wallaby-jobs
+ - openstack-python3-xena-jobs
- periodic-stable-jobs
- publish-openstack-docs-pti
- release-notes-jobs-python3
diff --git a/doc/source/conf.py b/doc/source/conf.py
index faff562..78393ca 100755..100644
--- a/doc/source/conf.py
+++ b/doc/source/conf.py
@@ -1,4 +1,6 @@
# -*- coding: utf-8 -*-
+# Copyright (C) 2020 Red Hat, Inc.
+#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
@@ -22,7 +24,6 @@ sys.path.insert(0, os.path.abspath('../..'))
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
extensions = [
'sphinx.ext.autodoc',
- #'sphinx.ext.intersphinx',
'oslo_config.sphinxext',
'openstackdocstheme',
'stevedore.sphinxext',
@@ -44,7 +45,7 @@ source_suffix = '.rst'
master_doc = 'index'
# General information about the project.
-copyright = u'2014, OpenStack Foundation'
+copyright = '2014, OpenStack Foundation'
# If true, '()' will be appended to :func: etc. cross-reference text.
add_function_parentheses = True
diff --git a/doc/source/configuration/index.rst b/doc/source/configuration/index.rst
index 6ca076e..0a2a4ec 100644
--- a/doc/source/configuration/index.rst
+++ b/doc/source/configuration/index.rst
@@ -3,7 +3,7 @@ Middlewares and configuration
=============================
Middlewares can be configured in multiple fashion depending of the
-application needs. Here is some use-cases:
+application needs. Here is some use-cases:
Configuration from the application
----------------------------------
@@ -24,8 +24,8 @@ The paste filter (in /etc/my_app/api-paste.ini) will looks like::
[filter:sizelimit]
use = egg:oslo.middleware#sizelimit
- # In case of the application doesn't use the global oslo.config
- # object. The middleware must known the app name to load
+ # In case of the application doesn't use the global oslo.config
+ # object. The middleware must known the app name to load
# the application configuration, by setting this:
# oslo_config_project = my_app
diff --git a/lower-constraints.txt b/lower-constraints.txt
deleted file mode 100644
index c9cfdfe..0000000
--- a/lower-constraints.txt
+++ /dev/null
@@ -1,43 +0,0 @@
-appdirs==1.3.0
-Babel==2.3.4
-bandit==1.4.0
-coverage==4.0
-debtcollector==1.2.0
-extras==1.0.0
-fixtures==3.0.0
-gitdb==0.6.4
-GitPython==1.0.1
-iso8601==0.1.11
-Jinja2==2.10
-keystoneauth1==3.4.0
-linecache2==1.0.0
-MarkupSafe==1.0
-mox3==0.20.0
-msgpack-python==0.4.0
-netaddr==0.7.18
-netifaces==0.10.4
-os-client-config==1.28.0
-oslo.config==5.2.0
-oslo.context==2.19.2
-oslo.i18n==3.15.3
-oslo.serialization==2.18.0
-oslo.utils==3.33.0
-oslotest==3.2.0
-pbr==2.0.0
-pyparsing==2.1.0
-python-mimeparse==1.6.0
-python-subunit==1.0.0
-pytz==2013.6
-PyYAML==3.12
-requests==2.14.2
-requestsexceptions==1.2.0
-rfc3986==0.3.1
-smmap==0.9.0
-statsd==3.2.1
-stestr==2.0.0
-stevedore==1.20.0
-testtools==2.2.0
-traceback2==1.4.0
-unittest2==1.1.0
-WebOb==1.8.0
-wrapt==1.7.0
diff --git a/oslo_middleware/tests/test_catch_errors.py b/oslo_middleware/tests/test_catch_errors.py
index fa6d518..5719847 100644
--- a/oslo_middleware/tests/test_catch_errors.py
+++ b/oslo_middleware/tests/test_catch_errors.py
@@ -60,7 +60,7 @@ class CatchErrorsTest(test_base.BaseTestCase):
app = catch_errors.CatchErrors(application)
req = webob.Request.blank('/test',
- text=u'test data',
+ text='test data',
method='POST',
headers={'X-Auth-Token': 'secret1',
'X-Service-Token': 'secret2',
diff --git a/releasenotes/source/conf.py b/releasenotes/source/conf.py
index b2b8d43..2d5b578 100644
--- a/releasenotes/source/conf.py
+++ b/releasenotes/source/conf.py
@@ -56,7 +56,7 @@ source_suffix = '.rst'
master_doc = 'index'
# General information about the project.
-copyright = u'2016, oslo.middleware Developers'
+copyright = '2016, oslo.middleware Developers'
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
@@ -181,8 +181,8 @@ html_static_path = ['_static']
# (source start file, name, description, authors, manual section).
man_pages = [
('index', 'oslo.middlewareReleaseNotes',
- u'oslo.middleware Release Notes Documentation',
- [u'oslo.middleware Developers'], 1)
+ 'oslo.middleware Release Notes Documentation',
+ ['oslo.middleware Developers'], 1)
]
# If true, show URL addresses after external links.
@@ -196,8 +196,8 @@ man_pages = [
# dir menu entry, description, category)
texinfo_documents = [
('index', 'oslo.middlewareReleaseNotes',
- u'oslo.middleware Release Notes Documentation',
- u'oslo.middleware Developers', 'oslo.middlewareReleaseNotes',
+ 'oslo.middleware Release Notes Documentation',
+ 'oslo.middleware Developers', 'oslo.middlewareReleaseNotes',
'The library includes components that can be injected into wsgi pipelines'
' to intercept request/response flows.',
'Miscellaneous'),
diff --git a/releasenotes/source/index.rst b/releasenotes/source/index.rst
index 5d06a46..59a6c18 100644
--- a/releasenotes/source/index.rst
+++ b/releasenotes/source/index.rst
@@ -6,6 +6,7 @@ oslo.middleware Release Notes
:maxdepth: 1
unreleased
+ wallaby
victoria
ussuri
train
diff --git a/releasenotes/source/wallaby.rst b/releasenotes/source/wallaby.rst
new file mode 100644
index 0000000..d77b565
--- /dev/null
+++ b/releasenotes/source/wallaby.rst
@@ -0,0 +1,6 @@
+============================
+Wallaby Series Release Notes
+============================
+
+.. release-notes::
+ :branch: stable/wallaby
diff --git a/test-requirements.txt b/test-requirements.txt
index 33ecb80..de498fc 100644
--- a/test-requirements.txt
+++ b/test-requirements.txt
@@ -11,3 +11,5 @@ oslo.serialization!=2.19.1,>=2.18.0 # Apache-2.0
# Bandit security code scanner
bandit>=1.6.0,<1.7.0 # Apache-2.0
stestr>=2.0.0 # Apache-2.0
+
+pre-commit>=2.6.0 # MIT
diff --git a/tox.ini b/tox.ini
index 9abf28b..49530e6 100644
--- a/tox.ini
+++ b/tox.ini
@@ -1,6 +1,6 @@
[tox]
minversion = 3.1
-envlist = py38,pep8
+envlist = py3,pep8
ignore_basepython_conflict = true
[testenv]
@@ -8,13 +8,13 @@ basepython = python3
setenv =
VIRTUAL_ENV={envdir}
deps =
- -c{env:UPPER_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
+ -c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
-r{toxinidir}/test-requirements.txt
commands = stestr run --slowest {posargs}
[testenv:pep8]
commands =
- flake8
+ pre-commit run -a
# Run security linter
bandit -r oslo_middleware -x tests -n5
@@ -49,9 +49,3 @@ deps = -r{toxinidir}/doc/requirements.txt
commands =
rm -rf releasenotes/build
sphinx-build -a -E -W -d releasenotes/build/doctrees --keep-going -b html releasenotes/source releasenotes/build/html
-
-[testenv:lower-constraints]
-deps =
- -c{toxinidir}/lower-constraints.txt
- -r{toxinidir}/test-requirements.txt
- -r{toxinidir}/requirements.txt