diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..9d94556 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,35 @@ +# 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: https://gitlab.com/pycqa/flake8 + rev: 181bb46098dddf7e2d45319ea654b4b4d58c2840 # 3.8.3 + hooks: + - id: flake8 + additional_dependencies: + - hacking>=3.0.1,<3.1.0 diff --git a/.zuul.yaml b/.zuul.yaml index 76c9c62..93c64e7 100644 --- a/.zuul.yaml +++ b/.zuul.yaml @@ -59,8 +59,7 @@ - barbican-tempest-plugin-simple-crypto-castellan-src templates: - check-requirements - - openstack-lower-constraints-jobs - - openstack-python3-victoria-jobs + - openstack-python3-wallaby-jobs - periodic-stable-jobs - publish-openstack-docs-pti - release-notes-jobs-python3 diff --git a/castellan/key_manager/barbican_key_manager.py b/castellan/key_manager/barbican_key_manager.py index 9d01c84..1b545cc 100644 --- a/castellan/key_manager/barbican_key_manager.py +++ b/castellan/key_manager/barbican_key_manager.py @@ -198,7 +198,6 @@ return endpoint_data.url else: service_parameters = {'service_type': 'key-manager', - 'service_name': 'barbican', 'interface': barbican.barbican_endpoint_type} return auth.get_endpoint(sess, **service_parameters) diff --git a/castellan/tests/unit/key_manager/test_barbican_key_manager.py b/castellan/tests/unit/key_manager/test_barbican_key_manager.py index 4d6c9bb..cb48d3c 100644 --- a/castellan/tests/unit/key_manager/test_barbican_key_manager.py +++ b/castellan/tests/unit/key_manager/test_barbican_key_manager.py @@ -122,7 +122,7 @@ self.assertRaises(exception.KeyManagerError, self.key_mgr._create_base_url, auth, sess, endpoint) - auth.get_discovery.asser_called_once_with(sess, url=endpoint) + auth.get_discovery.assert_called_once_with(sess, url=endpoint) self.assertEqual(1, discovery.raw_version_data.call_count) def test_base_url_get_discovery(self): @@ -136,10 +136,10 @@ endpoint = "http://localhost/key_manager" base_url = self.key_mgr._create_base_url(auth, - mock.Mock(), + sess, endpoint) self.assertEqual(endpoint + "/" + version, base_url) - auth.get_discovery.asser_called_once_with(sess, url=endpoint) + auth.get_discovery.assert_called_once_with(sess, url=endpoint) self.assertEqual(1, discovery.raw_version_data.call_count) def test_create_key(self): diff --git a/doc/source/conf.py b/doc/source/conf.py old file mode 100755 new file mode 100644 index 29813ad..bb9dd3d 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -1,3 +1,5 @@ +# 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 @@ -21,7 +23,6 @@ # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom ones. extensions = [ 'sphinx.ext.autodoc', - #'sphinx.ext.intersphinx', 'openstackdocstheme', 'sphinxcontrib.rsvgconverter', ] @@ -81,9 +82,6 @@ latex_use_xindy = False -# Example configuration for intersphinx: refer to the Python standard library. -#intersphinx_mapping = {'https://docs.python.org/3/': None} - # -- Options for openstackdocstheme ------------------------------------------- openstackdocs_repo_name = 'openstack/castellan' openstackdocs_pdf_link = True diff --git a/lower-constraints.txt b/lower-constraints.txt index 7be58e1..bc4ec34 100644 --- a/lower-constraints.txt +++ b/lower-constraints.txt @@ -47,7 +47,6 @@ requests==2.18.0 requestsexceptions==1.2.0 rfc3986==0.3.1 -six==1.15.0 smmap==0.9.0 stestr==2.0.0 stevedore==1.20.0 diff --git a/releasenotes/source/index.rst b/releasenotes/source/index.rst index cebc814..ba93b2e 100644 --- a/releasenotes/source/index.rst +++ b/releasenotes/source/index.rst @@ -6,6 +6,7 @@ :maxdepth: 1 unreleased + victoria ussuri train stein diff --git a/releasenotes/source/victoria.rst b/releasenotes/source/victoria.rst new file mode 100644 index 0000000..4efc7b6 --- /dev/null +++ b/releasenotes/source/victoria.rst @@ -0,0 +1,6 @@ +============================= +Victoria Series Release Notes +============================= + +.. release-notes:: + :branch: stable/victoria diff --git a/test-requirements.txt b/test-requirements.txt index 1a0b2f5..eedc2f8 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -17,3 +17,5 @@ testtools>=2.2.0 # MIT bandit>=1.6.0,<1.7.0 # Apache-2.0 pifpaf>=0.10.0 # Apache-2.0 + +pre-commit>=2.6.0 # MIT diff --git a/tox.ini b/tox.ini index 1458e59..2392ba0 100644 --- a/tox.ini +++ b/tox.ini @@ -1,6 +1,6 @@ [tox] minversion = 3.1.1 -envlist = py38,pep8 +envlist = py3,pep8 ignore_basepython_conflict = True skipsdist = True @@ -18,7 +18,7 @@ [testenv:pep8] commands = - flake8 + pre-commit run -a bandit -r castellan -x tests -s B105,B106,B107,B607 [testenv:bandit]