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

chore: bump deps, drop python 3.7 and support python 3.12 #17

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
# Contains the pre-commit hooks for the repository
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.3.0
rev: v4.6.0
hooks:
- id: trailing-whitespace
exclude: '.+\.(md|rst)'
- id: end-of-file-fixer
- id: check-executables-have-shebangs
- id: mixed-line-ending
args: ['-f=lf']
- repo: https://gitlab.com/pycqa/flake8
rev: 3.8.4
- repo: https://github.com/pycqa/flake8
rev: 7.1.1
hooks:
- id: flake8
args: ['--config=.flake8', '--tee', '--benchmark']
3 changes: 2 additions & 1 deletion tools/esp_secure_cert/configure_ds.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
import os
import struct
import sys

from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives.asymmetric import rsa, ec
from cryptography.hazmat.primitives.asymmetric import ec, rsa
from cryptography.hazmat.primitives.ciphers import Cipher, algorithms, modes
from cryptography.utils import int_to_bytes
from esp_secure_cert.esp_secure_cert_helper import load_private_key
Expand Down
8 changes: 5 additions & 3 deletions tools/esp_secure_cert/custflash_format.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import sys
import struct
import zlib
from esp_secure_cert.esp_secure_cert_helper import load_private_key, load_certificate

from cryptography.hazmat.primitives import serialization
from cryptography.hazmat.backends import default_backend
from esp_secure_cert.esp_secure_cert_helper import (
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just to note here.
Are you planning to use the custflash_format for your project?
We have already marked the custflash_format as a legacy format.

load_certificate,
load_private_key,
)

# size is calculated as actual size + 16 (offset)
ciphertext_size = {'esp32s2': 1600, 'esp32s3': 1600, 'esp32c3': 1216}
Expand Down
2 changes: 1 addition & 1 deletion tools/requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
cryptography==36.0.0
cryptography
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, we have deliberately kept this fixated so as to not break behaviour of any internal functionality.
As the cryptography updates are not backward compatible and may contain breaking changes.

But yes, This version is too old now and should be updated to the latest one.
I will check if the latest cryptography version breaks anything here.

20 changes: 10 additions & 10 deletions tools/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@


def get_install_requires():
with open('requirements.txt') as f:
with open("requirements.txt") as f:
required = f.read().splitlines()
return required

Expand Down Expand Up @@ -53,17 +53,16 @@ def get_install_requires():
name="esp-secure-cert-tool",
version=VERSION,
description="A python utility which helps to configure and provision"
"the ESP platform with PKI credentials "
"into the esp_secure_cert partition",
"the ESP platform with PKI credentials "
"into the esp_secure_cert partition",
long_description=long_description,
long_description_content_type='text/x-rst',
url="https://github.com/espressif/"
"esp_secure_cert_mgr/blob/main/tools",
long_description_content_type="text/x-rst",
url="https://github.com/espressif/" "esp_secure_cert_mgr/blob/main/tools",
project_urls={
"Documentation": "https://github.com/espressif/"
"esp_secure_cert_mgr/blob/main/tools/README.md",
"esp_secure_cert_mgr/blob/main/tools/README.md",
"Source": "https://github.com/espressif/esp_secure_cert_mgr/"
"blob/main/tools/configure_esp_secure_cert.py",
"blob/main/tools/configure_esp_secure_cert.py",
},
author="Espressif Systems",
author_email="",
Expand All @@ -76,12 +75,13 @@ def get_install_requires():
"Operating System :: Microsoft :: Windows",
"Operating System :: MacOS :: MacOS X",
"Topic :: Software Development :: Embedded Systems",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
],
python_requires=">=3.7",
python_requires=">=3.8",
setup_requires=(["wheel"] if "bdist_wheel" in sys.argv else []),
install_requires=get_install_requires(),
include_package_data=True,
Expand Down