{"id":14985706,"url":"https://github.com/projectsyn/reclass-rs","last_synced_at":"2025-04-11T22:07:37.094Z","repository":{"id":191373292,"uuid":"684485917","full_name":"projectsyn/reclass-rs","owner":"projectsyn","description":"Reimplementation of https://github.com/kapicorp/reclass in Rust with Python bindings through PyO3.","archived":false,"fork":false,"pushed_at":"2025-04-11T08:51:13.000Z","size":623,"stargazers_count":11,"open_issues_count":6,"forks_count":0,"subscribers_count":9,"default_branch":"main","last_synced_at":"2025-04-11T10:53:00.567Z","etag":null,"topics":["vshn-team-aldebaran"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/projectsyn.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2023-08-29T08:20:54.000Z","updated_at":"2025-04-04T10:58:12.000Z","dependencies_parsed_at":"2023-08-29T15:39:04.607Z","dependency_job_id":"f985d246-4b96-4698-a464-0e9b94c696f2","html_url":"https://github.com/projectsyn/reclass-rs","commit_stats":null,"previous_names":["projectsyn/reclass-rs"],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/projectsyn%2Freclass-rs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/projectsyn%2Freclass-rs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/projectsyn%2Freclass-rs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/projectsyn%2Freclass-rs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/projectsyn","download_url":"https://codeload.github.com/projectsyn/reclass-rs/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248386198,"owners_count":21095031,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["vshn-team-aldebaran"],"created_at":"2024-09-24T14:11:31.039Z","updated_at":"2025-04-11T22:07:37.085Z","avatar_url":"https://github.com/projectsyn.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# reclass-rs: A Reclass implementation in Rust\n\nReclass is a library which defines a syntax and directory structure for recursively merging YAML data sources.\n\nThis repository contains a Rust implementation of Reclass which is based on the [Reclass fork](https://github.com/kapicorp/reclass) maintained by [kapicorp](https://github.com/kapicorp/).\nThe Reclass implementation provided in this repository can be used both from other Rust programs and in Python programs.\nThe `reclass-rs` Python module is implemented directly in Rust with [PyO3](https://pyo3.rs/latest/).\n\nPlease note that this implementation doesn't yet support all the features and extensions which are available in Kapitan Reclass.\nHowever, for features which are implemented, we aim to be compatible with Kapitan Reclass.\n\nThe implementation currently supports the following features of Kapicorp Reclass:\n\n* The Reclass options `nodes_path` and `classes_path`\n* The Reclass option `ignore_class_notfound`\n* The Reclass option `ignore_class_notfound_regexp`\n* Escaped parameter references\n* Merging referenced lists and dictionaries\n* Constant parameters\n* Nested references\n* References in class names\n* Loading classes with relative names\n* Loading Reclass configuration options from `reclass-config.yaml`\n* The Reclass option `componse_node_name`\n  * reclass-rs provides a non-compatible mode for `compose_node_name` which preserves literal dots in node names\n\nThe following Kapicorp Reclass features aren't supported:\n\n* Ignoring overwritten missing references\n* Inventory Queries\n* The Reclass option `allow_none_override` can't be set to `False`\n* The Reclass `yaml_git` and `mixed` storage types\n* Any Reclass option which is not mentioned explicitly here or above\n\nDocumentation for the original Reclass can be found at https://reclass.pantsfullofunix.net/.\nDocumentation on Reclass extensions introduced in the Kapicorp Reclass fork can be found at https://github.com/kapicorp/reclass/blob/develop/README-extensions.rst.\n\n## Prerequisites\n\n* Python \u003e= 3.9\n* Rust \u003e= 1.56 (we recommend installing the latest stable toolchain with [rustup])\n\n## Setup local development environment for Python bindings\n\n1. Create a local virtualenv for running Python tests and install [maturin] and pytest\n\n    ```\n    python -m venv .venv\n    source .venv/bin/activate\n    pip install maturin pytest\n    ```\n\n2. Build the reclass-rs Python library and install it in the virtualenv\n\n    ```\n    maturin develop\n    ```\n\n3. Run Python tests\n\n    ```\n    pytest\n    ```\n\n## Rust development\n\nYou should be able to run the Rust tests through Cargo if you have the Rust toolchain setup:\n\n```\ncargo test\n```\n\n### Linting and formatting\n\n* Use `cargo fmt` to format code\n* Use `cargo check` for checking that the code compiles\n* Use `cargo clippy` to check for code issues\n\n### Benchmarks\n\nYou can run benchmarks for `Reclass::render_inventory()` with\n\n```\ncargo bench -F bench\n```\n\nThe benchmarks are implemented with `criterion`.\n\n## Testing reclass-rs in Kapitan\n\n\nIf you're using [Kapitan], you can use reclass-rs by installing Kapitan with the optional `reclass-rs` dependency and specifying `--inventory-backend=reclass-rs` when running Kapitan.\n\n```\nKAPITAN_VENV=/path/to/your/kapitan/virtualenv\nsource ${KAPITAN_VENV}/bin/activate\npip install kapitan[reclass-rs]\n```\n\nSee the [upstream Kapitan docs](https://kapitan.dev/pages/inventory/reclass-rs/) for more details.\n\n## Automated package version management\n\nWe generate the package version of `reclass-rs` from the latest Git tag when building Python wheels.\nTo ensure this always works, we keep the version in the committed `Cargo.toml` as `0.0.0`.\n\nWe generate the package version from Git by calling `git describe --tags --always --match=v*`.\nThis command produces something like `v0.1.1-61-g531ca91`.\nWe always strip the leading `v`, since neither Cargo nor maturin support versions with leading `v`.\nIf we're building a branch or PR, we discard the component derived from the commit hash.\nFor the example output above, the package version for a branch or PR build will become `0.1.1.post61`.\nFor tag builds, the command ouptut will be just the tag, so the package version will match the tag.\n\nThe version is injected with [cargo-edit]'s `cargo set-version` before the Python wheels are built.\n\nSee the [\"Python\" workflow](./.github/workflows/python.yml) for more details.\n\n[rustup]: https://rustup.rs/\n[maturin]: https://github.com/PyO3/maturin\n[Kapitan]: https://kapitan.dev\n[cargo-edit]: https://github.com/killercup/cargo-edit\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprojectsyn%2Freclass-rs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fprojectsyn%2Freclass-rs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprojectsyn%2Freclass-rs/lists"}