dan-build


Namedan-build JSON
Version 0.2.10 PyPI version JSON
download
home_page
SummaryPython-based build system.
upload_time2023-12-16 15:53:11
maintainer
docs_urlNone
author
requires_python>=3.10
licenseMIT License Copyright (c) 2023 Sylvain Garcia Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords packaging dependency build system
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # dan

> _Do Anything Now_

_dan_ is a build system inspired from _GNU make_, _cmake_, _meson_, ... but only in python.

It is mostly designed to be easy to use, it comes with its [vscode extension](https://github.com/Garcia6l20/dan-vscode) available on the [marketplace](https://marketplace.visualstudio.com/items?itemName=garcia6l20.dan).

It also provide a packaging system called [dan.io](https://github.com/Garcia6l20/dan.io),
that will fetch and build 3rd party libraries.

## Install

_dan_ is available on pip:

```bash
pip install dan-build
```

## Features

### Generators

Generators are python functions that generates an output:

```python
from dan import generator

@generator(output='hello.txt', dependencies=['source.jinja'])
def hello(self):
    env = jinja2.Environment(loader=jinja2.FileSystemLoader(self.source_path))
    template = env.get_template('source.jinja')
    print(template.render({'data': 'hello'}), file=open(self.output, 'w'))
```

They can be async:

```python
@generator(output='hello-cpy.txt', dependencies=[hello])
async def hello_cpy(self):
    assert hello.up_to_date
    async with aiofiles.open(hello.output, 'r') as src:
        async with aiofiles.open(self.output, 'w') as dst:
            await dst.write(await src.read())
```

### C/CXX

#### Libraries/Executables

```python
from dan.cxx import Library, Executable
class MyLib(Library):
    name = 'my-lib'
    sources = ['src/my-lib.cpp']
    public_includes = ['include']

class MyExe(Executable):
    name = 'my-exe'
    sources = ['src/main.cpp']
    dependencies = [MyLib]

```

#### Packages

[dan.io](https://github.com/Garcia6l20/dan.io) is the main (default) package source repository (custom repositories are supported by editting _~/.dan/repositories.json_), documentation comming soon.

```python
class MyExe(Executable):
    name = 'my-exe'
    sources = ['src/main.cpp']
    dependencies = ['boost:headers@dan.io >= 1.82']
```

## `dan` cli usage

`dan` is the main executable to build your project, it can build, test, list targets/test, ...

```bash
dan --help
Usage: dan [OPTIONS] COMMAND [ARGS]...

Options:
  --version           Show the version and exit.
  -q, --quiet         Dont print informations (errors only)
  -v, --verbose       Pring debug informations
  -j, --jobs INTEGER  Maximum jobs
  --help              Show this message and exit.

Commands:
  build            Build targets
  clean            Clean generated stuff
  code             VS-Code specific commands
  configure        Configure dan project
  install          Install targets
  ls               Inspect stuff
  run              Run executable(s)
  scan-toolchains  Scan system toolchains
  test             Run tests
  uninstall        Uninstall previous installation
```

### Toolchain scan

```bash
dan scan-toolchains [-s <env-script>]
```

### Configuration

```bash
dan configure [-B <build_path>] [-S <source_path>] [-t <toolchain>] [-s <setting>=<value>] [-o <option>=<value>]
```

### Build

```bash
dan build [-B <build_path>] [-v] [--for-install] [TARGETS]...
```

### Install

Install targets marked with `install = True` property to the *install.destination* setting.

```bash
dan install [-B <build_path>] [TARGETS]... [user|dev]
```

Settings:
- *install.destination*: The install destination (default: /usr/local).
- *install.runtime_prefix*: Executables installation prefix (default: bin).
- *install.libraries_prefix*: Libraries installation prefix (default: lib).
- *install.includes_prefix*: Includes installation prefix (default: include).
- *install.data_prefix*: Data files installation prefix (default: share).
- *install.project_prefix*: !!! NOT USED YET !!! Project prefix (default: None).

## `dan-io` cli usage

`dan-io` is a secondary utility to interract with package management system.

```bash
$ dan-io --help 
Usage: dan-io [OPTIONS] COMMAND [ARGS]...

Options:
  --help  Show this message and exit.

Commands:
  ls      Inspect stuff
  search  Search for NAME in repositories
```

```bash
$ dan-io ls --help
Usage: dan-io ls [OPTIONS] COMMAND [ARGS]...

  Inspect stuff

Options:
  --help  Show this message and exit.

Commands:
  libraries     List available libraries
  repositories  List available repositories
  versions      Get LIBRARY's available versions
```


## Auto completion

_bash_ and _zsh_ completions are currently supported:

- _bash_:
    ```bash
    for script in ~/.local/etc/bash_completion.d/*.sh; do
        source ${script}
    done
    ```

- _ksh_:
    ```ksh
    for script in ~/.local/etc/ksh_completion.d/*.sh; do
        source ${script}
    done
    ```

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "dan-build",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.10",
    "maintainer_email": "",
    "keywords": "packaging,dependency,build system",
    "author": "",
    "author_email": "Garcia Sylvain <garcia.6l20@gmail.com>, garcia.6l20@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/ca/ba/ceb9283896fb42c2b47fdd233f366562d0f9c9ac933f64abf830a602930b/dan-build-0.2.10.tar.gz",
    "platform": null,
    "description": "# dan\n\n> _Do Anything Now_\n\n_dan_ is a build system inspired from _GNU make_, _cmake_, _meson_, ... but only in python.\n\nIt is mostly designed to be easy to use, it comes with its [vscode extension](https://github.com/Garcia6l20/dan-vscode) available on the [marketplace](https://marketplace.visualstudio.com/items?itemName=garcia6l20.dan).\n\nIt also provide a packaging system called [dan.io](https://github.com/Garcia6l20/dan.io),\nthat will fetch and build 3rd party libraries.\n\n## Install\n\n_dan_ is available on pip:\n\n```bash\npip install dan-build\n```\n\n## Features\n\n### Generators\n\nGenerators are python functions that generates an output:\n\n```python\nfrom dan import generator\n\n@generator(output='hello.txt', dependencies=['source.jinja'])\ndef hello(self):\n    env = jinja2.Environment(loader=jinja2.FileSystemLoader(self.source_path))\n    template = env.get_template('source.jinja')\n    print(template.render({'data': 'hello'}), file=open(self.output, 'w'))\n```\n\nThey can be async:\n\n```python\n@generator(output='hello-cpy.txt', dependencies=[hello])\nasync def hello_cpy(self):\n    assert hello.up_to_date\n    async with aiofiles.open(hello.output, 'r') as src:\n        async with aiofiles.open(self.output, 'w') as dst:\n            await dst.write(await src.read())\n```\n\n### C/CXX\n\n#### Libraries/Executables\n\n```python\nfrom dan.cxx import Library, Executable\nclass MyLib(Library):\n    name = 'my-lib'\n    sources = ['src/my-lib.cpp']\n    public_includes = ['include']\n\nclass MyExe(Executable):\n    name = 'my-exe'\n    sources = ['src/main.cpp']\n    dependencies = [MyLib]\n\n```\n\n#### Packages\n\n[dan.io](https://github.com/Garcia6l20/dan.io) is the main (default) package source repository (custom repositories are supported by editting _~/.dan/repositories.json_), documentation comming soon.\n\n```python\nclass MyExe(Executable):\n    name = 'my-exe'\n    sources = ['src/main.cpp']\n    dependencies = ['boost:headers@dan.io >= 1.82']\n```\n\n## `dan` cli usage\n\n`dan` is the main executable to build your project, it can build, test, list targets/test, ...\n\n```bash\ndan --help\nUsage: dan [OPTIONS] COMMAND [ARGS]...\n\nOptions:\n  --version           Show the version and exit.\n  -q, --quiet         Dont print informations (errors only)\n  -v, --verbose       Pring debug informations\n  -j, --jobs INTEGER  Maximum jobs\n  --help              Show this message and exit.\n\nCommands:\n  build            Build targets\n  clean            Clean generated stuff\n  code             VS-Code specific commands\n  configure        Configure dan project\n  install          Install targets\n  ls               Inspect stuff\n  run              Run executable(s)\n  scan-toolchains  Scan system toolchains\n  test             Run tests\n  uninstall        Uninstall previous installation\n```\n\n### Toolchain scan\n\n```bash\ndan scan-toolchains [-s <env-script>]\n```\n\n### Configuration\n\n```bash\ndan configure [-B <build_path>] [-S <source_path>] [-t <toolchain>] [-s <setting>=<value>] [-o <option>=<value>]\n```\n\n### Build\n\n```bash\ndan build [-B <build_path>] [-v] [--for-install] [TARGETS]...\n```\n\n### Install\n\nInstall targets marked with `install = True` property to the *install.destination* setting.\n\n```bash\ndan install [-B <build_path>] [TARGETS]... [user|dev]\n```\n\nSettings:\n- *install.destination*: The install destination (default: /usr/local).\n- *install.runtime_prefix*: Executables installation prefix (default: bin).\n- *install.libraries_prefix*: Libraries installation prefix (default: lib).\n- *install.includes_prefix*: Includes installation prefix (default: include).\n- *install.data_prefix*: Data files installation prefix (default: share).\n- *install.project_prefix*: !!! NOT USED YET !!! Project prefix (default: None).\n\n## `dan-io` cli usage\n\n`dan-io` is a secondary utility to interract with package management system.\n\n```bash\n$ dan-io --help \nUsage: dan-io [OPTIONS] COMMAND [ARGS]...\n\nOptions:\n  --help  Show this message and exit.\n\nCommands:\n  ls      Inspect stuff\n  search  Search for NAME in repositories\n```\n\n```bash\n$ dan-io ls --help\nUsage: dan-io ls [OPTIONS] COMMAND [ARGS]...\n\n  Inspect stuff\n\nOptions:\n  --help  Show this message and exit.\n\nCommands:\n  libraries     List available libraries\n  repositories  List available repositories\n  versions      Get LIBRARY's available versions\n```\n\n\n## Auto completion\n\n_bash_ and _zsh_ completions are currently supported:\n\n- _bash_:\n    ```bash\n    for script in ~/.local/etc/bash_completion.d/*.sh; do\n        source ${script}\n    done\n    ```\n\n- _ksh_:\n    ```ksh\n    for script in ~/.local/etc/ksh_completion.d/*.sh; do\n        source ${script}\n    done\n    ```\n",
    "bugtrack_url": null,
    "license": "MIT License  Copyright (c) 2023 Sylvain Garcia  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ",
    "summary": "Python-based build system.",
    "version": "0.2.10",
    "project_urls": {
        "documentation": "https://github.com/Garcia6L20/dan",
        "homepage": "https://github.com/Garcia6L20/dan",
        "repository": "https://github.com/Garcia6L20/dan"
    },
    "split_keywords": [
        "packaging",
        "dependency",
        "build system"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "7f498d35b00e736130a319e4fb10628df72d63d9295209d56f8094702c257aae",
                "md5": "54c43f900de83dccae21d5554e047725",
                "sha256": "ca894dbdbcf977046079f85f8efe44e580874e91e517b5a7ab7889fafaa8ea01"
            },
            "downloads": -1,
            "filename": "dan_build-0.2.10-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "54c43f900de83dccae21d5554e047725",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10",
            "size": 119766,
            "upload_time": "2023-12-16T15:53:10",
            "upload_time_iso_8601": "2023-12-16T15:53:10.709076Z",
            "url": "https://files.pythonhosted.org/packages/7f/49/8d35b00e736130a319e4fb10628df72d63d9295209d56f8094702c257aae/dan_build-0.2.10-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "cabaceb9283896fb42c2b47fdd233f366562d0f9c9ac933f64abf830a602930b",
                "md5": "dfab4e03e98147ea5e9240d57a8450de",
                "sha256": "10c8a531cbe2e0a520a1b1dddb9a48825d7ff63cdb2cac37fb54d094466e2ae3"
            },
            "downloads": -1,
            "filename": "dan-build-0.2.10.tar.gz",
            "has_sig": false,
            "md5_digest": "dfab4e03e98147ea5e9240d57a8450de",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10",
            "size": 102228,
            "upload_time": "2023-12-16T15:53:11",
            "upload_time_iso_8601": "2023-12-16T15:53:11.893051Z",
            "url": "https://files.pythonhosted.org/packages/ca/ba/ceb9283896fb42c2b47fdd233f366562d0f9c9ac933f64abf830a602930b/dan-build-0.2.10.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-12-16 15:53:11",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "Garcia6L20",
    "github_project": "dan",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [],
    "lcname": "dan-build"
}
        
Elapsed time: 0.23432s