Add automatic black formatting

This commit is contained in:
John Garbutt 2023-09-12 17:04:17 +01:00
parent 38f006fa69
commit 2497e7871c
No known key found for this signature in database
8 changed files with 58 additions and 39 deletions

View File

@ -15,5 +15,4 @@
import pbr.version
__version__ = pbr.version.VersionInfo(
'magnum-capi-helm').version_string()
__version__ = pbr.version.VersionInfo("magnum-capi-helm").version_string()

View File

@ -23,6 +23,5 @@ from magnum_capi_helm.tests import base
class TestMagnum_capi_helm(base.TestCase):
def test_something(self):
pass

View File

@ -35,31 +35,31 @@
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
'openstackdocstheme',
'reno.sphinxext',
"openstackdocstheme",
"reno.sphinxext",
]
# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
templates_path = ["_templates"]
# The suffix of source filenames.
source_suffix = '.rst'
source_suffix = ".rst"
# The encoding of source files.
# source_encoding = 'utf-8-sig'
# The master toctree document.
master_doc = 'index'
master_doc = "index"
# General information about the project.
project = 'magnum_capi_helm Release Notes'
copyright = '2022, OpenStack Developers'
project = "magnum_capi_helm Release Notes"
copyright = "2022, OpenStack Developers"
# openstackdocstheme options
openstackdocs_repo_name = 'stackhpc/magnum-capi-helm'
openstackdocs_bug_project = 'magnum_capi_helm'
openstackdocs_bug_tag = ''
openstackdocs_auto_name = 'False'
openstackdocs_repo_name = "stackhpc/magnum-capi-helm"
openstackdocs_bug_project = "magnum_capi_helm"
openstackdocs_bug_tag = ""
openstackdocs_auto_name = "False"
# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
@ -67,9 +67,9 @@ openstackdocs_auto_name = 'False'
#
# The short X.Y version.
# The full version, including alpha/beta/rc tags.
release = ''
release = ""
# The short X.Y version.
version = ''
version = ""
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
@ -101,7 +101,7 @@ exclude_patterns = []
# show_authors = False
# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'native'
pygments_style = "native"
# A list of ignored prefixes for module index sorting.
# modindex_common_prefix = []
@ -114,7 +114,7 @@ pygments_style = 'native'
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
html_theme = 'openstackdocs'
html_theme = "openstackdocs"
# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
@ -143,7 +143,7 @@ html_theme = 'openstackdocs'
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']
html_static_path = ["_static"]
# Add any extra paths that contain custom files (such as robots.txt or
# .htaccess) here, relative to this directory. These files are copied
@ -188,7 +188,7 @@ html_static_path = ['_static']
# html_file_suffix = None
# Output file base name for HTML help builder.
htmlhelp_basename = 'magnum_capi_helmReleaseNotesdoc'
htmlhelp_basename = "magnum_capi_helmReleaseNotesdoc"
# -- Options for LaTeX output ---------------------------------------------
@ -196,10 +196,8 @@ htmlhelp_basename = 'magnum_capi_helmReleaseNotesdoc'
latex_elements = {
# The paper size ('letterpaper' or 'a4paper').
# 'papersize': 'letterpaper',
# The font size ('10pt', '11pt' or '12pt').
# 'pointsize': '10pt',
# Additional stuff for the LaTeX preamble.
# 'preamble': '',
}
@ -208,9 +206,13 @@ latex_elements = {
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
('index', 'magnum_capi_helmReleaseNotes.tex',
'magnum_capi_helm Release Notes Documentation',
'OpenStack Foundation', 'manual'),
(
"index",
"magnum_capi_helmReleaseNotes.tex",
"magnum_capi_helm Release Notes Documentation",
"OpenStack Foundation",
"manual",
),
]
# The name of an image file (relative to this directory) to place at the top of
@ -239,9 +241,13 @@ latex_documents = [
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
('index', 'magnum_capi_helmrereleasenotes',
'magnum_capi_helm Release Notes Documentation',
['OpenStack Foundation'], 1)
(
"index",
"magnum_capi_helmrereleasenotes",
"magnum_capi_helm Release Notes Documentation",
["OpenStack Foundation"],
1,
)
]
# If true, show URL addresses after external links.
@ -254,11 +260,15 @@ man_pages = [
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
('index', 'magnum_capi_helm ReleaseNotes',
'magnum_capi_helm Release Notes Documentation',
'OpenStack Foundation', 'magnum_capi_helmReleaseNotes',
'One line description of project.',
'Miscellaneous'),
(
"index",
"magnum_capi_helm ReleaseNotes",
"magnum_capi_helm Release Notes Documentation",
"OpenStack Foundation",
"magnum_capi_helmReleaseNotes",
"One line description of project.",
"Miscellaneous",
),
]
# Documents to append as an appendix to all manuals.
@ -274,4 +284,4 @@ texinfo_documents = [
# texinfo_no_detailmenu = False
# -- Options for Internationalization output ------------------------------
locale_dirs = ['locale/']
locale_dirs = ["locale/"]

View File

@ -3,3 +3,5 @@
# process, which may cause wedges in the gate later.
pbr>=2.0 # Apache-2.0
magnum
oslo_log

View File

@ -24,3 +24,7 @@ classifier =
[files]
packages =
magnum_capi_helm
[entry_points]
magnum.drivers =
k8s_cluster_api_v1 = magnum_cpi_helm.driver:Driver

View File

@ -16,6 +16,4 @@
# THIS FILE IS MANAGED BY THE GLOBAL REQUIREMENTS REPO - DO NOT EDIT
import setuptools
setuptools.setup(
setup_requires=['pbr'],
pbr=True)
setuptools.setup(setup_requires=["pbr"], pbr=True)

View File

@ -9,3 +9,4 @@ python-subunit>=0.0.18 # Apache-2.0/BSD
oslotest>=1.10.0 # Apache-2.0
stestr>=1.0.0 # Apache-2.0
testtools>=1.4.0 # MIT
black

10
tox.ini
View File

@ -1,6 +1,6 @@
[tox]
minversion = 3.2.0
envlist = py310,pep8
envlist = py3,black,pep8
skipsdist = True
ignore_basepython_conflict = true
@ -22,7 +22,13 @@ deps = -c{toxinidir}/lower-constraints.txt
-r{toxinidir}/test-requirements.txt
[testenv:pep8]
commands = flake8 {posargs}
commands =
black {tox_root} -l 79
flake8 {posargs}
[testenv:black]
commands = black {tox_root} --check -l 79
allowlist_externals = black
[testenv:venv]
commands = {posargs}