Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make fix reformats, with Python set to 39 #304

Merged
merged 1 commit into from
Dec 29, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ PACKAGE_NAME=pynitrokey
VENV=venv
PYTHON3=python3

BLACK_FLAGS=-t py35 --extend-exclude pynitrokey/nethsm/client
BLACK_FLAGS=-t py39 --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
Expand Down
3 changes: 1 addition & 2 deletions pynitrokey/cli/nk3/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion pynitrokey/conftest.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion pynitrokey/fido2/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@
import binascii
import hashlib
import json
import secrets
import struct
import sys
import tempfile
import time
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
Expand Down
3 changes: 1 addition & 2 deletions pynitrokey/nk3/bootloader/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion pynitrokey/nk3/bootloader/nrf52.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions pynitrokey/nk3/otp_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion pynitrokey/nk3/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down
2 changes: 1 addition & 1 deletion pynitrokey/updates.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down