From 0e3ff499be4f10febd6b202914da45ede110eb79 Mon Sep 17 00:00:00 2001 From: Tiago Nobrega Date: Wed, 19 Jun 2024 09:28:24 -0300 Subject: [PATCH 1/7] chore: fix typos This is a "manual cherry-pick" of the typo fixes in aef710351b33d4b4811 --- craft_parts/overlays/layers.py | 4 ++-- craft_parts/packages/yum.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/craft_parts/overlays/layers.py b/craft_parts/overlays/layers.py index 5255b7f2..4dc68447 100644 --- a/craft_parts/overlays/layers.py +++ b/craft_parts/overlays/layers.py @@ -1,6 +1,6 @@ # -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*- # -# Copyright 2021 Canonical Ltd. +# Copyright 2021-2024 Canonical Ltd. # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public @@ -78,7 +78,7 @@ def load(cls, part: Part) -> Optional["LayerHash"]: :param part: The part whose layer hash will be loaded. - :return: A layer hash object containing the loaded validaton hash, + :return: A layer hash object containing the loaded validation hash, or None if the file doesn't exist. """ hash_file = part.part_state_dir / "layer_hash" diff --git a/craft_parts/packages/yum.py b/craft_parts/packages/yum.py index cd4ba535..eecf1556 100644 --- a/craft_parts/packages/yum.py +++ b/craft_parts/packages/yum.py @@ -1,4 +1,4 @@ -# Copyright 2023 Canonical Ltd. +# Copyright 2023-2024 Canonical Ltd. # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public @@ -144,7 +144,7 @@ def install_packages( # XXX Facundo 2023-02-07: the information returned by this method is not used # anywhere, so we should clean it up and just return None (here, and in the - # Ubuntu reposity too, where a further cleaning should be done) -- related + # Ubuntu repository too, where a further cleaning should be done) -- related # to this, `list_only` should go away. return [] From bf48cfeb013c435088e8d7a1d4360c389c322c61 Mon Sep 17 00:00:00 2001 From: liushuyu Date: Wed, 22 May 2024 15:46:05 -0600 Subject: [PATCH 2/7] fix(setup.py): temporarily limits `requests` version ... (#741) ... to avoid a breaking change in the behavior that renders craft_parts unusable --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 1d46201c..83e78df8 100644 --- a/setup.py +++ b/setup.py @@ -52,7 +52,7 @@ def is_rtd() -> bool: "pydantic>=1.9.0,<2.0.0", "pydantic-yaml[pyyaml]>=0.11.0,<1.0.0", "pyxdg", - "requests", + "requests<2.32.0", "requests-unixsocket", # See: https://github.com/msabramo/requests-unixsocket/pull/69 # When updating to urllib3 v2, also remove the constraint on types-requests. From ab47ebc2856687e31c9167a35be0989d0128c38e Mon Sep 17 00:00:00 2001 From: Tiago Nobrega Date: Wed, 19 Jun 2024 10:02:14 -0300 Subject: [PATCH 3/7] chore: ruff fixes This is a "manual cherry-pick" of some bits of 425a84f16624b27 --- craft_parts/infos.py | 2 +- tests/unit/test_errors.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/craft_parts/infos.py b/craft_parts/infos.py index 20c201ea..e584eebd 100644 --- a/craft_parts/infos.py +++ b/craft_parts/infos.py @@ -464,7 +464,7 @@ def __init__( self._part_info = part_info self.step = step self.step_environment: Dict[str, str] = {} - self.state: "Optional[states.StepState]" = None + self.state: Optional[states.StepState] = None def __getattr__(self, name: str) -> Any: # noqa: ANN401 if hasattr(self._part_info, name): diff --git a/tests/unit/test_errors.py b/tests/unit/test_errors.py index 6b3e4a57..088d7392 100644 --- a/tests/unit/test_errors.py +++ b/tests/unit/test_errors.py @@ -105,7 +105,7 @@ def test_part_specification_error(): def test_part_specification_error_from_validation_error() -> None: - error_list: List["ErrorDict"] = [ + error_list: List[ErrorDict] = [ {"loc": ("field-1", 0), "msg": "something is wrong", "type": "value_error"}, {"loc": ("field-2",), "msg": "field required", "type": "value_error"}, { From 09eba2abcbb34e3748c91e317697177aa726dffe Mon Sep 17 00:00:00 2001 From: Tiago Nobrega Date: Wed, 19 Jun 2024 10:28:40 -0300 Subject: [PATCH 4/7] chore(ci): bump chisel version This is a manual cherry-pick of parts of aef710351b33d4 --- .github/workflows/tests.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 23c6d6f9..9504dd02 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -84,7 +84,7 @@ jobs: # Build Chisel: needs a newer version of go than is available in Ubuntu 20.04 sudo snap install --classic --channel=latest/stable go git clone https://github.com/canonical/chisel.git chisel-tmp - cd chisel-tmp && git checkout v0.9.0 + cd chisel-tmp && git checkout v0.9.1 go mod download sudo go build -o /usr/bin ./... chisel --help @@ -149,7 +149,7 @@ jobs: # the test files in /tmp/pytest-* sudo snap install --classic --channel=latest/stable go git clone https://github.com/canonical/chisel.git chisel-tmp - cd chisel-tmp && git checkout v0.9.0 + cd chisel-tmp && git checkout v0.9.1 go mod download sudo go build -o /usr/bin ./... chisel --help From 5b5d31f4dfbe3120b95a1f9f914e42a914254325 Mon Sep 17 00:00:00 2001 From: Tiago Nobrega Date: Fri, 21 Jun 2024 14:10:04 -0300 Subject: [PATCH 5/7] fix: add list of ignore packages in core24 (#755) This list is updated based on the packages currently present on /snap/core24/current/usr/share/snappy/dpkg.list. Note that some packages are added, but mostly these are removals. --- craft_parts/packages/deb.py | 30 ++++++++++++++++++++++++++++++ tests/unit/packages/test_deb.py | 24 ++++++++++++++++++++++++ 2 files changed, 54 insertions(+) diff --git a/craft_parts/packages/deb.py b/craft_parts/packages/deb.py index 87294339..1a67aa5d 100644 --- a/craft_parts/packages/deb.py +++ b/craft_parts/packages/deb.py @@ -249,6 +249,36 @@ "python3-yaml", "python3-zipp", }, + "core24": { + "python3-attr", + "python3-blinker", + "python3-certifi", + "python3-cffi-backend", + "python3-chardet", + "python3-configobj", + "python3-cryptography", + "python3-dbus", + "python3-debconf", + "python3-idna", + "python3-jinja2", + "python3-json-pointer", + "python3-jsonpatch", + "python3-jsonschema", + "python3-jwt", + "python3-markupsafe", + # Provides /usr/bin/python3, don't bring in unless explicitly requested. + # "python3-minimal" + "python3-netifaces", + "python3-netplan", + "python3-oauthlib", + # Rely on version brought in by setuptools, unless explicitly requested. + # "python3-pkg-resources" + "python3-pyrsistent", + "python3-requests", + "python3-serial", + "python3-urllib3", + "python3-yaml", + }, } diff --git a/tests/unit/packages/test_deb.py b/tests/unit/packages/test_deb.py index a6ba6f13..8d602d98 100644 --- a/tests/unit/packages/test_deb.py +++ b/tests/unit/packages/test_deb.py @@ -769,3 +769,27 @@ def test_get_filtered_stage_package_empty_ignore_filter(mocker): ) assert filtered_names == {"some-base-pkg", "some-other-base-pkg"} + + +def test_get_filtered_stage_package_core24(mocker): + mock_get_packages_in_base = mocker.patch.object(deb, "get_packages_in_base") + mock_get_packages_in_base.return_value = [ + DebPackage(name="some-package"), + DebPackage(name="python3-cffi"), + DebPackage(name="python3-cffi-backend"), + DebPackage(name="python3-jsonschema"), + DebPackage(name="python3-attr"), + ] + + filtered_names = deb._get_filtered_stage_package_names( + base="core24", + package_list=[ + DebPackage(name="python3-cffi"), + DebPackage(name="python3-jsonschema"), + ], + base_package_names=None, + ) + + # python3-cffi-backend and python3-attr must NOT be on the list of filtered + # names, even though they are present in the core24 base. + assert filtered_names == {"some-package"} From 933e98179e0e7ef249935f7927e509ec2bb58fd1 Mon Sep 17 00:00:00 2001 From: Callahan Kovacs Date: Fri, 21 Jun 2024 12:14:44 -0500 Subject: [PATCH 6/7] build: bump version to 1.30.1 Signed-off-by: Callahan Kovacs --- .bumpversion.cfg | 2 +- craft_parts/__init__.py | 2 +- setup.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.bumpversion.cfg b/.bumpversion.cfg index 3dc56c6c..3e490582 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = 1.30.0 +current_version = 1.30.1 commit = True tag = True diff --git a/craft_parts/__init__.py b/craft_parts/__init__.py index f3aad528..fa65bf03 100644 --- a/craft_parts/__init__.py +++ b/craft_parts/__init__.py @@ -16,7 +16,7 @@ """Craft a project from several parts.""" -__version__ = "1.30.0" +__version__ = "1.30.1" from . import plugins from .actions import Action, ActionProperties, ActionType diff --git a/setup.py b/setup.py index 83e78df8..e736277b 100644 --- a/setup.py +++ b/setup.py @@ -21,7 +21,7 @@ from setuptools import find_packages, setup -VERSION = "1.30.0" +VERSION = "1.30.1" with open("README.md") as readme_file: readme = readme_file.read() From 7d0c4cab808ea30bf6c0fdd1ea61357c9f141c66 Mon Sep 17 00:00:00 2001 From: Callahan Kovacs Date: Fri, 21 Jun 2024 12:14:56 -0500 Subject: [PATCH 7/7] docs(changelog): add 1.30.1 release notes Signed-off-by: Callahan Kovacs --- docs/changelog.rst | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/changelog.rst b/docs/changelog.rst index ab021c46..1218422b 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -2,6 +2,10 @@ Changelog ********* +1.30.1 (2024-06-21) +------------------- +- Fix list of ignored packages in core24 bases when fetching stage-packages + 1.30.0 (2024-05-16) ------------------- - Add support for armv8l