scargo package
Subpackages
- scargo.commands package
- Submodules
- scargo.commands.build module
- scargo.commands.check module
- scargo.commands.clean module
- scargo.commands.debug module
- scargo.commands.doc module
- scargo.commands.docker module
- scargo.commands.fix module
- scargo.commands.flash module
- scargo.commands.gen module
- scargo.commands.monitor module
- scargo.commands.new module
- scargo.commands.publish module
- scargo.commands.run module
- scargo.commands.test module
- scargo.commands.update module
- scargo.commands.version module
- Module contents
- scargo.file_generators package
- Subpackages
- Submodules
- scargo.file_generators.base_gen module
- scargo.file_generators.cicd_gen module
- scargo.file_generators.cmake_gen module
- scargo.file_generators.conan_gen module
- scargo.file_generators.cpp_gen module
- scargo.file_generators.docker_gen module
- scargo.file_generators.env_gen module
- scargo.file_generators.mock_gen module
- scargo.file_generators.readme_gen module
- scargo.file_generators.tests_gen module
- scargo.file_generators.toml_gen module
- scargo.file_generators.ut_gen module
- scargo.file_generators.vscode_gen module
- Module contents
- scargo.target_helpers package
- scargo.utils package
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.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
- 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
- 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.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
- description: Optional[str]
- docker_file: Path
- docker_image_tag: str
- homepage_url: Optional[str]
- in_repo_conan_cache: bool
- lib_name: Optional[str]
- max_build_jobs: Optional[int]
- name: str
- 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
- 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_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.global_values module
Global values for scargo