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 available on the marketplace.
It also provide a packaging system called dan.io, that will fetch and build 3rd party libraries.
Install
dan is available on pip:
pip install dan-build
Features
Generators
Generators are python functions that generates an output:
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:
@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
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 is the main (default) package source repository (custom repositories are supported by editting ~/.dan/repositories.json), documentation comming soon.
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, ...
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
dan scan-toolchains [-s <env-script>]
Configuration
dan configure [-B <build_path>] [-S <source_path>] [-t <toolchain>] [-s <setting>=<value>] [-o <option>=<value>]
Build
dan build [-B <build_path>] [-v] [--for-install] [TARGETS]...
Install
Install targets marked with install = True property to the install.destination setting.
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.
$ 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
$ 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:
for script in ~/.local/etc/bash_completion.d/*.sh; do source ${script} done
-
ksh:
for script in ~/.local/etc/ksh_completion.d/*.sh; do source ${script} done
Metadata
Release files for dan-build 0.2.10
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| dan-build-0.2.10.tar.gz | 102.2 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| dan_build-0.2.10-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 222.0 kB
Release files / dan-build-0.2.10.tar.gz
| Download URL | dan-build-0.2.10.tar.gz |
|---|---|
| Size | 102.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
10c8a531cbe2e0a520a1b1dddb9a48825d7ff63cdb2cac37fb54d094466e2ae3
|
|
BLAKE2b-256 checksum How to use checksums |
cabaceb9283896fb42c2b47fdd233f366562d0f9c9ac933f64abf830a602930b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.7
|
Release files / dan_build-0.2.10-py3-none-any.whl
| Download URL | dan_build-0.2.10-py3-none-any.whl |
|---|---|
| Size | 119.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ca894dbdbcf977046079f85f8efe44e580874e91e517b5a7ab7889fafaa8ea01
|
|
BLAKE2b-256 checksum How to use checksums |
7f498d35b00e736130a319e4fb10628df72d63d9295209d56f8094702c257aae
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.7
|
Security for dan-build 0.2.10
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.