Skip to content

Commit c57fec2

Browse files
committed
Merge branch 'feat/drop_python_3.7' into 'main'
feat: Drop support of python <3.10 Closes PACMAN-1170 See merge request espressif/idf-component-manager!531
2 parents 2ac3717 + 881842c commit c57fec2

File tree

21 files changed

+57
-144
lines changed

21 files changed

+57
-144
lines changed

.git-blame-ignore-revs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,5 @@ a5e85486930ea416406ed1b3b24e7b22aeaeb2cc
1212
430927cb495aa44462473697f4561bf2d5d28d1e
1313
# Reformat all rst files using docstrfmt
1414
a002d37f54c3e3d9132916590f2b65b96079b78c
15+
# Remove re-export of `Annotated` and `Literal` from utils
16+
c60cc0a817c0649ca025f8d79483843c03f35ff4

.gitlab-ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ variables:
22
FF_TIMESTAMPS: true
33

44
default:
5-
image: python:3.11.9-bookworm
5+
image: python:3.14-trixie
66

77
stages:
88
- check

ci/build_docker.yml

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,8 @@ build:
99
timeout: 2h
1010
parallel:
1111
matrix:
12-
- IDF_BRANCH_TAG: [release-v5.0, release-v5.1]
13-
PYTHON_IMAGE_TAG: ["3.7", "3.13"]
14-
- IDF_BRANCH_TAG: [release-v5.2, release-v5.3, release-v5.4]
15-
PYTHON_IMAGE_TAG: ["3.8", "3.13"]
16-
- IDF_BRANCH_TAG: [release-v5.5]
17-
PYTHON_IMAGE_TAG: ["3.9", "3.13"]
1812
- IDF_BRANCH_TAG: [master]
19-
PYTHON_IMAGE_TAG: ["3.10", "3.13"]
13+
PYTHON_IMAGE_TAG: ["3.10", "3.14"]
2014
script:
2115
- BRANCH_NAME=$(echo $IDF_BRANCH_TAG | sed -e "s/release-v/release\/v/g")
2216
- |

ci/integration_tests.yml

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,8 @@ integration_test:
1818
parallel:
1919
matrix:
2020
# PYTEST_SPLIT_TEST_GROUP: Split integration tests into parallel jobs. The number of groups has to be reflected in the pytest invocation
21-
- IDF_BRANCH_TAG: [release-v5.0, release-v5.1]
22-
PYTHON_IMAGE_TAG: ["3.7", "3.13"]
23-
PYTEST_SPLIT_TEST_GROUP: [1, 2, 3, 4, 5]
24-
- IDF_BRANCH_TAG: [release-v5.2, release-v5.3, release-v5.4]
25-
PYTHON_IMAGE_TAG: ["3.8", "3.13"]
26-
PYTEST_SPLIT_TEST_GROUP: [1, 2, 3, 4, 5]
27-
- IDF_BRANCH_TAG: [release-v5.5]
28-
PYTHON_IMAGE_TAG: ["3.9", "3.13"]
29-
PYTEST_SPLIT_TEST_GROUP: [1, 2, 3, 4, 5]
3021
- IDF_BRANCH_TAG: [master]
31-
PYTHON_IMAGE_TAG: ["3.10", "3.13"]
22+
PYTHON_IMAGE_TAG: ["3.10", "3.14"]
3223
PYTEST_SPLIT_TEST_GROUP: [1, 2, 3, 4, 5]
3324
before_script:
3425
- IMAGE_TAG="${DOCKER_IMAGE}:${PYTHON_IMAGE_TAG}-${IDF_BRANCH_TAG}"

ci/tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ build_wheel:
1111
stage: build
1212
tags:
1313
- internet
14-
image: python:3.13-bookworm
14+
image: python:3.14-trixie
1515
script:
1616
- pip install build wheel
1717
- python -m build
@@ -26,7 +26,7 @@ build_wheel:
2626
- internet
2727
parallel:
2828
matrix:
29-
- PYTHON_IMAGE_TAG: [3.7-buster, 3.13-bookworm]
29+
- PYTHON_IMAGE_TAG: [3.10-bullseye, 3.14-trixie]
3030
image: python:${PYTHON_IMAGE_TAG}
3131

