Skip to content
This repository has been archived by the owner on Apr 10, 2024. It is now read-only.

Commit

Permalink
Merge pull request #28 from gtema/dev
Browse files Browse the repository at this point in the history
chore: update black version
  • Loading branch information
gtema authored Feb 29, 2024
2 parents a46ac99 + 9933ddb commit ac72dbe
Show file tree
Hide file tree
Showing 10 changed files with 55 additions and 55 deletions.
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ repos:
hooks:
- id: doc8
- repo: https://github.com/psf/black
rev: 23.3.0
rev: 24.2.0
hooks:
- id: black
args: ['-S', '-l', '79']
args: ['-l', '79']
exclude: '^codegenerator/templates/.*$'
- repo: local
hooks:
Expand Down
12 changes: 6 additions & 6 deletions codegenerator/metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -379,12 +379,12 @@ def generate(
)
op_model.operation_type = "action"

op_model.targets[
"rust-sdk"
] = rust_sdk_params
op_model.targets[
"rust-cli"
] = rust_cli_params
op_model.targets["rust-sdk"] = (
rust_sdk_params
)
op_model.targets["rust-cli"] = (
rust_cli_params
)

op_model = post_process_operation(
args.service_type,
Expand Down
18 changes: 9 additions & 9 deletions codegenerator/openapi/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -574,9 +574,9 @@ def process_operation(
)
< (self._api_ver(start_version))
):
operation_spec.openstack[
"min-ver"
] = start_version.get_string()
operation_spec.openstack["min-ver"] = (
start_version.get_string()
)

if mode != "action" and end_version:
if end_version.ver_major == 0:
Expand All @@ -599,9 +599,9 @@ def process_operation(
)
> self._api_ver(end_version)
):
operation_spec.openstack[
"max-ver"
] = end_version.get_string()
operation_spec.openstack["max-ver"] = (
end_version.get_string()
)

action_name = getattr(func, "wsgi_action", None)
if action_name:
Expand Down Expand Up @@ -982,9 +982,9 @@ def process_body_parameters(
elif schema_ref:
js_content = op_body.setdefault(mime_type, {})
body_schema = js_content.setdefault("schema", {})
operation_spec.requestBody["content"][mime_type][
"schema"
] = TypeSchema(ref=schema_ref)
operation_spec.requestBody["content"][mime_type]["schema"] = (
TypeSchema(ref=schema_ref)
)

def _sanitize_schema(
self, schema, *, start_version=None, end_version=None
Expand Down
6 changes: 3 additions & 3 deletions codegenerator/openapi/cinder_schemas.py
Original file line number Diff line number Diff line change
Expand Up @@ -518,9 +518,9 @@
},
}

VOLUME_TYPE_EXTRA_SPEC_SCHEMA: dict[
str, Any
] = parameter_types.extra_specs_with_no_spaces_key
VOLUME_TYPE_EXTRA_SPEC_SCHEMA: dict[str, Any] = (
parameter_types.extra_specs_with_no_spaces_key
)

VOLUME_TYPE_ACCESS_SCHEMA: dict[str, Any] = {
"type": "object",
Expand Down
6 changes: 3 additions & 3 deletions codegenerator/openapi/keystone.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,9 +228,9 @@ def _process_route(self, route, openapi_spec):
)
# We can only assume the param type. For path it is logically a string only
path_param.type_schema = TypeSchema(type="string")
openapi_spec.components.parameters[
global_param_name
] = path_param
openapi_spec.components.parameters[global_param_name] = (
path_param
)
else:
path_resource_names.append(path_element.replace("-", "_"))
if len(path_elements) == 0:
Expand Down
6 changes: 3 additions & 3 deletions codegenerator/openapi/neutron.py
Original file line number Diff line number Diff line change
Expand Up @@ -539,9 +539,9 @@ def _process_route(
)
# We can only assume the param type. For path it is logically a string only
path_param.type_schema = TypeSchema(type="string")
openapi_spec.components.parameters[
global_param_name
] = path_param
openapi_spec.components.parameters[global_param_name] = (
path_param
)
else:
path_resource_names.append(path_element.replace("-", "_"))

