Skip to content

Commit

Permalink
linting fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
stone-w4tch3r committed Apr 5, 2024
1 parent fb187f4 commit b4c44fe
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 18 deletions.
2 changes: 1 addition & 1 deletion pyinfra/operations/brew.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import urllib

from pyinfra import host
from pyinfra.api import operation, Host
from pyinfra.api import Host, operation
from pyinfra.facts.brew import BrewCasks, BrewPackages, BrewTaps, BrewVersion, new_cask_cli

from .util.packaging import ensure_packages
Expand Down
2 changes: 1 addition & 1 deletion pyinfra/operations/files.py
Original file line number Diff line number Diff line change
Expand Up @@ -912,7 +912,7 @@ def template(
group: str = None,
mode: str = None,
create_remote_dir=True,
**data
**data,
):
'''
Generate a template using jinja2 and write it to the remote system.
Expand Down
7 changes: 1 addition & 6 deletions pyinfra/operations/npm.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,7 @@


@operation()
def packages(
packages: str | list[str] = None,
present=True,
latest=False,
directory: str = None
):
def packages(packages: str | list[str] = None, present=True, latest=False, directory: str = None):
"""
Install/remove/update npm packages.
Expand Down
1 change: 1 addition & 0 deletions pyinfra/operations/python.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"""

from typing import Callable

from pyinfra.api import FunctionCommand, operation


Expand Down
2 changes: 1 addition & 1 deletion pyinfra/operations/selinux.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from enum import Enum

from pyinfra import host
from pyinfra.api import QuoteString, StringCommand, operation, OperationValueError
from pyinfra.api import OperationValueError, QuoteString, StringCommand, operation
from pyinfra.facts.selinux import FileContext, FileContextMapping, SEBoolean, SEPort, SEPorts
from pyinfra.facts.server import Which

Expand Down
4 changes: 3 additions & 1 deletion pyinfra/operations/util/files.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,9 @@ def chmod(target: str, mode: str, recursive=False) -> StringCommand:
return StringCommand(" ".join(args), QuoteString(target))


def chown(target: str, user: str, group: str = None, recursive=False, dereference=True) -> StringCommand:
def chown(
target: str, user: str, group: str = None, recursive=False, dereference=True
) -> StringCommand:
command = "chown"
user_group = None

Expand Down
12 changes: 4 additions & 8 deletions pyinfra/operations/util/packaging.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def ensure_packages(
latest=False,
upgrade_command: str = None,
version_join: str = None,
expand_package_fact: Callable[[str], list[str]] = None
expand_package_fact: Callable[[str], list[str]] = None,
):
"""
Handles this common scenario:
Expand All @@ -77,7 +77,8 @@ def ensure_packages(
upgrade_command: as above for upgrading
version_join: the package manager specific "joiner", ie ``=`` for \
``<apt_pkg>=<version>``
expand_package_fact: fact returning list of packages providing a capability (ie ``yum whatprovides``)
expand_package_fact: fact returning packages providing a capability \
(ie ``yum whatprovides``)
"""

if packages_to_ensure is None:
Expand Down Expand Up @@ -157,12 +158,7 @@ def ensure_packages(
)


def ensure_rpm(
host: Host,
source: str,
present: bool,
package_manager_command: str
):
def ensure_rpm(host: Host, source: str, present: bool, package_manager_command: str):
original_source = source

# If source is a url
Expand Down

0 comments on commit b4c44fe

Please sign in to comment.