Skip to content

Commit

Permalink
Merge branch 'main' into django-tutorial
Browse files Browse the repository at this point in the history
  • Loading branch information
jdkandersson committed Sep 9, 2024
2 parents 6e7df1c + 371bc72 commit 5de6c3f
Show file tree
Hide file tree
Showing 9 changed files with 26 additions and 41 deletions.
2 changes: 1 addition & 1 deletion docs/how-to/chisel/install-slice.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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 <chisel-example>`.
Expand Down
21 changes: 1 addition & 20 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion requirements-doc.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 5 additions & 5 deletions rockcraft/extensions/go.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

import os
import re
from typing import Any, Dict, Tuple
from typing import Any

from overrides import override

Expand All @@ -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", "[email protected]"

Expand All @@ -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": {
Expand Down Expand Up @@ -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"]
Expand Down Expand Up @@ -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 (
Expand Down
20 changes: 10 additions & 10 deletions rockcraft/extensions/gunicorn.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import pathlib
import posixpath
import re
from typing import Any, Dict, Tuple
from typing import Any

from overrides import override

Expand All @@ -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", "[email protected]", "ubuntu:22.04"

Expand All @@ -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:
Expand All @@ -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,
Expand Down Expand Up @@ -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:
Expand All @@ -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: {
Expand All @@ -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 {}

Expand Down Expand Up @@ -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] != "-":
Expand Down Expand Up @@ -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 {
Expand Down
3 changes: 3 additions & 0 deletions snap/snapcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand Down
5 changes: 3 additions & 2 deletions spread.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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)"
Expand Down

0 comments on commit 5de6c3f

Please sign in to comment.