-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into fastapi-framework
- Loading branch information
Showing
9 changed files
with
26 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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", "[email protected]" | ||
|
||
|
@@ -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_overridden(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 ( | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,7 +20,7 @@ | |
import os.path | ||
import posixpath | ||
import re | ||
from typing import Any, Dict, Tuple | ||
from typing import Any | ||
|
||
from overrides import override | ||
|
||
|
@@ -34,7 +34,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" | ||
|
||
|
@@ -59,7 +59,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: | ||
|
@@ -71,7 +71,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, | ||
|
@@ -113,7 +113,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: | ||
|
@@ -124,7 +124,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: { | ||
|
@@ -151,12 +151,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 {} | ||
|
||
|
@@ -183,7 +183,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] != "-": | ||
|
@@ -313,7 +313,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 { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters