scargo package

Subpackages

Submodules

scargo.cli module

scargo.cli.build(profile: str = <typer.models.OptionInfo object>, target: ~typing.Optional[~scargo.config.ScargoTarget] = <typer.models.OptionInfo object>, all_targets: bool = <typer.models.OptionInfo object>, base_dir: ~typing.Optional[~pathlib.Path] = <typer.models.OptionInfo object>) None[source]

Compile sources.

scargo.cli.check(clang_format: bool = <typer.models.OptionInfo object>, clang_tidy: bool = <typer.models.OptionInfo object>, copy_right: bool = <typer.models.OptionInfo object>, cppcheck: bool = <typer.models.OptionInfo object>, cyclomatic: bool = <typer.models.OptionInfo object>, pragma: bool = <typer.models.OptionInfo object>, todo: bool = <typer.models.OptionInfo object>, silent: bool = <typer.models.OptionInfo object>, base_dir: ~typing.Optional[~pathlib.Path] = <typer.models.OptionInfo object>) None[source]

Check source code in directory src.

scargo.cli.clean(base_dir: ~typing.Optional[~pathlib.Path] = <typer.models.OptionInfo object>) None[source]

Remove directory build.

scargo.cli.debug(bin_path: ~typing.Optional[~pathlib.Path] = <typer.models.OptionInfo object>, target: ~typing.Optional[~scargo.config.ScargoTarget] = <typer.models.OptionInfo object>, base_dir: ~typing.Optional[~pathlib.Path] = <typer.models.OptionInfo object>) None[source]

Use gdb cli to debug

scargo.cli.doc(open_doc: bool = <typer.models.OptionInfo object>, base_dir: ~typing.Optional[~pathlib.Path] = <typer.models.OptionInfo object>) None[source]

Create project documentation

scargo.cli.docker_build(docker_opts: ~typing.List[str] = <typer.models.ArgumentInfo object>, base_dir: ~typing.Optional[~pathlib.Path] = <typer.models.OptionInfo object>) None[source]

Build docker layers for this project depending on the target

scargo.cli.docker_exec(base_dir: ~typing.Optional[~pathlib.Path] = <typer.models.OptionInfo object>, docker_opts: ~typing.List[str] = <typer.models.ArgumentInfo object>) None[source]

Attach to existing docker environment

scargo.cli.docker_run(command: str = <typer.models.OptionInfo object>, base_dir: ~typing.Optional[~pathlib.Path] = <typer.models.OptionInfo object>, docker_opts: ~typing.List[str] = <typer.models.ArgumentInfo object>) None[source]

Run project in docker environment

scargo.cli.fix(clang_format: bool = <typer.models.OptionInfo object>, copy_right: bool = <typer.models.OptionInfo object>, pragma: bool = <typer.models.OptionInfo object>, base_dir: ~typing.Optional[~pathlib.Path] = <typer.models.OptionInfo object>) None[source]

Fix violations reported by command check.

scargo.cli.flash(flash_profile: str = <typer.models.OptionInfo object>, port: ~typing.Optional[str] = <typer.models.OptionInfo object>, target: ~typing.Optional[~scargo.config.ScargoTarget] = <typer.models.OptionInfo object>, app: bool = <typer.models.OptionInfo object>, file_system: bool = <typer.models.OptionInfo object>, no_erase: bool = <typer.models.OptionInfo object>, bank: ~typing.Optional[int] = <typer.models.OptionInfo object>, base_dir: ~typing.Optional[~pathlib.Path] = <typer.models.OptionInfo object>) None[source]

Flash the target.

scargo.cli.gen(profile: str = <typer.models.OptionInfo object>, gen_ut: ~typing.Optional[~pathlib.Path] = <typer.models.OptionInfo object>, gen_mock: ~typing.Optional[~pathlib.Path] = <typer.models.OptionInfo object>, certs: ~typing.Optional[str] = <typer.models.OptionInfo object>, certs_mode: ~typing.Optional[str] = <typer.models.OptionInfo object>, certs_input: ~typing.Optional[~pathlib.Path] = <typer.models.OptionInfo object>, certs_passwd: ~typing.Optional[str] = <typer.models.OptionInfo object>, file_system: bool = <typer.models.OptionInfo object>, single_bin: bool = <typer.models.OptionInfo object>, base_dir: ~typing.Optional[~pathlib.Path] = <typer.models.OptionInfo object>) None[source]

Manage the auto file generator

scargo.cli.monitor(port: str = <typer.models.OptionInfo object>, baudrate: ~typing.Optional[int] = <typer.models.OptionInfo object>, base_dir: ~typing.Optional[~pathlib.Path] = <typer.models.OptionInfo object>) None[source]

Monitor the target over serial port

scargo.cli.new(project_name: str, bin_name: ~typing.Optional[str] = <typer.models.OptionInfo object>, lib_name: ~typing.Optional[str] = <typer.models.OptionInfo object>, targets: ~typing.List[~scargo.config.ScargoTarget] = <typer.models.OptionInfo object>, chip: ~typing.List[str] = <typer.models.OptionInfo object>, create_docker: bool = <typer.models.OptionInfo object>, git: bool = <typer.models.OptionInfo object>, base_dir: ~typing.Optional[~pathlib.Path] = <typer.models.OptionInfo object>) None[source]

Create new project template.

scargo.cli.publish(repo: str = <typer.models.OptionInfo object>, profile: str = <typer.models.OptionInfo object>, base_dir: ~typing.Optional[~pathlib.Path] = <typer.models.OptionInfo object>) None[source]

Upload conan pkg to repo

scargo.cli.run(bin_path: ~typing.Optional[~pathlib.Path] = <typer.models.OptionInfo object>, profile: str = <typer.models.OptionInfo object>, skip_build: bool = <typer.models.OptionInfo object>, bin_params: ~typing.List[str] = <typer.models.ArgumentInfo object>, base_dir: ~typing.Optional[~pathlib.Path] = <typer.models.OptionInfo object>) None[source]

Run project bin file

scargo.cli.test(verbose: bool = <typer.models.OptionInfo object>, profile: str = <typer.models.OptionInfo object>, detailed_coverage: bool = <typer.models.OptionInfo object>, base_dir: ~typing.Optional[~pathlib.Path] = <typer.models.OptionInfo object>) None[source]

Compile and run all tests in directory test.

scargo.cli.update(config_file_path: ~typing.Optional[~pathlib.Path] = <typer.models.OptionInfo object>, base_dir: ~typing.Optional[~pathlib.Path] = <typer.models.OptionInfo object>) None[source]

Read config file and update project files

scargo.cli.version() None[source]

Get scargo version

scargo.config module

class scargo.config.ATSAMConfig(*, chip: str = 'ATSAML10E16A', cpu: str)[source]

Bases: BaseModel

chip: str
property chip_series: str
cpu: str
class scargo.config.CheckConfig(*, description: Optional[str] = None, exclude: List[str] = None)[source]

Bases: BaseModel

description: Optional[str]
exclude: List[str]
class scargo.config.ChecksConfig(*, exclude: List[str], pragma: CheckConfig, copyright: CheckConfig, todo: TodoCheckConfig, cppcheck: CppCheckConfig, cyclomatic: CheckConfig, **extra_data: Any)[source]

Bases: BaseModel

clang_format: CheckConfig
clang_tidy: CheckConfig
copyright: CheckConfig
cppcheck: CppCheckConfig
cyclomatic: CheckConfig
exclude: List[str]
pragma: CheckConfig
todo: TodoCheckConfig
class scargo.config.ConanConfig(*, repo: Dict[str, str])[source]

Bases: BaseModel

repo: Dict[str, str]
class scargo.config.Config(*, project: ProjectConfig, profile: Dict[str, ProfileConfig], check: ChecksConfig, fix: FixesConfig = None, doc: DocConfig = None, tests: TestConfig, dependencies: Dependencies, conan: ConanConfig, atsam: Optional[ATSAMConfig] = None, stm32: Optional[Stm32Config] = None, esp32: Optional[Esp32Config] = None, scargo: ScargoConfig = None, project_root: Path, **extra_data: Any)[source]

Bases: BaseModel

atsam: Optional[ATSAMConfig]
check: ChecksConfig
conan: ConanConfig
dependencies: Dependencies
doc: DocConfig
docker_compose: DockerComposeConfig
esp32: Optional[Esp32Config]
fix: FixesConfig
get_atsam_config() ATSAMConfig[source]
get_esp32_config() Esp32Config[source]
get_stm32_config() Stm32Config[source]
property include_dir_path: Path
profiles: Dict[str, ProfileConfig]
project: ProjectConfig
project_root: Path
scargo: ScargoConfig
property source_dir_path: Path
stm32: Optional[Stm32Config]
tests: TestConfig
classmethod validate_special_configs(values: Dict[str, Any]) Dict[str, Any][source]
exception scargo.config.ConfigError[source]

Bases: Exception

class scargo.config.CppCheckConfig(*, description: Optional[str] = None, exclude: List[str] = None, suppress: List[str] = [], directories: List[str] = [])[source]

Bases: BaseModel

description: Optional[str]
directories: List[str]
exclude: List[str]
suppress: List[str]
class scargo.config.Dependencies(*, general: List[str] = None, build: List[str] = None, tool: List[str] = None, test: List[str] = None)[source]

Bases: BaseModel

build: List[str]
general: List[str]
test: List[str]
tool: List[str]
class scargo.config.DocConfig(*, exclude: List[str] = None)[source]

Bases: BaseModel

exclude: List[str]
class scargo.config.DockerComposeConfig(*, ports: List[str] = None)[source]

Bases: BaseModel

ports: List[str]
class scargo.config.Esp32Config(*, chip: str = 'esp32', extra_component_dirs: List[Path] = ['src'], partitions: List[str] = ['nvs,      data, nvs,     0x9000,  0x4000,', 'otadata,  data, ota,     0xd000,  0x2000,', 'phy_init, data, phy,     0xf000,  0x1000,', 'ota_0,    app,  ota_0,   0x10000, 0x180000,', 'ota_1,    app,  ota_1,   0x190000,0x180000,', 'spiffs,   data, spiffs,  0x310000,0x6000,'])[source]

Bases: BaseModel

chip: str
extra_component_dirs: List[Path]
partitions: List[str]
class scargo.config.FixConfig(*, description: Optional[str] = None)[source]

Bases: BaseModel

description: Optional[str]
class scargo.config.FixesConfig(*, copyright: FixConfig = None)[source]

Bases: BaseModel

copyright: FixConfig
class scargo.config.ProfileConfig(*, cflags: Optional[str] = None, cxxflags: Optional[str] = None, cc: Optional[str] = None, cxx: Optional[str] = None, **extra_data: Any)[source]

Bases: BaseModel

cc: Optional[str]
cflags: Optional[str]
cmake_build_type: Optional[str]
cxx: Optional[str]
cxxflags: Optional[str]
property extras: Dict[str, Any]
class scargo.config.ProjectConfig(*, name: str, version: str, description: Optional[str] = None, bin_name: Optional[str] = None, lib_name: Optional[str] = None, target: Union[str, List[str]], cc: Optional[str] = None, cxx: Optional[str] = None, cxxstandard: str, cflags: str, cxxflags: str, **extra_data: Any)[source]

Bases: BaseModel

bin_name: Optional[str]
build_env: str
cc: Optional[str]
cflags: str
cmake_variables: Dict[str, str]
cxx: Optional[str]
cxxflags: str
cxxstandard: str
property default_target: Target
description: Optional[str]
docker_file: Path
docker_image_tag: str
homepage_url: Optional[str]
in_repo_conan_cache: bool
is_atsam() bool[source]
is_docker_buildenv() bool[source]
is_esp32() bool[source]
is_multitarget() bool[source]
is_stm32() bool[source]
is_x86() bool[source]
lib_name: Optional[str]
max_build_jobs: Optional[int]
name: str
property target: List[Target]
target_id: Union[str, List[str]]
version: str
class scargo.config.ScargoConfig(*, version: Optional[str] = None, **extra_data: Any)[source]

Bases: BaseModel

console_log_level: str
file_log_level: str
update_exclude: List[str]
version: Optional[str]
class scargo.config.ScargoTarget(value)[source]

Bases: Enum

An enumeration.

atsam = 'atsam'
esp32 = 'esp32'
stm32 = 'stm32'
x86 = 'x86'
class scargo.config.Stm32Config(*, chip: str = 'STM32L496AG', **extra_data: Any)[source]

Bases: BaseModel

chip: str
flash_start: int
class scargo.config.Target(*, id: str, elf_file_extension: str, cc: Optional[str] = None, cxx: Optional[str] = None)[source]

Bases: BaseModel

cc: Optional[str]
cxx: Optional[str]
elf_file_extension: str
get_bin_dir_path(profile: str = 'Debug') str[source]
get_bin_path(bin_name: str, profile: str = 'Debug') str[source]
get_conan_profile_name(profile: str = 'Debug') str[source]
get_profile_build_dir(profile: str = 'Debug') str[source]
classmethod get_target_by_id(target_id: str) Target[source]
classmethod get_targets_by_id(target_ids: List[str]) List[Target][source]
id: str
class scargo.config.TestConfig(*, cc: str, cxx: str, cflags: str, cxxflags: str, **extra_data: Any)[source]

Bases: BaseModel

cc: str
cflags: str
cxx: str
cxxflags: str
property extras: Dict[str, Any]
gcov_executable: str
class scargo.config.TodoCheckConfig(*, description: Optional[str] = None, exclude: List[str] = None, keywords: List[str] = None)[source]

Bases: CheckConfig

keywords: List[str]
scargo.config.parse_config(config_file_path: Path) Config[source]

scargo.config_utils module

scargo.config_utils.add_version_to_scargo_lock(scargo_lock: Path) None[source]
Returns

project configuration as dict

scargo.config_utils.check_scargo_version(config: Config) None[source]

Check scargo version

Parameters

config (Config) – project configuration

Returns

None

scargo.config_utils.get_scargo_config_or_exit(config_file_path: Optional[Path] = None) Config[source]

:param config_file_path :return: project configuration as dict

scargo.config_utils.get_target_or_default(config: Config, target: Optional[ScargoTarget]) Target[source]
scargo.config_utils.prepare_config(run_in_docker: bool = True) Config[source]

Prepare configuration file and set up eniromnent variables

Returns

project configuration

scargo.config_utils.set_up_environment_variables(config: Config) None[source]

scargo.global_values module

Global values for scargo

scargo.logger module

scargo.logger.get_logger(name: str = 'scargo') Logger[source]

Module contents