3232
test:

idf_component_manager/idf_extensions.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
)
1717
from idf_component_tools import error, setup_logging
1818
from idf_component_tools.errors import FatalError
19-
from idf_component_tools.utils import Literal, UrlField, UrlOrFileField
19+
from idf_component_tools.utils import UrlField, UrlOrFileField
2020

2121
from .core import ComponentManager
2222

@@ -37,7 +37,7 @@
3737
'help': 'URL of the Component Registry.'
3838
' IDF_COMPONENT_REGISTRY_URL environment variable can be used to set the default value.',
3939
'default': None,
40-
'callback': validate_from_type(t.Union[Literal['default'], UrlField]),
40+
'callback': validate_from_type(t.Union[t.Literal['default'], UrlField]),
4141
'scope': 'global', # Defined for action, but also available as a global option
4242
}
4343
]
@@ -50,7 +50,7 @@
5050
' IDF_COMPONENT_STORAGE_URL environment variable can be used to set the default value.',
5151
'default': None,
5252
'multiple': True,
53-
'callback': validate_from_type(t.Tuple[t.Union[Literal['default'], UrlOrFileField], ...]),
53+
'callback': validate_from_type(t.Tuple[t.Union[t.Literal['default'], UrlOrFileField], ...]),
5454
'scope': 'global', # Defined for action, but also available as a global option
5555
}
5656
]

idf_component_manager/utils.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,11 @@
22
# SPDX-License-Identifier: Apache-2.0
33

44
import enum
5-
import sys
5+
import importlib.metadata as importlib_metadata
66
from enum import Enum
77

88
from idf_component_tools.semver import Version
99

10-
if sys.version_info < (3, 8):
11-
import importlib_metadata
12-
else:
13-
import importlib.metadata as importlib_metadata
14-
1510
CLICK_VERSION = Version.coerce(importlib_metadata.version('click'))
1611
CLICK_SUPPORTS_SHOW_DEFAULT = CLICK_VERSION >= Version('7.1.0')
1712