Expand Down
12 changes: 6 additions & 6 deletions codegenerator/rust_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,9 +204,9 @@ class EnumGroupStructInputField(StructInputField):
class EnumGroupStruct(common_rust.Struct):
"""Container for complex Enum containing Array"""

field_type_class_: Type[
common_rust.StructField
] = EnumGroupStructInputField
field_type_class_: Type[common_rust.StructField] = (
EnumGroupStructInputField
)
base_type: str = "struct"
sdk_enum_name: str
is_group: bool = True
Expand Down Expand Up @@ -425,9 +425,9 @@ class RequestTypeManager(common_rust.TypeManager):
model.Set: ArrayInput,
}

request_parameter_class: Type[
common_rust.RequestParameter
] = RequestParameter
request_parameter_class: Type[common_rust.RequestParameter] = (
RequestParameter
)
string_enum_class = StringEnum

def get_local_attribute_name(self, name: str) -> str:
Expand Down
6 changes: 3 additions & 3 deletions codegenerator/rust_sdk.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,9 +234,9 @@ class TypeManager(common_rust.TypeManager):
model.CommaSeparatedList: CommaSeparatedList,
}

request_parameter_class: Type[
common_rust.RequestParameter
] = RequestParameter
request_parameter_class: Type[common_rust.RequestParameter] = (
RequestParameter
)

def set_parameters(self, parameters: list[model.RequestParameter]) -> None:
"""Set OpenAPI operation parameters into typemanager for conversion"""
Expand Down
38 changes: 19 additions & 19 deletions doc/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,39 +15,39 @@
import sys
import warnings

sys.path.insert(0, os.path.abspath('../..'))
sys.path.insert(0, os.path.abspath('.'))
sys.path.insert(0, os.path.abspath("../.."))
sys.path.insert(0, os.path.abspath("."))

# -- General configuration ----------------------------------------------------

# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
extensions = [
'sphinx.ext.autodoc',
'openstackdocstheme',
"sphinx.ext.autodoc",
"openstackdocstheme",
]

# openstackdocstheme options
# openstackdocs_repo_name = 'openstack/openstacksdk'
# openstackdocs_pdf_link = True
# openstackdocs_use_storyboard = False
html_theme = 'openstackdocs'
html_theme = "openstackdocs"

# autodoc generation is a bit aggressive and a nuisance when doing heavy
# text edit cycles.
# execute "export SPHINX_DEBUG=1" in your terminal to disable

# 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 master toctree document.
master_doc = 'index'
master_doc = "index"

# General information about the project.
copyright = '2023, Various members of the OpenStack Foundation'
copyright = "2023, Various members of the OpenStack Foundation"

# If true, '()' will be appended to :func: etc. cross-reference text.
add_function_parentheses = True
Expand All @@ -57,15 +57,15 @@
add_module_names = True

# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'native'
pygments_style = "native"

autodoc_member_order = 'bysource'
autodoc_member_order = "bysource"

# Include both the class and __init__ docstrings when describing the class
autoclass_content = 'both'
autoclass_content = "both"

# Don't document type hints as they're too noisy
autodoc_typehints = 'none'
autodoc_typehints = "none"

# Locations to exclude when looking for source files.
exclude_patterns: list = []
Expand All @@ -82,16 +82,16 @@
# [howto/manual]).
latex_documents = [
(
'index',
'doc-openstacksdk.tex',
'OpenStackSDK Documentation',
'OpenStack Foundation',
'manual',
"index",
"doc-openstacksdk.tex",
"OpenStackSDK Documentation",
"OpenStack Foundation",
"manual",
),
]

# Allow deeper levels of nesting for \begin...\end stanzas
latex_elements = {'maxlistdepth': 10}
latex_elements = {"maxlistdepth": 10}

# Disable usage of xindy https://bugzilla.redhat.com/show_bug.cgi?id=1643664
latex_use_xindy = False
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@
# THIS FILE IS MANAGED BY THE GLOBAL REQUIREMENTS REPO - DO NOT EDIT
import setuptools

setuptools.setup(setup_requires=['pbr>=2.0.0'], pbr=True)
setuptools.setup(setup_requires=["pbr>=2.0.0"], pbr=True)

0 comments on commit ac72dbe

Please sign in to comment.