Skip to content

Commit

Permalink
Update precommit and fix more lint issues
Browse files Browse the repository at this point in the history
Signed-off-by: Travis F. Collins <[email protected]>
  • Loading branch information
tfcollins committed Dec 20, 2023
1 parent 7285c84 commit 4b9cc6c
Show file tree
Hide file tree
Showing 16 changed files with 43 additions and 33 deletions.
10 changes: 5 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
repos:
- repo: https://github.com/codespell-project/codespell
rev: v1.15.0
rev: v2.2.6
hooks:
- id: codespell
args: [--ignore-words=.codespell-whitelist]
- repo: https://github.com/pre-commit/mirrors-isort
rev: v4.3.4
- repo: https://github.com/pycqa/isort
rev: 5.13.2
hooks:
- id: isort
- id: isort
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.720
rev: v1.7.1
hooks:
- id: mypy
args: [--no-strict-optional, --ignore-missing-imports]
Expand Down
22 changes: 10 additions & 12 deletions nebula/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,20 @@
# print(f.renderText("Nebula"))
import os

from nebula.netconsole import netconsole
from nebula.uart import uart
from nebula.tftpboot import tftpboot
from nebula.pdu import pdu
from nebula.manager import manager
from nebula.network import network
from nebula.driver import driver
from nebula.builder import builder
from nebula.common import utils
from nebula.helper import helper
from nebula.downloader import downloader
from nebula.common import LINUX_DEFAULT_PATH, utils
from nebula.coverage import coverage
from nebula.downloader import downloader
from nebula.driver import driver
from nebula.helper import helper
from nebula.jtag import jtag
from nebula.manager import manager
from nebula.netbox import netbox

from nebula.common import LINUX_DEFAULT_PATH
from nebula.netconsole import netconsole
from nebula.network import network
from nebula.pdu import pdu
from nebula.tftpboot import tftpboot
from nebula.uart import uart

if os.name in ["nt", "posix"] and os.path.exists(LINUX_DEFAULT_PATH):
from nebula.usbmux import usbmux
Expand Down
3 changes: 2 additions & 1 deletion nebula/common.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import logging
import os

import nebula.errors as ne
import yaml

import nebula.errors as ne

LINUX_DEFAULT_PATH = "/etc/default/nebula"
WINDOWS_DEFAULT_PATH = "C:\\nebula\\nebula.yaml"

Expand Down
3 changes: 2 additions & 1 deletion nebula/downloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,12 @@
from artifactory import ArtifactoryPath
from bs4 import BeautifulSoup
from github import Github
from nebula.common import utils
from requests.adapters import HTTPAdapter
from requests.packages.urllib3.util.retry import Retry
from tqdm import tqdm

from nebula.common import utils

log = logging.getLogger(__name__)


Expand Down
7 changes: 4 additions & 3 deletions nebula/fixtures.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import pytest
import os
import nebula
import logging
import os

import pytest

import nebula

logging.getLogger().setLevel(logging.INFO)

Expand Down
3 changes: 2 additions & 1 deletion nebula/helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@
import pathlib

import click
import nebula.errors as ne
import netifaces
import yaml

import nebula.errors as ne
from nebula.common import multi_device_check
from nebula.netbox import NetboxDevice, NetboxDevices, netbox

Expand Down
1 change: 1 addition & 0 deletions nebula/main.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from invoke import Collection, Program

from nebula import tasks

program = Program(namespace=Collection.from_module(tasks), version="0.0.1")
5 changes: 3 additions & 2 deletions nebula/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@
import tarfile
import time

import yaml

import nebula.common as common
import nebula.errors as ne
import nebula.helper as helper
import yaml
from nebula.driver import driver
from nebula.jtag import jtag
from nebula.netconsole import netconsole
Expand Down Expand Up @@ -322,7 +323,7 @@ def board_reboot_jtag_uart(
# Check if u-boot loads first
# log.info("Resetting with JTAG and checking if u-boot is reachable")
# self.jtag.restart_board()
# do a power cylcle rather than jtag reboot to make sure jtag devices are working
# do a power cycle rather than jtag reboot to make sure jtag devices are working
log.info("Resetting with JTAG and checking if u-boot is reachable")
self.jtag.restart_board()
if self.monitor[0]._enter_uboot_menu_from_power_cycle():
Expand Down
3 changes: 2 additions & 1 deletion nebula/netbox.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@

import pynetbox
import yaml
from nebula.common import utils
from numpy import isin

from nebula.common import utils

log = logging.getLogger(__name__)


Expand Down
3 changes: 2 additions & 1 deletion nebula/network.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@
import time

import fabric
import nebula.errors as ne
from fabric import Connection

import nebula.errors as ne
from nebula.common import utils

log = logging.getLogger(__name__)
Expand Down
3 changes: 2 additions & 1 deletion nebula/pdu.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import logging
import time

from pyvesync_v2 import VeSync

from nebula import cyberpower as cpdu
from nebula.common import utils
from pyvesync_v2 import VeSync

log = logging.getLogger(__name__)

Expand Down
2 changes: 1 addition & 1 deletion nebula/resources/template_gen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ board-config:
field_3:
name: daughter
default: FMCOMMS2-3
help: "Daugther board name"
help: "Daughter board name"
optional: False
netbox_field: devices.custom_fields.device_daughter
field_4:
Expand Down
2 changes: 1 addition & 1 deletion nebula/resources/template_rpi_gen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ board-config:
netbox_field: devices.custom_fields.device_carrier
field_3:
name: daughter
help: "Daugther board name"
help: "Daughter board name"
optional: True
netbox_field: devices.custom_fields.device_daughter
field_4:
Expand Down
3 changes: 2 additions & 1 deletion nebula/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@
import time
from operator import truediv

import nebula
import yaml
from invoke import Collection, task

import nebula

logging.getLogger().setLevel(logging.WARNING)


Expand Down
3 changes: 2 additions & 1 deletion nebula/uart.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@

import serial
import xmodem
from nebula.common import utils
from tqdm import tqdm

from nebula.common import utils

log = logging.getLogger(__name__)

LINUX_SERIAL_FOLDER = "/dev/serial"
Expand Down
3 changes: 2 additions & 1 deletion nebula/usbmux.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@
from pathlib import Path

import pyudev
from nebula.common import utils
from usbsdmux import usbsdmux

from nebula.common import utils

log = logging.getLogger(__name__)


Expand Down

0 comments on commit 4b9cc6c

Please sign in to comment.