Skip to main content

C/C++ package and software development life cycle manager inspired by RUST cargo idea.

Project description

Scargo

Scargo project was written by Spyrosoft team. Find more information at spyro-soft.com.

drawing

Overview

This is the documentation for scargo - a Python-based C/C++ package and software development life cycle manager inspired by RUST cargo idea.

scargo can:

  • Create a new project (binary or library)
  • Build the project
  • Run static code analyzers
  • Fix chosen problem automatically based on the checker analysis
  • Run unit tests
  • Generate documentation from the source code
  • Work with the predefined docker environment depending on the chosen architecture

Installation

Scargo is available on pypi, so you can install it with pip:

pip install scargo

If system does not find 'scargo' command after installing, add the installation directory to your env paths. On Ubuntu you can find installation directory by running:

$ pip show "scargo"

Then add to PATH e.g.:

$ export PATH=~/.local/bin:${PATH}

Working with scargo

You can find all information on how to work with scargo on official documentation webpage: https://spyro-soft.github.io/scargo/index.html Scargo flow animation

Project dependencies

Working with docker (recommended)

Work environment

You can always change work environment between docker or native after project is created. Just edit the scargo.toml file ([project] -> build-env = "docker" or build-env = "native"). For it may be needed dependencies manually which are included in .devcontainer/Dockerfile

Its recommended to work in virtual environment (venv) or conda environment e.g.:

  • pip install virtualenv
  • virtualenv -p /usr/bin/python3.10 venv
  • source venv/bin/activate

Working in docker

  1. If you create a new project, run docker compose run scargo-dev to run project development image depending on chosen architecture. All dependencies should be already there. Run scargo commands as you would do natively.

  2. If you create a project with --docker flag (scargo new <my_proj> --docker ...) or with any docker flag, by default each scargo command will be triggered in docker.

Working natively

  1. Create a project with --no-docker flag (scargo new <my_proj> --no-docker ...).

Create the requirements for docker env

From version 2.3.2 the scargo is install in docker but overload by docker compose volume data, to get present version from your native env. During deployment the requirements file is created using following command

  • pip-compile --all-extras --output-file=ci/requirements.txt pyproject.toml
  • pip-compile --output-file=scargo/file_generators/templates/docker/requirements.txt.j2 pyproject.toml

to have all newest dependencies. This solutions allow as to have scargo install in docker for ci/cd and be able to use newest features without official releases.

Testing custom scargo generated project locally

You can make changes in scargo and install it locally using pip install . command when you are in the main project folder. To test the custom scargo version and have this custom scargo available also inside the docker (crucial for testing), in created project update docker-compose.yaml:

volumes:

  - ..:/workspace
  - /dev:/dev
  - ~/.local/lib/python3.10/site-packages/scargo:/usr/local/lib/python3.8/dist-packages/scargo

Where ~/.local/lib/python3.10/site-packages/scargo is a path to scargo on your local machine. It the following path is not working, find installation dir using pip show scargo.

To keep this setup between scargo update commands, in scargo.toml file update also update-exclude as in following example:

update-exclude = [".devcontainer/docker-compose.yaml"]

Known Issues

MacOs with ARM processors

  • On macOS devices with ARM processors (such as M1 and M3), USB device passthrough to Docker containers is not supported. While most development tasks can be performed within the Docker container, actions that involve direct interaction with USB devices, such as flashing firmware or monitoring hardware, must be executed natively on the host system.

Windows

  • On Windows devices, USB device passthrough is not supported in Docker containers when using Docker Desktop. To work around this limitation, you can use WSL2 (Windows Subsystem for Linux) or run a virtual machine with a Linux distribution like Ubuntu 22.04 to enable USB device access.

Potential issues

Docker permissions on Ubuntu

When using the docker-compose command, you may encounter permission errors due to insufficient permissions for accessing the Docker daemon socket. To resolve this issue, ensure that your user has the necessary permissions by adding your user to the docker group or granting appropriate access rights to the Docker daemon socket. To add your user to the docker group, run the following command:

  • newgroup docker
  • sudo usermod -aG docker $USER
  • sudo systemctl restart docker

Contributing

See contributing guide on https://spyro-soft.github.io/scargo/contributing.html

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

scargo-3.2.0.tar.gz (84.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

scargo-3.2.0-py3-none-any.whl (119.7 kB view details)

Uploaded Python 3

File details

Details for the file scargo-3.2.0.tar.gz.

File metadata

  • Download URL: scargo-3.2.0.tar.gz
  • Upload date:
  • Size: 84.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.28.2

File hashes

Hashes for scargo-3.2.0.tar.gz
Algorithm Hash digest
SHA256 b3a3d2599cd098962d04788320bafa87f4b6ad187dee8be69f537f2624e529af
MD5 dccf6b9c67d7f69e4443e28ad12e2b35
BLAKE2b-256 8bf01feb1b0cc9b62f1da5e1e09e030e7c2e0eb140841e5296c0bb3be64ce696

See more details on using hashes here.

File details

Details for the file scargo-3.2.0-py3-none-any.whl.

File metadata

  • Download URL: scargo-3.2.0-py3-none-any.whl
  • Upload date:
  • Size: 119.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.28.2

File hashes

Hashes for scargo-3.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 374f224033584bc23d1fa65fd35c7110441bbd2350260ad53691f52ee6a60c34
MD5 d2ffcd10825dc0d672f539afbcf75cbb
BLAKE2b-256 4b7e52add291e675e00c0085c18b73c7ee3bf276e3838f7aa8e89e81fc424bc0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page