Skip to content

Commit

Permalink
Merge branch 'main' into feature/pro-sources
Browse files Browse the repository at this point in the history
  • Loading branch information
linostar committed Dec 3, 2024
2 parents 238304b + 50cb666 commit a9bb1ae
Show file tree
Hide file tree
Showing 88 changed files with 6,772 additions and 671 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/release-publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ jobs:
- name: Release
uses: softprops/action-gh-release@v2
with:
# Generate release notes on the new GH release
generate_release_notes: true
# Add wheel and source tarball
files: |
*.whl
Expand Down
15 changes: 15 additions & 0 deletions .github/workflows/security-scan.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Security scan
on:
pull_request:
push:
branches:
- main
- hotfix/*
- work/secscan # For development

jobs:
python-scans:
name: Scan Python project
uses: canonical/starflow/.github/workflows/scan-python.yaml@main
with:
packages: python-apt-dev
13 changes: 7 additions & 6 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,6 @@ jobs:
3.10
3.12
cache: 'pip'
- name: Setup LXD
uses: canonical/[email protected]
with:
channel: latest/stable
- name: Configure environment
run: |
echo "::group::apt-get"
Expand Down Expand Up @@ -111,10 +107,12 @@ jobs:
cache: 'pip'
- name: Setup LXD
uses: canonical/[email protected]
with:
channel: latest/stable
- name: Configure environment
run: |
echo "::group::Begin snap install"
echo "Installing snaps in the background while running apt and pip..."
sudo snap install --no-wait --channel=candidate fetch-service
echo "::endgroup::"
echo "::group::apt-get"
sudo apt update
sudo apt-get install -y libapt-pkg-dev
Expand All @@ -123,6 +121,9 @@ jobs:
python -m pip install tox
echo "::endgroup::"
mkdir -p results
echo "::group::Wait for snap to complete"
snap watch --last=install
echo "::endgroup::"
- name: Setup Tox environments
run: tox run -e integration-${{ matrix.python }} --notest
- name: Integration tests
Expand Down
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v4.6.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
Expand All @@ -14,17 +14,17 @@ repos:
- id: mixed-line-ending
- repo: https://github.com/charliermarsh/ruff-pre-commit
# renovate: datasource=pypi;depName=ruff
rev: "v0.0.267"
rev: "v0.6.3"
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
- repo: https://github.com/psf/black
# renovate: datasource=pypi;depName=black
rev: "23.3.0"
rev: "24.8.0"
hooks:
- id: black
- repo: https://github.com/adrienverge/yamllint.git
# renovate: datasource=pypi;depName=yamllint
rev: "v1.31.0"
rev: "v1.35.1"
hooks:
- id: yamllint
2 changes: 1 addition & 1 deletion .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ sphinx:
build:
os: ubuntu-22.04
tools:
python: "3"
python: "3.12"

python:
install:
Expand Down
2 changes: 2 additions & 0 deletions craft_application/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
ProviderService,
ServiceFactory,
)
from craft_application._config import ConfigModel

try:
from ._version import __version__
Expand All @@ -42,6 +43,7 @@
"AppFeatures",
"AppMetadata",
"AppService",
"ConfigModel",
"models",
"ProjectService",
"LifecycleService",
Expand Down
37 changes: 37 additions & 0 deletions craft_application/_config.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# This file is part of craft-application.
#
# Copyright 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 License version 3, as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranties of MERCHANTABILITY,
# SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR PURPOSE.
# See the GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
"""Configuration model for craft applications."""
from __future__ import annotations

import craft_cli
import pydantic


class ConfigModel(pydantic.BaseModel):
"""A configuration model for a craft application."""

verbosity_level: craft_cli.EmitterMode = craft_cli.EmitterMode.BRIEF
debug: bool = False
build_environment: str | None = None
secrets: str

platform: str | None = None
build_for: str | None = None

parallel_build_count: int
max_parallel_build_count: int
lxd_remote: str = "local"
launchpad_instance: str = "production"
Loading

0 comments on commit a9bb1ae

Please sign in to comment.