From 995f9392ebc74ad087266f207360ef68b63889cd Mon Sep 17 00:00:00 2001 From: foamyguy Date: Mon, 15 Jul 2024 16:08:06 -0500 Subject: [PATCH 1/2] python 3.12 support --- .pre-commit-config.yaml | 2 +- circup/shared.py | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index a76c7f4..ea7c1ef 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -9,7 +9,7 @@ repos: - id: black exclude: "^tests/bad_python.py$" - repo: https://github.com/pycqa/pylint - rev: v2.15.5 + rev: v3.1.0 hooks: - id: pylint name: lint (examples) diff --git a/circup/shared.py b/circup/shared.py index 7ffbc08..d3be33c 100644 --- a/circup/shared.py +++ b/circup/shared.py @@ -10,8 +10,8 @@ import glob import os import re import json +import importlib.resources import appdirs -import pkg_resources import requests #: Version identifier for a bad MPY file format @@ -27,9 +27,8 @@ PLATFORMS = {"py": "py", "8mpy": "8.x-mpy", "9mpy": "9.x-mpy"} REQUESTS_TIMEOUT = 30 #: The path to the JSON file containing the metadata about the bundles. -BUNDLE_CONFIG_FILE = pkg_resources.resource_filename( - "circup", "config/bundle_config.json" -) +BUNDLE_CONFIG_FILE = importlib.resources.files("circup") / "config/bundle_config.json" + #: Overwrite the bundles list with this file (only done manually) BUNDLE_CONFIG_OVERWRITE = os.path.join(DATA_DIR, "bundle_config.json") #: The path to the JSON file containing the local list of bundles. From c3da149010af27e4d5d8f5c1fea107eeca37a754 Mon Sep 17 00:00:00 2001 From: foamyguy Date: Mon, 15 Jul 2024 16:12:42 -0500 Subject: [PATCH 2/2] similarity lines config --- .pylintrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pylintrc b/.pylintrc index f5c73bf..23f3fe9 100644 --- a/.pylintrc +++ b/.pylintrc @@ -246,7 +246,7 @@ ignore-docstrings=yes ignore-imports=yes # Minimum lines number of a similarity. -min-similarity-lines=4 +min-similarity-lines=8 [BASIC]