Metadata-Version: 2.1
Name: scargo
Version: 3.2.1
Summary: C/C++ package and software development life cycle manager inspired by RUST cargo idea.
Keywords: scargo,Package manager,C++
Author-email: "Spyrosoft Solutions S.A." <aak@spyro-soft.com>, Andrzej Aksenczuk <andrzej.aksenczuk@gmail.com>
Requires-Python: >=3.8
Description-Content-Type: text/markdown
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: Natural Language :: English
Classifier: Operating System :: POSIX
Classifier: Operating System :: Microsoft :: Windows
Classifier: Operating System :: MacOS :: MacOS X
Classifier: Topic :: Software Development :: Embedded Systems
Classifier: Environment :: Console
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Requires-Dist: clang==17.0.6
Requires-Dist: cmake==3.30.5
Requires-Dist: coloredlogs==15.0.1
Requires-Dist: conan==2.8.1
Requires-Dist: docker==7.1.0
Requires-Dist: esptool==4.7.0
Requires-Dist: gcovr==8.2
Requires-Dist: jinja2==3.1.4
Requires-Dist: libclang==18.1.1
Requires-Dist: lizard==1.17.10
Requires-Dist: pydantic==1.10.6
Requires-Dist: toml==0.10.2
Requires-Dist: tomlkit==0.13.2
Requires-Dist: typer==0.9.0
Requires-Dist: click==8.1.3
Requires-Dist: typing-extensions==4.6.0
Requires-Dist: paramiko==3.5.0
Requires-Dist: pyyaml==6.0.2
Requires-Dist: black==24.8.0 ; extra == "dev"
Requires-Dist: coverage~=7.6.1 ; extra == "dev"
Requires-Dist: flake8>=6.1.0 ; extra == "dev"
Requires-Dist: flit==3.8.0 ; extra == "dev"
Requires-Dist: isort==5.11.4 ; extra == "dev"
Requires-Dist: matplotlib==3.7.5 ; extra == "dev"
Requires-Dist: mypy==1.14.1 ; extra == "dev"
Requires-Dist: numpy>=1.26.0 ; extra == "dev"
Requires-Dist: pre-commit ; extra == "dev"
Requires-Dist: pyclean==3.0.0 ; extra == "dev"
Requires-Dist: pyelftools ; extra == "dev"
Requires-Dist: pyfakefs==5.3.2 ; extra == "dev"
Requires-Dist: pylint==3.2.7 ; extra == "dev"
Requires-Dist: pytest-cov==4.1.0 ; extra == "dev"
Requires-Dist: pytest-mock==3.12.0 ; extra == "dev"
Requires-Dist: pytest-subprocess==1.5.0 ; extra == "dev"
Requires-Dist: pytest==7.4.3 ; extra == "dev"
Requires-Dist: pytest-lazy-fixture==0.6.3 ; extra == "dev"
Requires-Dist: pytest-xdist==3.5.0 ; extra == "dev"
Requires-Dist: pytest-order==1.2.0 ; extra == "dev"
Requires-Dist: types-clang==0.14.3 ; extra == "dev"
Requires-Dist: types-toml ; extra == "dev"
Requires-Dist: unittest-xml-reporting ; extra == "dev"
Requires-Dist: pyopenssl==23.2.0 ; extra == "dev"
Requires-Dist: types-pyOpenSSL==23.2.0 ; extra == "dev"
Requires-Dist: types-PyYAML==6.0.12.12 ; extra == "dev"
Requires-Dist: pip-tools==7.4.1 ; extra == "dev"
Requires-Dist: recommonmark ; extra == "doc"
Requires-Dist: sphinx-rtd-theme==1.1.1 ; extra == "doc"
Requires-Dist: Sphinx ; extra == "doc"
Requires-Dist: sphinxcontrib-plantuml==0.30 ; extra == "doc"
Project-URL: Documentation, https://spyro-soft.github.io/scargo/index.html
Project-URL: Source, https://github.com/spyro-soft/scargo
Project-URL: Tracker, https://github.com/Spyro-Soft/scargo/issues
Provides-Extra: dev
Provides-Extra: doc

# Scargo
Scargo project was written by Spyrosoft team. Find more information at [spyro-soft.com](https://spyro-soft.com/career).
<p align="center">
    <img src="https://raw.githubusercontent.com/Spyro-Soft/scargo/develop/docs/source/_static/spyrosoft_solutions_logo_color.png" alt="drawing" width="200"/>
</p>

# 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
## Installing scargo on Ubuntu 24.04+ (PEP 668-compliant systems)

Ubuntu 24.04 and newer follow PEP 668, which restricts the use of pip in the system Python environment to prevent accidental damage to system-managed packages.

To safely install scargo, use a virtual environment:

```
python3.12 -m venv .venv
source .venv/bin/activate
pip install --upgrade pip
pip install scargo==3.2.0
```

This ensures isolated and conflict-free usage of scargo without requiring elevated privileges or --break-system-packages.

Alternatively, you may use pipx for global CLI installation:

```
pipx install scargo==3.2.0
```
## Install on ubuntu <=22.04, windows or macos
Scargo is available on [pypi](https://pypi.org/project/scargo/), 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](https://raw.githubusercontent.com/Spyro-Soft/scargo/develop/docs/source/_static/scargo_flow_docker.svg)

# Project dependencies
## Working with docker (recommended)
- docker with docker-compose - https://docs.docker.com/engine/install/ubuntu/
- pip
- python3 - `sudo apt install python3.10-venv python3.10-distutils -y`

# 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

