https://github.com/asifarmanrahman/poetry-plugin-nar
Poetry plugin for building Apache NiFi NAR bundles.
https://github.com/asifarmanrahman/poetry-plugin-nar
Last synced: 2 months ago
JSON representation
Poetry plugin for building Apache NiFi NAR bundles.
- Host: GitHub
- URL: https://github.com/asifarmanrahman/poetry-plugin-nar
- Owner: AsifArmanRahman
- License: mit
- Created: 2024-11-15T17:35:03.000Z (7 months ago)
- Default Branch: main
- Last Pushed: 2024-11-15T17:35:08.000Z (7 months ago)
- Last Synced: 2025-01-31T10:22:23.172Z (4 months ago)
- Language: Python
- Size: 68.4 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Poetry Plugin Nar
Poetry plugin for building Apache NiFi NAR bundles.
## Installation
The easiest way to install this plugin is via the `self add` command of Poetry.
```bash
poetry self add poetry-plugin-nar@git+https://github.com/AsifArmanRahman/poetry-plugin-nar@main
```If you used `pipx` to install Poetry you can add the plugin via the `pipx inject` command.
```bash
pipx inject poetry poetry-plugin-nar@git+https://github.com/AsifArmanRahman/poetry-plugin-nar@main
```Otherwise, if you used `pip` to install Poetry you can add the plugin packages via the `pip install` command.
```bash
pip install poetry-plugin-nar@git+https://github.com/AsifArmanRahman/poetry-plugin-nar@main
```## Usage
The plugin extends the existing [build](https://python-poetry.org/docs/cli/#build) command of Poetry to add 'nar' as an option for format flag to build NAR packages.
```bash
poetry build -f nar
```Optionally, to build a NAR package with matching version and description as the `pyproject.toml` file, you can add the following configuration to the `pyproject.toml` file. The plugin expects the `version` and `description` to be path to a file, where the value of version and description from the `pyproject.toml` file will be placed during build procedure. The file should be in the format of a Python Processor where the `ProcessorDetails` *version* should be set to `__version__` and *description* should be set to `__description__`.
```toml
[tool.nar]
version = "pretty_print_json/processor.py"
description = "pretty_print_json/processor.py"
```For example, the `processor.py` file for the package `pretty_print_json` would look like the following,
```python
# pretty_print_json/processor.py.....
class PrettyPrintJson(FlowFileTransform):
class Java:
implements = [
"org.apache.nifi.python.processor.FlowFileTransform"
]class ProcessorDetails:
version = "__version__"
description = "__description__".....
```
> **Note:**
> Due to the nature of Poetry schema as of now, it is not possible to restrict `packages` or `include` files only to nar format. Therefore, packages and include files will be included in the nar package only if no format is specified.