From 6dfdb91e82588c4c12f64e89c34987ef850847b9 Mon Sep 17 00:00:00 2001 From: Markus Meissner Date: Tue, 27 Dec 2022 14:11:30 +0100 Subject: [PATCH] update isort to python version 3.9 --- Makefile | 2 +- pynitrokey/cli/nk3/test.py | 3 +-- pynitrokey/conftest.py | 2 +- pynitrokey/fido2/client.py | 2 +- pynitrokey/nk3/bootloader/__init__.py | 3 +-- pynitrokey/nk3/bootloader/nrf52.py | 2 +- pynitrokey/nk3/otp_app.py | 4 ++-- pynitrokey/nk3/utils.py | 2 +- pynitrokey/updates.py | 2 +- 9 files changed, 10 insertions(+), 12 deletions(-) diff --git a/Makefile b/Makefile index d6fbd9ec..cd76ef17 100644 --- a/Makefile +++ b/Makefile @@ -6,7 +6,7 @@ PYTHON3=python3 BLACK_FLAGS=-t py35 --extend-exclude pynitrokey/nethsm/client FLAKE8_FLAGS=--extend-exclude pynitrokey/nethsm/client -ISORT_FLAGS=--py 35 --extend-skip pynitrokey/nethsm/client +ISORT_FLAGS=--py 39 --extend-skip pynitrokey/nethsm/client # whitelist of directories for flake8 FLAKE8_DIRS=pynitrokey/nethsm pynitrokey/cli/nk3 pynitrokey/nk3 diff --git a/pynitrokey/cli/nk3/test.py b/pynitrokey/cli/nk3/test.py index f0d8d128..7e67c7fa 100644 --- a/pynitrokey/cli/nk3/test.py +++ b/pynitrokey/cli/nk3/test.py @@ -11,13 +11,12 @@ import logging import platform import sys +from dataclasses import dataclass from enum import Enum, auto, unique from hashlib import sha256 from types import TracebackType from typing import Any, Callable, Iterable, List, Optional, Tuple, Type, Union -from dataclasses import dataclass - from pynitrokey.cli.exceptions import CliException from pynitrokey.fido2 import device_path_to_str from pynitrokey.helpers import local_print diff --git a/pynitrokey/conftest.py b/pynitrokey/conftest.py index 5876537c..96f006ae 100644 --- a/pynitrokey/conftest.py +++ b/pynitrokey/conftest.py @@ -1,10 +1,10 @@ import logging import os import pathlib +import secrets from functools import partial import pytest -import secrets from _pytest.fixtures import FixtureRequest from pynitrokey.cli import CliException diff --git a/pynitrokey/fido2/client.py b/pynitrokey/fido2/client.py index 5954a04d..8e55e78d 100644 --- a/pynitrokey/fido2/client.py +++ b/pynitrokey/fido2/client.py @@ -11,6 +11,7 @@ import binascii import hashlib import json +import secrets import struct import sys import tempfile @@ -18,7 +19,6 @@ from getpass import getpass from typing import Any, Optional -import secrets from fido2.client import Fido2Client, UserInteraction from fido2.ctap import CtapError from fido2.ctap1 import Ctap1 diff --git a/pynitrokey/nk3/bootloader/__init__.py b/pynitrokey/nk3/bootloader/__init__.py index 95b57f35..fe57cd38 100644 --- a/pynitrokey/nk3/bootloader/__init__.py +++ b/pynitrokey/nk3/bootloader/__init__.py @@ -11,11 +11,10 @@ import logging import sys from abc import abstractmethod +from dataclasses import dataclass from re import Pattern from typing import Callable, List, Optional -from dataclasses import dataclass - from ..base import Nitrokey3Base from ..utils import Version diff --git a/pynitrokey/nk3/bootloader/nrf52.py b/pynitrokey/nk3/bootloader/nrf52.py index a488afdc..d880f4d2 100644 --- a/pynitrokey/nk3/bootloader/nrf52.py +++ b/pynitrokey/nk3/bootloader/nrf52.py @@ -11,13 +11,13 @@ import logging import re import time +from dataclasses import dataclass from io import BytesIO from typing import Optional from zipfile import ZipFile import ecdsa import ecdsa.curves -from dataclasses import dataclass from ecdsa.keys import BadSignatureError from nordicsemi.dfu.dfu_transport import DfuEvent from nordicsemi.dfu.dfu_transport_serial import DfuTransportSerial diff --git a/pynitrokey/nk3/otp_app.py b/pynitrokey/nk3/otp_app.py index 9c5f347f..8b22817e 100644 --- a/pynitrokey/nk3/otp_app.py +++ b/pynitrokey/nk3/otp_app.py @@ -4,17 +4,17 @@ Used through CTAPHID transport, via the custom vendor command. Can be used directly over CCID as well. """ +import dataclasses import hmac import logging import typing from enum import Enum from hashlib import pbkdf2_hmac +from secrets import token_bytes from struct import pack from typing import List, Optional -import dataclasses import tlv8 -from secrets import token_bytes from pynitrokey.nk3 import Nitrokey3Device from pynitrokey.start.gnuk_token import iso7816_compose diff --git a/pynitrokey/nk3/utils.py b/pynitrokey/nk3/utils.py index 7a73d95d..8663cbe9 100644 --- a/pynitrokey/nk3/utils.py +++ b/pynitrokey/nk3/utils.py @@ -7,10 +7,10 @@ # http://opensource.org/licenses/MIT>, at your option. This file may not be # copied, modified, or distributed except according to those terms. +from dataclasses import dataclass from functools import total_ordering from typing import Tuple -from dataclasses import dataclass from spsdk.sbfile.misc import BcdVersion3 diff --git a/pynitrokey/updates.py b/pynitrokey/updates.py index e3ac7068..c3fdbea9 100644 --- a/pynitrokey/updates.py +++ b/pynitrokey/updates.py @@ -9,10 +9,10 @@ import os.path import urllib.parse +from dataclasses import dataclass from typing import BinaryIO, Callable, Dict, Generator, Optional, Pattern import requests -from dataclasses import dataclass API_BASE_URL = "https://api.github.com"