diff --git a/docs/how-to/chisel/install-slice.rst b/docs/how-to/chisel/install-slice.rst index c5e81c316..a5eca0e05 100644 --- a/docs/how-to/chisel/install-slice.rst +++ b/docs/how-to/chisel/install-slice.rst @@ -74,7 +74,7 @@ section): The "build-context" part allows you to send the local ``chisel-releases`` folder into the builder. The "override-build" enables you to install your custom slice. -Please not that this level of customisation is only needed when you want to +Please note that this level of customisation is only needed when you want to install from a custom Chisel release. If the desired slice definitions are already upstream, then you can simply use ``stage-packages``, as demonstrated in :ref:`here `. diff --git a/pyproject.toml b/pyproject.toml index 22470f93c..c1d0142fb 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -73,28 +73,9 @@ strict = false module = ["craft_archives"] ignore_missing_imports = true -[tool.pylint.messages_control] -disable = "too-many-ancestors,too-few-public-methods,fixme,unspecified-encoding,use-implicit-booleaness-not-comparison,unnecessary-lambda-assignment,line-too-long,cyclic-import" - -[tool.pylint.similarities] -min-similarity-lines=12 - -[tool.pylint.format] -max-line-length = "88" -max-locals = 16 - -[tool.pylint.MASTER] -extension-pkg-whitelist = [ - "pydantic" -] -load-plugins = "pylint_pytest" -ignore-paths = [ - "rockcraft/_version.py" -] - [tool.ruff] line-length = 88 -target-version = "py38" +target-version = "py310" src = ["rockcraft", "tests"] extend-exclude = [ "docs", diff --git a/requirements-dev.txt b/requirements-dev.txt index b513f1b64..8051f3a7a 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -22,7 +22,7 @@ click==8.1.7 codespell==2.3.0 colorama==0.4.6 coverage==7.6.1 -craft-application==4.0.0 +craft-application==4.1.1 craft-archives==2.0.0 craft-cli==2.6.0 craft-grammar==2.0.0 diff --git a/requirements-doc.txt b/requirements-doc.txt index e525c443c..4bd789a41 100644 --- a/requirements-doc.txt +++ b/requirements-doc.txt @@ -16,7 +16,7 @@ cffi==1.17.0 charset-normalizer==3.3.2 click==8.1.7 colorama==0.4.6 -craft-application==4.0.0 +craft-application==4.1.1 craft-archives==2.0.0 craft-cli==2.6.0 craft-grammar==2.0.0 diff --git a/requirements.txt b/requirements.txt index f846c0a99..22f5461bc 100644 --- a/requirements.txt +++ b/requirements.txt @@ -3,7 +3,7 @@ boolean-py==4.0 certifi==2024.7.4 cffi==1.17.0 charset-normalizer==3.3.2 -craft-application==4.0.0 +craft-application==4.1.1 craft-archives==2.0.0 craft-cli==2.6.0 craft-grammar==2.0.0 diff --git a/rockcraft/extensions/go.py b/rockcraft/extensions/go.py index eb907f859..06e0608da 100644 --- a/rockcraft/extensions/go.py +++ b/rockcraft/extensions/go.py @@ -18,7 +18,7 @@ import os import re -from typing import Any, Dict, Tuple +from typing import Any from overrides import override @@ -31,7 +31,7 @@ class GoFramework(Extension): @staticmethod @override - def get_supported_bases() -> Tuple[str, ...]: + def get_supported_bases() -> tuple[str, ...]: """Return supported bases.""" return "bare", "ubuntu@24.04" @@ -46,7 +46,7 @@ def get_root_snippet(self) -> dict[str, Any]: """Return the root snippet to apply.""" self._check_project() - snippet: Dict[str, Any] = { + snippet: dict[str, Any] = { "run_user": "_daemon_", "services": { "go": { @@ -102,7 +102,7 @@ def _check_project(self) -> None: logpath_report=False, ) - def _get_install_app_part(self) -> Dict[str, Any]: + def _get_install_app_part(self) -> dict[str, Any]: """Generate install-app part with the Go plugin.""" install_app = self._get_nested( self.yaml_data, ["parts", "go-framework/install-app"] @@ -159,7 +159,7 @@ def _check_go_overriden(self) -> bool: return True return False - def _get_install_assets_part(self) -> Dict[str, Any] | None: + def _get_install_assets_part(self) -> dict[str, Any] | None: """Generate assets-stage part for extra assets in the project.""" # if stage is not in exclude mode, use it to generate organize if ( diff --git a/rockcraft/extensions/gunicorn.py b/rockcraft/extensions/gunicorn.py index f6ffd335b..0f4a255ef 100644 --- a/rockcraft/extensions/gunicorn.py +++ b/rockcraft/extensions/gunicorn.py @@ -22,7 +22,7 @@ import pathlib import posixpath import re -from typing import Any, Dict, Tuple +from typing import Any from overrides import override @@ -35,7 +35,7 @@ class _GunicornBase(Extension): @staticmethod @override - def get_supported_bases() -> Tuple[str, ...]: + def get_supported_bases() -> tuple[str, ...]: """Return supported bases.""" return "bare", "ubuntu@22.04", "ubuntu:22.04" @@ -60,7 +60,7 @@ def check_project(self) -> None: """Ensure this extension can apply to the current rockcraft project.""" @abc.abstractmethod - def gen_install_app_part(self) -> Dict[str, Any]: + def gen_install_app_part(self) -> dict[str, Any]: """Generate the content of *-framework/install-app part.""" def _gen_parts(self) -> dict: @@ -72,7 +72,7 @@ def _gen_parts(self) -> dict: stage_packages = ["python3.10-venv_ensurepip"] build_environment = [{"PARTS_PYTHON_INTERPRETER": "python3.10"}] - parts: Dict[str, Any] = { + parts: dict[str, Any] = { f"{self.framework}-framework/dependencies": { "plugin": "python", "stage-packages": stage_packages, @@ -114,7 +114,7 @@ def _gen_parts(self) -> dict: return parts @override - def get_root_snippet(self) -> Dict[str, Any]: + def get_root_snippet(self) -> dict[str, Any]: """Fill in some default root components. Default values: @@ -125,7 +125,7 @@ def get_root_snippet(self) -> Dict[str, Any]: - parts: see _GunicornBase._gen_parts """ self.check_project() - snippet: Dict[str, Any] = { + snippet: dict[str, Any] = { "run_user": "_daemon_", "services": { self.framework: { @@ -152,12 +152,12 @@ def get_root_snippet(self) -> Dict[str, Any]: return snippet @override - def get_part_snippet(self) -> Dict[str, Any]: + def get_part_snippet(self) -> dict[str, Any]: """Return the part snippet to apply to existing parts.""" return {} @override - def get_parts_snippet(self) -> Dict[str, Any]: + def get_parts_snippet(self) -> dict[str, Any]: """Return the parts to add to parts.""" return {} @@ -202,7 +202,7 @@ def is_experimental(base: str | None) -> bool: return False @override - def gen_install_app_part(self) -> Dict[str, Any]: + def gen_install_app_part(self) -> dict[str, Any]: source_files = [f.name for f in sorted(self.project_root.iterdir())] # if prime is not in exclude mode, use it to generate the stage and organize if self._app_prime and self._app_prime[0] and self._app_prime[0][0] != "-": @@ -332,7 +332,7 @@ def framework(self) -> str: return "django" @override - def gen_install_app_part(self) -> Dict[str, Any]: + def gen_install_app_part(self) -> dict[str, Any]: """Return the prime list for the Flask project.""" if "django-framework/install-app" not in self.yaml_data.get("parts", {}): return { diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml index c6ca38fcc..5a676488b 100644 --- a/snap/snapcraft.yaml +++ b/snap/snapcraft.yaml @@ -78,8 +78,11 @@ parts: - requirements.txt build-attributes: - enable-patchelf + build-packages: + - cargo build-environment: - "CFLAGS": "$(pkg-config python-3.10 yaml-0.1 --cflags)" + - "PIP_NO_BINARY": ":all:" organize: bin/craftctl: libexec/rockcraft/craftctl override-build: | diff --git a/spread.yaml b/spread.yaml index 74860b627..047441ed4 100644 --- a/spread.yaml +++ b/spread.yaml @@ -62,8 +62,9 @@ prepare: | tests.pkgs remove lxd fi - # 5.21/stable is the latest stable LTS - snap install lxd --channel=5.21/stable + # 5.21/stable is the latest stable LTS. Use 5.21/candidate as a "first line of + # defense" against LXD regressions. + snap install lxd --channel=5.21/candidate # Hold snap refreshes for 24h. snap set system refresh.hold="$(date --date=tomorrow +%Y-%m-%dT%H:%M:%S%:z)"