idf_component_tools/config.py

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,7 @@
2323
)
2424
from idf_component_tools.errors import FatalError, NoSuchProfile
2525
from idf_component_tools.utils import (
26-
Annotated,
2726
BaseModel,
28-
Literal,
2927
UrlField,
3028
UrlOrFileField,
3129
default_or_str_or_list_or_none_discriminator,
@@ -37,33 +35,33 @@
3735
from .build_system_tools import get_idf_version
3836
from .environment import ComponentManagerSettings
3937

40-
RegistryUrlField = Annotated[
38+
RegistryUrlField = t.Annotated[
4139
t.Union[
42-
Annotated[Literal['default'], Tag('__default__')],
43-
Annotated[UrlField, Tag('__str__')],
44-
Annotated[None, Tag('__none__')],
40+
t.Annotated[t.Literal['default'], Tag('__default__')],
41+
t.Annotated[UrlField, Tag('__str__')],
42+
t.Annotated[None, Tag('__none__')],
4543
],
4644
Discriminator(
4745
default_or_str_or_none_discriminator,
4846
),
4947
]
5048

51-
StorageUrlField = Annotated[
49+
StorageUrlField = t.Annotated[
5250
t.Union[
53-
Annotated[Literal['default'], Tag('__default__')],
54-
Annotated[UrlOrFileField, Tag('__str__')],
55-
Annotated[t.List[t.Union[Literal['default'], UrlOrFileField]], Tag('__list__')],
56-
Annotated[None, Tag('__none__')],
51+
t.Annotated[t.Literal['default'], Tag('__default__')],
52+
t.Annotated[UrlOrFileField, Tag('__str__')],
53+
t.Annotated[t.List[t.Union[t.Literal['default'], UrlOrFileField]], Tag('__list__')],
54+
t.Annotated[None, Tag('__none__')],
5755
],
5856
Discriminator(
5957
default_or_str_or_list_or_none_discriminator,
6058
),
6159
]
62-
LocalStorageUrlField = Annotated[
60+
LocalStorageUrlField = t.Annotated[
6361
t.Union[
64-
Annotated[UrlOrFileField, Tag('__str__')],
65-
Annotated[t.List[UrlOrFileField], Tag('__list__')],
66-
Annotated[None, Tag('__none__')],
62+
t.Annotated[UrlOrFileField, Tag('__str__')],
63+
t.Annotated[t.List[UrlOrFileField], Tag('__list__')],
64+
t.Annotated[None, Tag('__none__')],
6765
],
6866
Discriminator(
6967
str_or_list_or_none_discriminator,

idf_component_tools/lock/manager.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ def __init__(self, path):
2929
self._path = path
3030
self._yaml = YAML(typ='safe')
3131
self._yaml.default_flow_style = False
32+
self._yaml.width = 2048 # Prevent wrapping long strings (hashes...)
3233

3334
def exists(self):
3435
return os.path.isfile(self._path)

idf_component_tools/manifest/models.py

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,8 @@
4949
BOOL_MARKER,
5050
DICT_MARKER,
5151
STR_MARKER,
52-
Annotated,
5352
BaseModel,
5453
ComponentVersion,
55-
Literal,
5654
UniqueStrListField,
5755
UniqueTagListField,
5856
UrlField,
@@ -164,10 +162,10 @@ class DependencyItem(BaseModel):
164162
rules: t.List[OptionalDependency] = None # type: ignore
165163
matches: t.List[OptionalDependency] = None # type: ignore
166164
override_path: str = None # type: ignore
167-
require: Annotated[
165+
require: t.Annotated[
168166
t.Union[
169-
Annotated[Literal['public', 'private', 'no'], Tag(STR_MARKER)],
170-
Annotated[Literal[False], Tag(BOOL_MARKER)],
167+
t.Annotated[t.Literal['public', 'private', 'no'], Tag(STR_MARKER)],
168+
t.Annotated[t.Literal[False], Tag(BOOL_MARKER)],
171169
],
172170
Discriminator(
173171
bool_str_discriminator,
@@ -373,7 +371,7 @@ class FilesField(BaseModel):
373371

374372

375373
class RepositoryInfoField(BaseModel):
376-
commit_sha: Annotated[str, Field(pattern=COMMIT_ID_RE)] = None # type: ignore
374+
commit_sha: t.Annotated[str, Field(pattern=COMMIT_ID_RE)] = None # type: ignore
377375
path: str = None # type: ignore
378376

379377

@@ -393,7 +391,7 @@ def _check_git_url(v: str) -> str:
393391
raise ValueError('Invalid git URL: {}'.format(v))
394392

395393

396-
GIT_URL_FIELD = Annotated[str, AfterValidator(_check_git_url)]
394+
GIT_URL_FIELD = t.Annotated[str, AfterValidator(_check_git_url)]
397395

398396

399397
class Manifest(BaseModel):
@@ -406,10 +404,10 @@ class Manifest(BaseModel):
406404
tags: UniqueTagListField = []
407405
dependencies: t.Dict[
408406
str,
409-
Annotated[
407+
t.Annotated[
410408
t.Union[
411-
Annotated[str, Tag(STR_MARKER)],
412-
Annotated[DependencyItem, Tag(DICT_MARKER)],
409+
t.Annotated[str, Tag(STR_MARKER)],
410+
t.Annotated[DependencyItem, Tag(DICT_MARKER)],
413411
],
414412
Discriminator(
415413
str_dict_discriminator,
@@ -739,7 +737,7 @@ def validate_model(self) -> t.Any:
739737
class SolvedManifest(BaseModel):
740738
direct_dependencies: UniqueStrListField = None # type: ignore
741739
dependencies: t.List[SolvedComponent] = []
742-
manifest_hash: Annotated[str, Field(min_length=64, max_length=64)] = None # type: ignore
740+
manifest_hash: t.Annotated[str, Field(min_length=64, max_length=64)] = None # type: ignore
743741
target: str = None # type: ignore
744742

745743
@field_validator('dependencies')

0 commit comments

Comments
 (0)