Skip to content

Commit

Permalink
🚨 run linters
Browse files Browse the repository at this point in the history
Signed-off-by: rjdbcm <[email protected]>
  • Loading branch information
rjdbcm committed Jul 2, 2024
1 parent 80c6709 commit cddd84e
Show file tree
Hide file tree
Showing 16 changed files with 30 additions and 24 deletions.
2 changes: 1 addition & 1 deletion ozi/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

def current_version() -> str:
"""Returns the currently installed version of OZI.
.. versionchanged:: 1.14
Previously was part of the ozi.spec submodule.
Expand Down
2 changes: 1 addition & 1 deletion ozi/actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@
from warnings import warn

import requests
from ozi_spec import METADATA
from packaging.version import Version
from packaging.version import parse
from pyparsing import ParseException
from spdx_license_list import LICENSES

from ozi.spdx import spdx_license_expression
from ozi_spec import METADATA
from ozi.tap import TAP
from ozi.trove import Prefix
from ozi.trove import from_prefix
Expand Down
1 change: 1 addition & 0 deletions ozi/comment.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
from typing import Sequence

from ozi_spec import METADATA

from ozi.tap import TAP

if TYPE_CHECKING:
Expand Down
2 changes: 1 addition & 1 deletion ozi/fix/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@
from pathlib import Path
from typing import NoReturn

from ozi_spec import METADATA
from ozi_templates import load_environment # type: ignore
from ozi_templates.filter import underscorify # type: ignore

from ozi.fix.missing import report
from ozi.fix.parser import parser
from ozi.fix.rewrite_command import Rewriter
from ozi_spec import METADATA
from ozi.tap import TAP


Expand Down
3 changes: 2 additions & 1 deletion ozi/fix/build_definition.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@
from pathlib import Path
from typing import Generator

from ozi_spec import METADATA

from ozi import comment
from ozi.meson import get_items_by_suffix
from ozi.meson import query_build_value
from ozi_spec import METADATA
from ozi.tap import TAP

IGNORE_MISSING = {
Expand Down
2 changes: 1 addition & 1 deletion ozi/fix/missing.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@
from pathlib import Path
from typing import TYPE_CHECKING

from ozi_spec import METADATA
from ozi_templates.filter import underscorify # type: ignore

from ozi.fix.build_definition import walk
from ozi.meson import load_ast
from ozi.meson import project_metadata
from ozi.pkg_extra import parse_extra_pkg_info
from ozi_spec import METADATA
from ozi.tap import TAP

if sys.version_info >= (3, 11): # pragma: no cover
Expand Down
3 changes: 2 additions & 1 deletion ozi/fix/rewrite_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,11 @@
from typing import Union
from warnings import warn

from ozi_spec import METADATA

from ozi.render import build_child
from ozi.render import build_file
from ozi.render import find_user_template
from ozi_spec import METADATA

if TYPE_CHECKING:
import sys
Expand Down
2 changes: 1 addition & 1 deletion ozi/new/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
from pathlib import Path
from typing import TYPE_CHECKING

from ozi_spec import METADATA
from ozi_templates import load_environment # type: ignore

from ozi.new.interactive import interactive_prompt
Expand All @@ -28,7 +29,6 @@
from ozi.new.validate import valid_summary
from ozi.render import render_ci_files_set_user
from ozi.render import render_project_files
from ozi_spec import METADATA
from ozi.tap import TAP

if TYPE_CHECKING:
Expand Down
20 changes: 12 additions & 8 deletions ozi/new/interactive.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
from typing import TypeVar

import requests
from ozi_spec import METADATA
from prompt_toolkit import Application
from prompt_toolkit.application.current import get_app
from prompt_toolkit.document import Document
Expand Down Expand Up @@ -47,7 +48,6 @@
from prompt_toolkit.widgets import Label
from prompt_toolkit.widgets import RadioList

from ozi_spec import METADATA
from ozi.tap import TAP
from ozi.trove import Prefix
from ozi.trove import from_prefix
Expand Down Expand Up @@ -201,7 +201,7 @@ def author_email(
return result, output, prefix

@staticmethod
def license_( # noqa: C901
def license_(
project_name: str,
output: dict[str, list[str]],
prefix: dict[str, str],
Expand Down Expand Up @@ -466,7 +466,7 @@ def readme_type(
).run()
if readme_type is not None:
output.update(
{'--readme-type': [readme_type] if isinstance(readme_type, str) else []}
{'--readme-type': [readme_type] if isinstance(readme_type, str) else []},
)
else:
output.update({'--readme-type': _default})
Expand Down Expand Up @@ -516,7 +516,7 @@ def typing(
return str(result), output, prefix

@staticmethod
def project_urls( # noqa: C901
def project_urls(
project_name: str,
output: dict[str, list[str]],
prefix: dict[str, str],
Expand Down Expand Up @@ -816,15 +816,17 @@ def classifier_checkboxlist(key: str) -> list[str] | None: # pragma: no cover
return result


def header_input( # noqa: C901
def header_input(
label: str,
output: dict[str, list[str]],
prefix: dict[str, str],
*args: str,
validator: Validator | None = None,
split_on: str | None = None,
) -> tuple[
bool | None | list[str], dict[str, list[str]], dict[str, str]
bool | None | list[str],
dict[str, list[str]],
dict[str, str],
]: # pragma: no cover
_default = output.setdefault(f'--{label.lower()}', [])
header = input_dialog(
Expand All @@ -851,7 +853,7 @@ def header_input( # noqa: C901
prefix.update({label: f'{label}: {header}'})
if split_on:
output.update(
{f'--{label.lower()}': header.rstrip(split_on).split(split_on)}
{f'--{label.lower()}': header.rstrip(split_on).split(split_on)},
)
else:
output.update({f'--{label.lower()}': [header]})
Expand All @@ -872,7 +874,9 @@ def menu_loop(
output: dict[str, list[str]],
prefix: dict[str, str],
) -> tuple[
None | list[str] | bool, dict[str, list[str]], dict[str, str]
None | list[str] | bool,
dict[str, list[str]],
dict[str, str],
]: # pragma: no cover
while True:
_default: str | list[str] | None = None
Expand Down
3 changes: 2 additions & 1 deletion ozi/new/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@
import argparse
import sys

from ozi.actions import CloseMatch
from ozi_spec import METADATA

from ozi.actions import CloseMatch

parser = argparse.ArgumentParser(
prog='ozi-new',
description=sys.modules[__name__].__doc__,
Expand Down
2 changes: 1 addition & 1 deletion ozi/new/validate.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@
from typing import Sequence
from urllib.parse import urlparse

from ozi_spec import METADATA
from pyparsing import Combine
from pyparsing import ParseException
from pyparsing import ParseResults
from pyparsing import Regex
from trove_classifiers import classifiers

from ozi.spdx import spdx_license_expression
from ozi_spec import METADATA
from ozi.tap import TAP
from ozi.vendor.email_validator import EmailNotValidError
from ozi.vendor.email_validator import EmailSyntaxError
Expand Down
2 changes: 1 addition & 1 deletion ozi/render.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@

from git import InvalidGitRepositoryError
from git import Repo
from ozi_spec import METADATA
from ozi_templates.filter import underscorify # type: ignore

from ozi_spec import METADATA
from ozi.tap import TAP

if TYPE_CHECKING:
Expand Down
3 changes: 1 addition & 2 deletions ozi/spdx.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,14 @@
# See LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
"""SPDX standard metadata parser expression grammars, with support for :pep:`639` keys."""
from ozi_spec import METADATA
from pyparsing import Forward
from pyparsing import Keyword
from pyparsing import Literal
from pyparsing import ZeroOrMore
from pyparsing import oneOf
from spdx_license_list import LICENSES

from ozi_spec import METADATA

spdx_license_expression = Forward()
spdx_license_expression <<= oneOf(
[
Expand Down
3 changes: 1 addition & 2 deletions ozi/trove.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,8 @@
from typing import TYPE_CHECKING
from warnings import warn

from trove_classifiers import classifiers

from ozi_spec._license import NOT_SUPPORTED
from trove_classifiers import classifiers

if TYPE_CHECKING:
import sys
Expand Down
2 changes: 1 addition & 1 deletion tests/test_ozi_fix.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@
from hypothesis import given
from hypothesis import settings
from hypothesis import strategies as st
from ozi_spec import METADATA # pyright: ignore
from ozi_templates import load_environment # pyright: ignore

import ozi.fix.__main__ # pyright: ignore
import ozi.fix.rewrite_command # pyright: ignore
import ozi.new.__main__ # pyright: ignore
import ozi.pkg_extra # pyright: ignore
from ozi_spec import METADATA # pyright: ignore

required_pkg_info_patterns = (
'Author',
Expand Down
2 changes: 1 addition & 1 deletion tests/test_ozi_new.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@
from hypothesis import given
from hypothesis import settings
from hypothesis import strategies as st
from ozi_spec import METADATA # pyright: ignore
from ozi_templates import load_environment # pyright: ignore

import ozi.actions # pyright: ignore
import ozi.new.__main__ # pyright: ignore
from ozi.fix.missing import required_files # pyright: ignore
from ozi.fix.missing import required_pkg_info # pyright: ignore
from ozi_spec import METADATA # pyright: ignore
from ozi.tap import TAP # pyright: ignore


Expand Down

0 comments on commit cddd84e

Please sign in to comment.