depmanager


Namedepmanager JSON
Version 0.4.2.2 PyPI version JSON
download
home_pageNone
SummarySimple Dependency manager
upload_time2025-10-26 22:34:40
maintainerNone
docs_urlNone
authorNone
requires_python>=3.9
licenseNone
keywords dependency development cmake c++
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # DepManager

[![PyPI](https://img.shields.io/pypi/v/depmanager)](https://pypi.org/project/depmanager)
[![Download](https://static.pepy.tech/badge/depmanager)](https://pepy.tech/project/depmanager)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)

Depmanager is a minimalistic tool to manage dependencies (also known as third-party
libraries) of a C++ Project. It works closely with cmake tool.

It allows to store dependencies in a distant repository to share builds with other and
have a local cache project-independent.

## Installation

Depmanager is written in python so in the following we assume you have a
working python installation designated as `<python>` with `pip` installed.

### pip

To install dep manager simply use `<python> -m pip  install depmanager`

See the page on Pypi: [depmanager](https://pypi.org/project/depmanager/).

### From source

Prerequisite: python module 'build' install it with `<python> -m pip install build`

Clone the gitHub repository.

In the source root do:

```powershell
<python> -m build
<python> -m pip install dist/depmanager-x.y.z-py3-none-any.whl
```

## Commandline use

### Get help

For any command or sub-command adding `--help` or `-h` to get help
on parameters or usage.

### Generalities

In the base command you can find:

| command | subcommands                | description                        |
|---------|----------------------------|------------------------------------|
| info    | basedir, cmakedir, version | info on local instance             |
| get     |                            | Get the config package             |
| pack    | pull, push, add, rm, ls    | Manage packages                    |
| remote  | list, ls, add, rm, info    | Manage the list of distant servers |
| build   |                            | Build a new package                |
| toolset | list, ls, add, rm          | Manage toolsets                    |

In the following, `<query>` designate something representing the dependency's description.
The syntax reads:  `--predicate(-p) <name>:<version> --type(-t)
<type> --os(-o) <os> --arch(-a) <arch> --abi(-c) <abi> --glibc <glibc>`

Valid values for `type`: `shared`, `static`, `header`.

Valid values for `os` : `Windows`, `Linux` (default: host os)

Valid values for `arch` : `x86_64`, `aarch64` (default: host arch)

Valid values for `abi` : `gnu`, `llvm` or `msvc` (default: `gnu`)
Note: clang compiler stands for `gnu` if using libstdc++ or `llvm` when using libc++ while clang-cl stands for `msvc`.

Valid values for `glibc` are only needed for linux. By giving, a value the system will look at
package with compatible version will be search (i.e. wit a version number lower or equal).
It is still possible to do an exact search by using `=` as first character. (like `--glibc =2.36`)

Also, we will designate `<remote>` as a description a remote server, syntax reads: `[-n <name>|-d]`.
If nothing given, we assume 'local'. If `-d` given, use the default remote, else use the remote by
its name.

If the name does not exist, it will fall back to default then to local.

## Base commands

### info

Subcommands:

* `version` gives the version of the local manager.
* `basedir` gives the path to the local data of the manager
* `cmakedir` gives the path to add to `CMAKE_MODULE_PATH` before include `ExternalDependencyManager`

### get

`depmanager get <query>`

Get path to cmake config of the 'best' package given by the query information.

The command will first search in the local cache, if not found it will search in the default remote. This does not
intent for human use but more for
cmake integration.

### pack

Actions on packages.

#### ls

`depmanager pack ls <query> [--transitive(-t)] <remote>` Simply do a search in the given remote (in local if
nothing given) and print the result.

The `--transitive(-t)` flag will allow to use transitive query, meaning to search for local then remote.

#### add, rm

`depmanager pack add <location>` Will add a package to the local database. `<location>` can be a
folder, then it must contain a properly formatted `edp.info` file. Or an archive (.zip, .tgz or .tar.gz
file format allowed). The uncompressed archive must contain a properly formatted `edp.info` file.

`depmanager pack rm <query> <remote> [-r]` Will remove from local cache all package matching the query.

The `-r` option allows operation on multiple packages (local only), else the command will return an error if multiple
package matches the query.

#### push, pull

`depmanager pack [push|pull] <query> <remote> [--force(-f)] [-r]` will synchronize Local cache with the remote.
The `query` must be precise enough to match one and only one package. `remote` must be valid.

`push` will look for the package in local cache that match the query and send it to the given remote.

`pull` will look for the package in given remote that match the query and bring it to the local cache.

If `--force` is given, The transfer occurs even if the package already exists in the destination.

The `-r` option allows operation on multiple packages. If multiple versions, only the highest one will be used.

#### clean

`depmanager pack clean [--full(-f)]` Will clean the local repository by removing old packages, only the newest
version of each package is kept.

The `[--full(-f)]` option will make the clean operation applies to all package, thus emptying the local database.

### remote

Manage the list of remote servers
subcommands:

* `list` or `ls` lists the defined remote server.
* `add` adds a new remote to the list.
    * `--name(-n) <name> --url(-u) <proto>://<url[:port]> [--default(-d)]`.
    * Mandatory. If name already exists it will modify the existing one.
    * Allowed proto are:
        * `ftp` supports login
        * `folder` a folder of your computer (mostly for debug or testing)
        * `srv` a dedicated server see [gitHub](https://github.com/Silmaen/DepManagerServer)
        * `srvs` a dedicated server with secure connexion see [gitHub](https://github.com/Silmaen/DepManagerServer)
    * Login can be defined with: `--login(-l) <login> --passwd(-p) <passwd>`.
* `rm <remote>` remove the designated remote if exists.
* `sync <remote> [--push-only|--pull-only] [--dry-run]` push to remote all local package that does not already
  exist on remote. Pull local package that have a newer version on the remote. If no remote given, it will use the
  default one.
* `info <remote>` gets information from the remote: type and version.

### toolset

Manage the toolset list.

* `list` or `ls` for listing the toolsets.
* `add` add a new toolset to the list
    * `--name(-n) <name> --compiler(-c) <compiler_path> [--abi(-b) <abi>`
* `rm --name(-n) <name>` remove a toolset

### build

`depmanager build [OPTIONS] <location>` will search for recipe in the given location and build them.

See the section [Create you own package](#create-your-own-package) for more details.

## Using package with cmake

### Include depmanager to cmake

To initialize depmanager into cmake you need to add to `CMAKE_MODULE_PATH` the path
to the cmake folder of this installation.

Here is a small cmake code snippet to initialize depmanager in cmake.

```cmake
# add HINTS or PATH to find the executable if not in the PATH
find_program(EDEPMANAGER depmanager)
if (${EDEPMANAGER} STREQUAL EDEPMANAGER-NOTFOUND)
    message(FATAL_ERROR "Dependency manager not found.")
else ()
    execute_process(COMMAND ${EDEPMANAGER} info cmakedir
            OUTPUT_VARIABLE depmanager_path)
    string(STRIP ${depmanager_path} depmanager_path)
    list(PREPEND CMAKE_MODULE_PATH ${depmanager_path})
    include(DepManager)
endif ()
```

### Automated mode

In automated mode, depmanager can automatically set a remote repository, retrieve packages from this repository
and load then in one command.

#### The command

```cmake
dm_load_environment(
        [QUIET]
        [PATH path]
        [KIND kind]
        [ARCH target_arch]
        [OS target_os]
        [ABI target_abi]
        [GLIBC target_glibc]
) 
```

If `QUIET` set, only errors are written.

`path` is the path to the configuration file, either directly a configuration file name,
or a directory containing a file named `depmanager.yml`. By default, it will look at the
project root. See the next paragraph for more information about configuration file.

`kind` is used to force library kind (`shared`, `static`, `header`). By default, it uses
the value from `BUILD_SHARED_LIBS`.

`target_arch`, `target_os`, `target_abi`, `target_glibc` are used in the query. If not set, default
values are `CMAKE_SYSTEM_PROCESSOR`, `CMAKE_SYSTEM_NAME` and `CMAKE_CXX_COMPILER_ID`

The cmake function will update the CMAKE variable for the search of package.

After call this command, the cmake user has to call for needed `find_package`.

#### Configuration file

The configuration file is a yaml file. Here is an example with explication in comment.

```yaml
remote:
  # If server is defined, depmanager will add this server to its
  # database (if not already there)
  server:
    # Same parameter as command-line (also the required)
    name: "my_server"
    kind: "srvs"
    url: "https://packages.example.net"
    login: "foo"
    passwd: "bar"
  # If package not found locally, do you allow for download?
  pull: true
  # If newer remote package exists, download it? (implies 'pull')
  pull-newer: true
packages:
  # list the needed packages.
  fmt:
    # version 'at least'
    version: ">=10.1.0"
  spdlog:
    # exact version
    version: "1.12.0"
  debugbreak:
    # if not found locally, don't pull, nor error.
    optional: true
  glm:
    version: "0.9.9.9"
    # force the shared version even in static build mode.
    kind: "shared"
  glfw:
    # use this only for the (same for arch, and abi)
    os: Linux
```

### Manual mode

In manual mode you should load or find each package individually.
You should also manually set the remote and download the package.

#### Find packages

With depmanager initialized in cmake, it provides an alternative to classical `find_package`
of cmake by `dm_find_package`

```cmake
dm_find_package(
        package
        [QUIET] [TRACE] [REQUIRED]
        [VERSION version]
        [KIND kind]
        [ARCH target_arch]
        [OS target_os]
        [ABI target_abi]
        [GLIBC target_glibc]
)
```

`package` is the package name to find.

`version` is the exact version to match (wildcard are allowed). By default, find the
latest one.

`kind` is used to force library kind (`shared`, `static`, `header`). By default, it returns
the first found.

If `REQUIRED` set, the function will give an error if no package found.
(same as original `find_package`)

If `QUIET` set, only errors are written. (same as original `find_package`). In opposition,
if `TRACE` set, many more debug message displayed.

`target_arch`, `target_os`, `target_abi` `target_glibc` are used in the query. If not set, default
values are `CMAKE_SYSTEM_PROCESSOR`, `CMAKE_SYSTEM_NAME` and `CMAKE_CXX_COMPILER_ID`

**LIMITATION:** it requires the library name is the package name. So no multi lib or lib with different name.

#### Load package

This command is similar to the previous one, but does not directly do a cmake's `find_package`.
It only adds to the `CMAKE_PREFIX_PATH` list the folders of given package.

```cmake
dm_load_package(
        package
        [REQUIRED] [TRACE]
        [VERSION version]
        [KIND kind]
        [ARCH target_arch]
        [OS target_os]
        [ABI target_abi]
        [GLIBC target_glibc]
)
```

After call this command, the cmake user has to call for needed `find_package`.

## Create your own package

Depmanager allow you to create your own packages by defining recipes. Then run
`depmanager build <location of recipes> [OPTIONS]`
The program will then build and add dependencies to the local cache.

The location can contain as many recipe in any number of files.

The search behavior can bve set as recursive with option `--recursive,-r`. As sometimes, sources also contains python
files that may fail to load, the depth of recursion can be restrained using `--recursive-depth <n>`.

By default, a package will not be build if already exists in the local cache. You can force the rebuild with the
option `--force,-f`.

By default, the builder will use all the cpu cores, but `--single-thred,-s` will force to use only one core.

Cross-compilation can be used by giving the tools at command
line: `--cross-c <C_COMPILER> --cross-cxx <CXX_COMPILER> --cross-arch <TARGET_ARCH> --cross-os <TARGET_OS>`

A defined toolset can be used by giving its name: `--toolset,-t <TOOLSET_NAME>`.

It is also possible to give a remote name `-n <remote_name>` or set to default remote `-d`. This way,
The builder will look into remote to see if a package already exists and pull it instead of building it.
Also, after a successful build, it will automatically push to the remote. Use either `--no-pull`and `--no-push`
option to skip these steps.

A `--dry-run` option will do all the checks and print the results but no pull, build and push action will be done.

### The recipe

During build, Depmanager will look in all `.py` file for class that inherits from
depmanager.api.recipe.Recipe.

As for dependency usage, build also rely on cmake for building.

The builder will use the provided recipe in the following workflow:

* Init recipe
* Call `recipe.source()`
* Call `recipe.configure()`
* Initialize options based on recipe data
* Run cmake configure
* For all configuration (mostly 'Debug', 'Release')
    * build target `install`
* Call `recipe.install()`
* Generate edp.info file
* Import into local cache
* Call `recipe.clean()`
* Clean Temporary

Here is a small example

```python
"""
Small recipe example
"""
from depmanager.api.recipe import Recipe


class MyAwesomeLib(Recipe):
    """
    Awesome lib
    """
    name = "awesome_lib"  # lib name
    version = "0.0.1.foo"  # lib version
    source_dir = "src"  # where to fine the sources (especially) the CmakeList.txt
    kind = "static"  # the lib's kind


class AnotherAwesomeLib(MyAwesomeLib):
    """
    Shared version of previous one
    """
    kind = "shared"
```

As many python file may exist in the source you want to build, python file using shebang will be ignored to avoid errors
when parsing them. Do not add shebang in your recipe files.

## Roadmap

The First in the roadmap is to use this tool in C++ project to get feedback.

Among things:

* version 0.7.x
    * [ ] Creation of a frontend application.
        * [ ] Can view, edit, suppress local package.
        * [ ] Can add, remove, explore remotes.
        * [ ] Can push, pull packages.
* version 0.6.x
    * [ ] Add recipe library
        * [ ] Possibility to store the recipes in remote
        * [ ] Auto build recipe if neither local nor remote found.
* version 0.5.x
    * [ ] Add more cmake commands
        * [ ] Check for package updates
        * [ ] Allow to retrieve specific package
        * [ ] Manage Remotes
        * [ ] Manage Toolsets
* version 0.4.x
    * [ ] Add a sorting order for remotes.
        * [ ] Searching across remotes with final package sorting.
        * [ ] Allow auto-pull best-fitting package
    * [ ] Add concept of package dependencies
        * [ ] Add dependency list in built packages.
            * [ ] Construct dependency based on build.
            * [ ] Use dependency list in query search
            * [ ] Rebuild if dependency change.
        * [ ] Allow pull package with dependencies.
        * [ ] Dependency checks during load.
        * [ ] Recursive load of package.
* version 0.4.2 -- 2025-10-26
    * [X] allow to introduce a missing CMakelists.txt file in recipe source step.
* version 0.4.1 -- 2025-07-01
    * [X] Bugfixes
        * [X] Fix toolset management command.
        * [X] Better Handling of llvm abi in recipe builder.
* version 0.4.0 -- 2025-06-16
    * [X] Add concept of toolset.
        * [X] Tool set defines arch, os and compilers; stored in config.ini; with a default one.
        * [X] Add concept of ABi for the compilers.
        * [X] Use toolset in build.
        * [X] Use toolset in queries.
    * [X] bugfixes
        * [X] Better local database reload
        * [X] Refactor builder in case of multiple build (pull, build, push)
    * [X] misc
        * [X] Add alias `rm` and `ls`
* version 0.3.4 -- 2024-05-08
    * [X] bugfix: deepcopy in push command (for multiple push)
    * [X] bugfix: quotes in Cmake invocation command
    * [X] Add more verbose output in cleaning command
* version 0.3.3 -- 2024-01-27
    * [X] Improved Builder Configurations management
    * [X] Operation on multiple package
        * [X] add a 'clean' command
            * [X] basic mode: keep only the newest packages
            * [X] full mode: delete everything.
        * [X] allow local deletion of multiple packages
        * [X] allow push/pull of multiple packages
* version 0.3.2 -- 2024-01-19
    * [X] Better management of push in auto-build
    * [X] Bugfixes in the use of CMake
    * [X] manage dependency in the list of Recipes
* version 0.3.1 -- 2024-01-16
    * [X] Allow to externally control the build system
        * [X] Allow to build a package by giving a single recipe
        * [X] Allow to pull packages prior to build if exists on a remote
        * [X] Allow to push (force) to remote after build
    * [X] Helper functions to find recipes in filesystem
        * [X] Allow recursive search
* version 0.3.0 -- 2024-01-12
    * [X] CMake integration improvement
        * [X] Simplify integration with cmake
        * [X] Python auto generate the Module dir for cmake
        * [X] Allow to load package by batch
            * [X] use Yaml config file.
* version 0.2.1 -- 2023-12-31
    * [X] Bugfix: allow more date format and don't break if bad format.
* version 0.2.0 -- 2023-12-12
    * WARNING: Some breaking change. Backward compatibility not fully tested.
    * [X] Faster commandline
        * [X] Use remote connexion only if needed
    * [X] Transitive search
        * [X] Query: search in local then remote.
        * [X] get: Auto-pull if not in local.
    * [X] Add new remote command.
        * [X] Get info from remote (type and version)
        * [X] Allow to delete package on remote.
    * [X] Better Package properties
        * [X] Add build Date in package properties.
        * [X] Add build glibc version in package properties if applicable.
        * [X] Better queries on glibc compatible system
        * [X] Use system's glibc in get searches
* version 0.1.4 -- 2023-06-21
    * [X] Allow to sync with remote.
        * [X] Allow to pull local package that have newer version.
        * [X] Allow to push local package newer than remote or not existing in remote.
    * [X] Allow to force push/pull.
    * [X] Bugfix: safe delete
* version 0.1.3 -- 2023-06-12
    * [X] Update internal statuses when using API.
    * [X] omit -d in push/pull command.
    * [X] add progress bar in push/pull command.
    * [X] Allow single thread in build.
* version 0.1.2 -- 2023-05-31
    * [X] Add possibility to force os, arch and compiler for cross compiling.
    * [X] Adapt build system to search dependency in the forced environment.
* version 0.1.1
    * [X] Add remote 'srv' Type: a dedicated dependency server.
    * [X] Add remote 'srvs' Type: a dedicated dependency server with secure connexion.

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "depmanager",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": null,
    "keywords": "dependency, development, cmake, C++",
    "author": null,
    "author_email": "Silmaen <genteur.slayer@laposte.net>",
    "download_url": "https://files.pythonhosted.org/packages/b6/e9/13cfbee2d1eafbbbbf4740a57172f3ece544401a42002cf96ce6778d4b0a/depmanager-0.4.2.2.tar.gz",
    "platform": null,
    "description": "# DepManager\n\n[![PyPI](https://img.shields.io/pypi/v/depmanager)](https://pypi.org/project/depmanager)\n[![Download](https://static.pepy.tech/badge/depmanager)](https://pepy.tech/project/depmanager)\n[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)\n\nDepmanager is a minimalistic tool to manage dependencies (also known as third-party\nlibraries) of a C++ Project. It works closely with cmake tool.\n\nIt allows to store dependencies in a distant repository to share builds with other and\nhave a local cache project-independent.\n\n## Installation\n\nDepmanager is written in python so in the following we assume you have a\nworking python installation designated as `<python>` with `pip` installed.\n\n### pip\n\nTo install dep manager simply use `<python> -m pip  install depmanager`\n\nSee the page on Pypi: [depmanager](https://pypi.org/project/depmanager/).\n\n### From source\n\nPrerequisite: python module 'build' install it with `<python> -m pip install build`\n\nClone the gitHub repository.\n\nIn the source root do:\n\n```powershell\n<python> -m build\n<python> -m pip install dist/depmanager-x.y.z-py3-none-any.whl\n```\n\n## Commandline use\n\n### Get help\n\nFor any command or sub-command adding `--help` or `-h` to get help\non parameters or usage.\n\n### Generalities\n\nIn the base command you can find:\n\n| command | subcommands                | description                        |\n|---------|----------------------------|------------------------------------|\n| info    | basedir, cmakedir, version | info on local instance             |\n| get     |                            | Get the config package             |\n| pack    | pull, push, add, rm, ls    | Manage packages                    |\n| remote  | list, ls, add, rm, info    | Manage the list of distant servers |\n| build   |                            | Build a new package                |\n| toolset | list, ls, add, rm          | Manage toolsets                    |\n\nIn the following, `<query>` designate something representing the dependency's description.\nThe syntax reads:  `--predicate(-p) <name>:<version> --type(-t)\n<type> --os(-o) <os> --arch(-a) <arch> --abi(-c) <abi> --glibc <glibc>`\n\nValid values for `type`: `shared`, `static`, `header`.\n\nValid values for `os` : `Windows`, `Linux` (default: host os)\n\nValid values for `arch` : `x86_64`, `aarch64` (default: host arch)\n\nValid values for `abi` : `gnu`, `llvm` or `msvc` (default: `gnu`)\nNote: clang compiler stands for `gnu` if using libstdc++ or `llvm` when using libc++ while clang-cl stands for `msvc`.\n\nValid values for `glibc` are only needed for linux. By giving, a value the system will look at\npackage with compatible version will be search (i.e. wit a version number lower or equal).\nIt is still possible to do an exact search by using `=` as first character. (like `--glibc =2.36`)\n\nAlso, we will designate `<remote>` as a description a remote server, syntax reads: `[-n <name>|-d]`.\nIf nothing given, we assume 'local'. If `-d` given, use the default remote, else use the remote by\nits name.\n\nIf the name does not exist, it will fall back to default then to local.\n\n## Base commands\n\n### info\n\nSubcommands:\n\n* `version` gives the version of the local manager.\n* `basedir` gives the path to the local data of the manager\n* `cmakedir` gives the path to add to `CMAKE_MODULE_PATH` before include `ExternalDependencyManager`\n\n### get\n\n`depmanager get <query>`\n\nGet path to cmake config of the 'best' package given by the query information.\n\nThe command will first search in the local cache, if not found it will search in the default remote. This does not\nintent for human use but more for\ncmake integration.\n\n### pack\n\nActions on packages.\n\n#### ls\n\n`depmanager pack ls <query> [--transitive(-t)] <remote>` Simply do a search in the given remote (in local if\nnothing given) and print the result.\n\nThe `--transitive(-t)` flag will allow to use transitive query, meaning to search for local then remote.\n\n#### add, rm\n\n`depmanager pack add <location>` Will add a package to the local database. `<location>` can be a\nfolder, then it must contain a properly formatted `edp.info` file. Or an archive (.zip, .tgz or .tar.gz\nfile format allowed). The uncompressed archive must contain a properly formatted `edp.info` file.\n\n`depmanager pack rm <query> <remote> [-r]` Will remove from local cache all package matching the query.\n\nThe `-r` option allows operation on multiple packages (local only), else the command will return an error if multiple\npackage matches the query.\n\n#### push, pull\n\n`depmanager pack [push|pull] <query> <remote> [--force(-f)] [-r]` will synchronize Local cache with the remote.\nThe `query` must be precise enough to match one and only one package. `remote` must be valid.\n\n`push` will look for the package in local cache that match the query and send it to the given remote.\n\n`pull` will look for the package in given remote that match the query and bring it to the local cache.\n\nIf `--force` is given, The transfer occurs even if the package already exists in the destination.\n\nThe `-r` option allows operation on multiple packages. If multiple versions, only the highest one will be used.\n\n#### clean\n\n`depmanager pack clean [--full(-f)]` Will clean the local repository by removing old packages, only the newest\nversion of each package is kept.\n\nThe `[--full(-f)]` option will make the clean operation applies to all package, thus emptying the local database.\n\n### remote\n\nManage the list of remote servers\nsubcommands:\n\n* `list` or `ls` lists the defined remote server.\n* `add` adds a new remote to the list.\n    * `--name(-n) <name> --url(-u) <proto>://<url[:port]> [--default(-d)]`.\n    * Mandatory. If name already exists it will modify the existing one.\n    * Allowed proto are:\n        * `ftp` supports login\n        * `folder` a folder of your computer (mostly for debug or testing)\n        * `srv` a dedicated server see [gitHub](https://github.com/Silmaen/DepManagerServer)\n        * `srvs` a dedicated server with secure connexion see [gitHub](https://github.com/Silmaen/DepManagerServer)\n    * Login can be defined with: `--login(-l) <login> --passwd(-p) <passwd>`.\n* `rm <remote>` remove the designated remote if exists.\n* `sync <remote> [--push-only|--pull-only] [--dry-run]` push to remote all local package that does not already\n  exist on remote. Pull local package that have a newer version on the remote. If no remote given, it will use the\n  default one.\n* `info <remote>` gets information from the remote: type and version.\n\n### toolset\n\nManage the toolset list.\n\n* `list` or `ls` for listing the toolsets.\n* `add` add a new toolset to the list\n    * `--name(-n) <name> --compiler(-c) <compiler_path> [--abi(-b) <abi>`\n* `rm --name(-n) <name>` remove a toolset\n\n### build\n\n`depmanager build [OPTIONS] <location>` will search for recipe in the given location and build them.\n\nSee the section [Create you own package](#create-your-own-package) for more details.\n\n## Using package with cmake\n\n### Include depmanager to cmake\n\nTo initialize depmanager into cmake you need to add to `CMAKE_MODULE_PATH` the path\nto the cmake folder of this installation.\n\nHere is a small cmake code snippet to initialize depmanager in cmake.\n\n```cmake\n# add HINTS or PATH to find the executable if not in the PATH\nfind_program(EDEPMANAGER depmanager)\nif (${EDEPMANAGER} STREQUAL EDEPMANAGER-NOTFOUND)\n    message(FATAL_ERROR \"Dependency manager not found.\")\nelse ()\n    execute_process(COMMAND ${EDEPMANAGER} info cmakedir\n            OUTPUT_VARIABLE depmanager_path)\n    string(STRIP ${depmanager_path} depmanager_path)\n    list(PREPEND CMAKE_MODULE_PATH ${depmanager_path})\n    include(DepManager)\nendif ()\n```\n\n### Automated mode\n\nIn automated mode, depmanager can automatically set a remote repository, retrieve packages from this repository\nand load then in one command.\n\n#### The command\n\n```cmake\ndm_load_environment(\n        [QUIET]\n        [PATH path]\n        [KIND kind]\n        [ARCH target_arch]\n        [OS target_os]\n        [ABI target_abi]\n        [GLIBC target_glibc]\n) \n```\n\nIf `QUIET` set, only errors are written.\n\n`path` is the path to the configuration file, either directly a configuration file name,\nor a directory containing a file named `depmanager.yml`. By default, it will look at the\nproject root. See the next paragraph for more information about configuration file.\n\n`kind` is used to force library kind (`shared`, `static`, `header`). By default, it uses\nthe value from `BUILD_SHARED_LIBS`.\n\n`target_arch`, `target_os`, `target_abi`, `target_glibc` are used in the query. If not set, default\nvalues are `CMAKE_SYSTEM_PROCESSOR`, `CMAKE_SYSTEM_NAME` and `CMAKE_CXX_COMPILER_ID`\n\nThe cmake function will update the CMAKE variable for the search of package.\n\nAfter call this command, the cmake user has to call for needed `find_package`.\n\n#### Configuration file\n\nThe configuration file is a yaml file. Here is an example with explication in comment.\n\n```yaml\nremote:\n  # If server is defined, depmanager will add this server to its\n  # database (if not already there)\n  server:\n    # Same parameter as command-line (also the required)\n    name: \"my_server\"\n    kind: \"srvs\"\n    url: \"https://packages.example.net\"\n    login: \"foo\"\n    passwd: \"bar\"\n  # If package not found locally, do you allow for download?\n  pull: true\n  # If newer remote package exists, download it? (implies 'pull')\n  pull-newer: true\npackages:\n  # list the needed packages.\n  fmt:\n    # version 'at least'\n    version: \">=10.1.0\"\n  spdlog:\n    # exact version\n    version: \"1.12.0\"\n  debugbreak:\n    # if not found locally, don't pull, nor error.\n    optional: true\n  glm:\n    version: \"0.9.9.9\"\n    # force the shared version even in static build mode.\n    kind: \"shared\"\n  glfw:\n    # use this only for the (same for arch, and abi)\n    os: Linux\n```\n\n### Manual mode\n\nIn manual mode you should load or find each package individually.\nYou should also manually set the remote and download the package.\n\n#### Find packages\n\nWith depmanager initialized in cmake, it provides an alternative to classical `find_package`\nof cmake by `dm_find_package`\n\n```cmake\ndm_find_package(\n        package\n        [QUIET] [TRACE] [REQUIRED]\n        [VERSION version]\n        [KIND kind]\n        [ARCH target_arch]\n        [OS target_os]\n        [ABI target_abi]\n        [GLIBC target_glibc]\n)\n```\n\n`package` is the package name to find.\n\n`version` is the exact version to match (wildcard are allowed). By default, find the\nlatest one.\n\n`kind` is used to force library kind (`shared`, `static`, `header`). By default, it returns\nthe first found.\n\nIf `REQUIRED` set, the function will give an error if no package found.\n(same as original `find_package`)\n\nIf `QUIET` set, only errors are written. (same as original `find_package`). In opposition,\nif `TRACE` set, many more debug message displayed.\n\n`target_arch`, `target_os`, `target_abi` `target_glibc` are used in the query. If not set, default\nvalues are `CMAKE_SYSTEM_PROCESSOR`, `CMAKE_SYSTEM_NAME` and `CMAKE_CXX_COMPILER_ID`\n\n**LIMITATION:** it requires the library name is the package name. So no multi lib or lib with different name.\n\n#### Load package\n\nThis command is similar to the previous one, but does not directly do a cmake's `find_package`.\nIt only adds to the `CMAKE_PREFIX_PATH` list the folders of given package.\n\n```cmake\ndm_load_package(\n        package\n        [REQUIRED] [TRACE]\n        [VERSION version]\n        [KIND kind]\n        [ARCH target_arch]\n        [OS target_os]\n        [ABI target_abi]\n        [GLIBC target_glibc]\n)\n```\n\nAfter call this command, the cmake user has to call for needed `find_package`.\n\n## Create your own package\n\nDepmanager allow you to create your own packages by defining recipes. Then run\n`depmanager build <location of recipes> [OPTIONS]`\nThe program will then build and add dependencies to the local cache.\n\nThe location can contain as many recipe in any number of files.\n\nThe search behavior can bve set as recursive with option `--recursive,-r`. As sometimes, sources also contains python\nfiles that may fail to load, the depth of recursion can be restrained using `--recursive-depth <n>`.\n\nBy default, a package will not be build if already exists in the local cache. You can force the rebuild with the\noption `--force,-f`.\n\nBy default, the builder will use all the cpu cores, but `--single-thred,-s` will force to use only one core.\n\nCross-compilation can be used by giving the tools at command\nline: `--cross-c <C_COMPILER> --cross-cxx <CXX_COMPILER> --cross-arch <TARGET_ARCH> --cross-os <TARGET_OS>`\n\nA defined toolset can be used by giving its name: `--toolset,-t <TOOLSET_NAME>`.\n\nIt is also possible to give a remote name `-n <remote_name>` or set to default remote `-d`. This way,\nThe builder will look into remote to see if a package already exists and pull it instead of building it.\nAlso, after a successful build, it will automatically push to the remote. Use either `--no-pull`and `--no-push`\noption to skip these steps.\n\nA `--dry-run` option will do all the checks and print the results but no pull, build and push action will be done.\n\n### The recipe\n\nDuring build, Depmanager will look in all `.py` file for class that inherits from\ndepmanager.api.recipe.Recipe.\n\nAs for dependency usage, build also rely on cmake for building.\n\nThe builder will use the provided recipe in the following workflow:\n\n* Init recipe\n* Call `recipe.source()`\n* Call `recipe.configure()`\n* Initialize options based on recipe data\n* Run cmake configure\n* For all configuration (mostly 'Debug', 'Release')\n    * build target `install`\n* Call `recipe.install()`\n* Generate edp.info file\n* Import into local cache\n* Call `recipe.clean()`\n* Clean Temporary\n\nHere is a small example\n\n```python\n\"\"\"\nSmall recipe example\n\"\"\"\nfrom depmanager.api.recipe import Recipe\n\n\nclass MyAwesomeLib(Recipe):\n    \"\"\"\n    Awesome lib\n    \"\"\"\n    name = \"awesome_lib\"  # lib name\n    version = \"0.0.1.foo\"  # lib version\n    source_dir = \"src\"  # where to fine the sources (especially) the CmakeList.txt\n    kind = \"static\"  # the lib's kind\n\n\nclass AnotherAwesomeLib(MyAwesomeLib):\n    \"\"\"\n    Shared version of previous one\n    \"\"\"\n    kind = \"shared\"\n```\n\nAs many python file may exist in the source you want to build, python file using shebang will be ignored to avoid errors\nwhen parsing them. Do not add shebang in your recipe files.\n\n## Roadmap\n\nThe First in the roadmap is to use this tool in C++ project to get feedback.\n\nAmong things:\n\n* version 0.7.x\n    * [ ] Creation of a frontend application.\n        * [ ] Can view, edit, suppress local package.\n        * [ ] Can add, remove, explore remotes.\n        * [ ] Can push, pull packages.\n* version 0.6.x\n    * [ ] Add recipe library\n        * [ ] Possibility to store the recipes in remote\n        * [ ] Auto build recipe if neither local nor remote found.\n* version 0.5.x\n    * [ ] Add more cmake commands\n        * [ ] Check for package updates\n        * [ ] Allow to retrieve specific package\n        * [ ] Manage Remotes\n        * [ ] Manage Toolsets\n* version 0.4.x\n    * [ ] Add a sorting order for remotes.\n        * [ ] Searching across remotes with final package sorting.\n        * [ ] Allow auto-pull best-fitting package\n    * [ ] Add concept of package dependencies\n        * [ ] Add dependency list in built packages.\n            * [ ] Construct dependency based on build.\n            * [ ] Use dependency list in query search\n            * [ ] Rebuild if dependency change.\n        * [ ] Allow pull package with dependencies.\n        * [ ] Dependency checks during load.\n        * [ ] Recursive load of package.\n* version 0.4.2 -- 2025-10-26\n    * [X] allow to introduce a missing CMakelists.txt file in recipe source step.\n* version 0.4.1 -- 2025-07-01\n    * [X] Bugfixes\n        * [X] Fix toolset management command.\n        * [X] Better Handling of llvm abi in recipe builder.\n* version 0.4.0 -- 2025-06-16\n    * [X] Add concept of toolset.\n        * [X] Tool set defines arch, os and compilers; stored in config.ini; with a default one.\n        * [X] Add concept of ABi for the compilers.\n        * [X] Use toolset in build.\n        * [X] Use toolset in queries.\n    * [X] bugfixes\n        * [X] Better local database reload\n        * [X] Refactor builder in case of multiple build (pull, build, push)\n    * [X] misc\n        * [X] Add alias `rm` and `ls`\n* version 0.3.4 -- 2024-05-08\n    * [X] bugfix: deepcopy in push command (for multiple push)\n    * [X] bugfix: quotes in Cmake invocation command\n    * [X] Add more verbose output in cleaning command\n* version 0.3.3 -- 2024-01-27\n    * [X] Improved Builder Configurations management\n    * [X] Operation on multiple package\n        * [X] add a 'clean' command\n            * [X] basic mode: keep only the newest packages\n            * [X] full mode: delete everything.\n        * [X] allow local deletion of multiple packages\n        * [X] allow push/pull of multiple packages\n* version 0.3.2 -- 2024-01-19\n    * [X] Better management of push in auto-build\n    * [X] Bugfixes in the use of CMake\n    * [X] manage dependency in the list of Recipes\n* version 0.3.1 -- 2024-01-16\n    * [X] Allow to externally control the build system\n        * [X] Allow to build a package by giving a single recipe\n        * [X] Allow to pull packages prior to build if exists on a remote\n        * [X] Allow to push (force) to remote after build\n    * [X] Helper functions to find recipes in filesystem\n        * [X] Allow recursive search\n* version 0.3.0 -- 2024-01-12\n    * [X] CMake integration improvement\n        * [X] Simplify integration with cmake\n        * [X] Python auto generate the Module dir for cmake\n        * [X] Allow to load package by batch\n            * [X] use Yaml config file.\n* version 0.2.1 -- 2023-12-31\n    * [X] Bugfix: allow more date format and don't break if bad format.\n* version 0.2.0 -- 2023-12-12\n    * WARNING: Some breaking change. Backward compatibility not fully tested.\n    * [X] Faster commandline\n        * [X] Use remote connexion only if needed\n    * [X] Transitive search\n        * [X] Query: search in local then remote.\n        * [X] get: Auto-pull if not in local.\n    * [X] Add new remote command.\n        * [X] Get info from remote (type and version)\n        * [X] Allow to delete package on remote.\n    * [X] Better Package properties\n        * [X] Add build Date in package properties.\n        * [X] Add build glibc version in package properties if applicable.\n        * [X] Better queries on glibc compatible system\n        * [X] Use system's glibc in get searches\n* version 0.1.4 -- 2023-06-21\n    * [X] Allow to sync with remote.\n        * [X] Allow to pull local package that have newer version.\n        * [X] Allow to push local package newer than remote or not existing in remote.\n    * [X] Allow to force push/pull.\n    * [X] Bugfix: safe delete\n* version 0.1.3 -- 2023-06-12\n    * [X] Update internal statuses when using API.\n    * [X] omit -d in push/pull command.\n    * [X] add progress bar in push/pull command.\n    * [X] Allow single thread in build.\n* version 0.1.2 -- 2023-05-31\n    * [X] Add possibility to force os, arch and compiler for cross compiling.\n    * [X] Adapt build system to search dependency in the forced environment.\n* version 0.1.1\n    * [X] Add remote 'srv' Type: a dedicated dependency server.\n    * [X] Add remote 'srvs' Type: a dedicated dependency server with secure connexion.\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "Simple Dependency manager",
    "version": "0.4.2.2",
    "project_urls": {
        "Homepage": "https://github.com/Silmaen/DepManager"
    },
    "split_keywords": [
        "dependency",
        " development",
        " cmake",
        " c++"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "247a3b0f3f0c238762333ad90186e4c426644296e024a3607f87a4d1a025ff98",
                "md5": "704a9971934cb551d9f385171066a868",
                "sha256": "9bc7fa5624661d23b218ea33341e6bb4a3851e6d261014422cc95baa275be785"
            },
            "downloads": -1,
            "filename": "depmanager-0.4.2.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "704a9971934cb551d9f385171066a868",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 60673,
            "upload_time": "2025-10-26T22:34:38",
            "upload_time_iso_8601": "2025-10-26T22:34:38.835930Z",
            "url": "https://files.pythonhosted.org/packages/24/7a/3b0f3f0c238762333ad90186e4c426644296e024a3607f87a4d1a025ff98/depmanager-0.4.2.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "b6e913cfbee2d1eafbbbbf4740a57172f3ece544401a42002cf96ce6778d4b0a",
                "md5": "80b351e9abe8011dbac5e3f0d4289350",
                "sha256": "1dcc3bbf031abec64de692000f74f2ddf02db99fab7fafa4d04095320c69988b"
            },
            "downloads": -1,
            "filename": "depmanager-0.4.2.2.tar.gz",
            "has_sig": false,
            "md5_digest": "80b351e9abe8011dbac5e3f0d4289350",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 53417,
            "upload_time": "2025-10-26T22:34:40",
            "upload_time_iso_8601": "2025-10-26T22:34:40.394861Z",
            "url": "https://files.pythonhosted.org/packages/b6/e9/13cfbee2d1eafbbbbf4740a57172f3ece544401a42002cf96ce6778d4b0a/depmanager-0.4.2.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-10-26 22:34:40",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "Silmaen",
    "github_project": "DepManager",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "depmanager"
}
        
Elapsed time: 3.68942s