├── .gitignore ├── CHANGELOG.md ├── LICENSE ├── README.md ├── bupy ├── __init__.py ├── __main__.py ├── butane.py ├── cli.py ├── fcos.py ├── qemu.py ├── template.py └── util.py ├── examples ├── autologin.bu ├── bupyvars.yaml └── justssh.bu.j2 ├── poetry.lock ├── poetry.toml ├── pyproject.toml ├── pyrightconfig.json ├── requirements.txt ├── setup.py └── tests ├── __init__.py ├── data ├── bad.bu.j2 └── bad.yaml └── test_bupy.py /.gitignore: -------------------------------------------------------------------------------- 1 | *.pyc 2 | *.sublime-project 3 | *.sublime-workspace 4 | .coverage 5 | .idea 6 | .mypy_cache 7 | .pytest_cache 8 | .venv/ 9 | .vscode 10 | __pycache__ 11 | coverage.xml 12 | dist 13 | env 14 | env3.6 15 | env3.7 16 | htmlcov 17 | site 18 | venv/ 19 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # CHANGELOG 2 | 3 | ## 0.1.2 4 | 5 | * Update Typer to 0.9.0 and Rich to 13.4.2. 6 | 7 | IMPROVEMENTS: 8 | 9 | * Add support for static port maps when launching a VM with QEMU. See bupy vm --help for more info. 10 | * Check for DISPLAY in the env and set -display none on QEMU if running on a headless server. 11 | * Detect if we are sending Template output to a TTY or not 12 | 13 | ## 0.1.1 14 | 15 | IMPROVEMENTS: 16 | 17 | * Python 3.8.10^ support. 18 | 19 | ## 0.1.0 20 | 21 | * Initial release! 22 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "{}" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright 2022 QuickVM, LLC 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Bupy 2 | 3 | The **Bu**tane **Py**thon Toolkit 4 | 5 | Bupy was built to help users develop Butane configurations for Fedora CoreOS quickly on their workstations. It allows you to convert Butane YAML to Ignition JSON and render Butane Jinja2 templates to either Butane YAML or Ignition JSON. You can then use your Butane file or template to launch a local QEMU Virtual Machine. 6 | 7 | ### Requirements 8 | 9 | * [Python 3.8.10^](https://www.python.org/downloads/) 10 | * [butane](https://coreos.github.io/butane/) 11 | * [qemu](https://www.qemu.org/download/) 12 | * If possible, a positive attitude 13 | 14 | ### Roadmap 15 | 16 | * [x] Convert Support 17 | 18 | * [x] Jinja2 Template Support 19 | * [x] Launch a local QEMU FCOS VM 20 | * [ ] Merge Butane YAML (snippets) 21 | * [ ] Serve Ignition JSON via HTTP 22 | * [ ] Libvirt support 23 | 24 | ### Demo 25 | 26 | You can watch a quick demo of Bupy on Youtube. 27 | 28 | [![Quick demo of Bupy for Fedora CoreOS](https://img.youtube.com/vi/yBOEz827TUU/0.jpg)](https://www.youtube.com/watch?v=yBOEz827TUU) 29 | 30 | ### Development 31 | 32 | 1) Clone this repo 33 | 2) Install dependencies 34 | 35 | ```bash 36 | poetry install 37 | ``` 38 | 39 | 3) Activate a poetry shell 40 | 41 | ```bash 42 | poetry shell 43 | ``` 44 | 45 | 4) Make changes... 46 | 5) See them in action 47 | 48 | ```bash 49 | bupy --help 50 | 51 | Usage: bupy [OPTIONS] COMMAND [ARGS]... 52 | 53 | Bupy: Butane Python toolkit. 54 | 55 | ╭─ Options ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ 56 | │ --version -v Show the version and exit. │ 57 | │ --install-completion Install completion for the current shell. │ 58 | │ --show-completion Show completion for the current shell, to copy it or customize the installation. │ 59 | │ --help Show this message and exit. │ 60 | ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ 61 | ╭─ Commands ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ 62 | │ convert Converts Butane YAML to Ignition JSON │ 63 | │ template Renders a Jinja2 Template to Butane YAML or Ignition JSON │ 64 | │ vm Launches a QEMU VM with a Butane YAML or Jinja2 Template │ 65 | ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ 66 | 67 | Made in ✶✶✶✶ Chicago✶✶✶✶ 〜 (c) 2023 QuickVM, LLC 68 | ``` 69 | 70 | ## License 71 | 72 | [Apache License Version 2.0](http://www.apache.org/licenses/LICENSE-2.0>) 73 | 74 | Copyright 2023 QuickVM, LLC 75 | -------------------------------------------------------------------------------- /bupy/__init__.py: -------------------------------------------------------------------------------- 1 | __app_name__ = "bupy" 2 | __version__ = "0.1.2" 3 | -------------------------------------------------------------------------------- /bupy/__main__.py: -------------------------------------------------------------------------------- 1 | from bupy import cli, __app_name__ 2 | 3 | 4 | def main(): 5 | cli.app(prog_name=__app_name__) 6 | 7 | 8 | if __name__ == "__main__": 9 | main() 10 | -------------------------------------------------------------------------------- /bupy/butane.py: -------------------------------------------------------------------------------- 1 | from pathlib import Path 2 | from subprocess import Popen, PIPE, STDOUT 3 | import sys 4 | import typer 5 | 6 | 7 | # Todo: Capture stderr and do something about it 8 | def butane_to_ignition(bu: bytes) -> bytes: 9 | """ 10 | Create Ignition JSON from Butane YAML 11 | """ 12 | butane = "butane" 13 | butane_subprocess = Popen(butane, stdin=PIPE, stdout=PIPE, stderr=STDOUT) 14 | ignition_data = butane_subprocess.communicate(input=bu)[0] 15 | 16 | return ignition_data 17 | 18 | 19 | def butane_encode(bu: str) -> bytes: 20 | 21 | if sys.stdin.isatty(): 22 | with open(f"{bu}", "rb") as opened_file: 23 | butane_encoded = opened_file.read() 24 | else: 25 | butane_encoded = bu.encode() 26 | return butane_encoded 27 | 28 | 29 | def butane_write(bu: bytes, file_name: str, force: bool, exit: bool) -> None: 30 | 31 | if not Path(file_name).is_file() or force: 32 | with open(f"{file_name}", "w") as f: 33 | f.write(bu.decode("utf-8")) 34 | if exit: 35 | raise typer.Exit(code=0) 36 | else: 37 | overwrite_it = typer.confirm(f"Overwrite {file_name}?") 38 | if not overwrite_it: 39 | raise typer.Abort() 40 | with open(f"{file_name}", "w") as f: 41 | f.write(bu.decode("utf-8")) 42 | if exit: 43 | raise typer.Exit(code=0) 44 | -------------------------------------------------------------------------------- /bupy/cli.py: -------------------------------------------------------------------------------- 1 | from bupy import butane, fcos, qemu, util, __app_name__, __version__ 2 | from bupy import template as tpl 3 | from pathlib import Path 4 | from rich import print as rprint 5 | from rich import print_json 6 | from rich.syntax import Syntax 7 | from rich.console import Console 8 | from tempfile import NamedTemporaryFile 9 | from typing import List, Optional 10 | import sys 11 | import time 12 | import typer 13 | 14 | 15 | app = typer.Typer( 16 | help="[bold]Bupy:[/bold] [bold]Bu[/bold]tane [bold]Py[/bold]thon toolkit.", 17 | rich_markup_mode="rich", 18 | no_args_is_help=True, 19 | epilog="Made in [pale_turquoise1]✶✶✶✶[/pale_turquoise1] [red1]Chicago[/red1][pale_turquoise1]✶✶✶✶[/pale_turquoise1] 〜 (c) 2023 QuickVM, LLC", 20 | pretty_exceptions_show_locals=False, 21 | ) 22 | 23 | 24 | @app.callback() 25 | def main( 26 | version: Optional[bool] = typer.Option( 27 | None, 28 | "--version", 29 | "-v", 30 | help="Show the version and exit.", 31 | callback=util.version_callback, 32 | is_eager=True, 33 | ) 34 | ) -> None: 35 | return 36 | 37 | 38 | @app.command() 39 | def convert( 40 | file: str = typer.Argument( 41 | ... if sys.stdin.isatty() else sys.stdin.read().strip(), 42 | help="Reads Butane from a file or stdin and converts it to Ignition JSON.", 43 | ), 44 | write: str = typer.Option("", "--write", "-w", help="Write the Ignition JSON to a file."), 45 | force: bool = typer.Option(False, "--force", "-f", help="Overwrite an existing Ignition file."), 46 | pretty: bool = typer.Option( 47 | False, "--pretty", "-p", help="Makes the Ignition JSON pretty. Sooo pretty..." 48 | ), 49 | ): 50 | """ 51 | Converts Butane YAML to Ignition JSON 52 | """ 53 | butane_binary = util.find_binary("butane") 54 | 55 | if butane_binary is None: 56 | rprint( 57 | "[bold red]Error:[/bold red] The butane binary could not be found! Please [link=https://coreos.github.io/butane/getting-started/]install[/link] it." 58 | ) 59 | raise typer.Exit(code=1) 60 | 61 | butane_file = butane.butane_encode(file) 62 | 63 | ignition_json = butane.butane_to_ignition(butane_file) 64 | 65 | if write: 66 | butane.butane_write(ignition_json, file, force, True) 67 | if pretty: 68 | print_json(ignition_json.decode("utf-8")) 69 | else: 70 | if sys.stdout.isatty(): 71 | rprint(ignition_json.decode("utf-8")) 72 | else: 73 | print(ignition_json.decode("utf-8")) 74 | 75 | 76 | # @app.command() 77 | # def merge(): 78 | # """ 79 | # Merges Butane files together 80 | # """ 81 | # typer.echo("Merging Butane files...") 82 | 83 | 84 | @app.command() 85 | def vm( 86 | file: str = typer.Argument( 87 | ... if sys.stdin.isatty() else sys.stdin.read().strip(), 88 | help="Reads Butane from a file or stdin and converts it to Ignition JSON.", 89 | show_default=False, 90 | ), 91 | template: str = typer.Option( 92 | "", 93 | "--template", 94 | "-t", 95 | help="Read file as a Jinja2 template and load a variables file.\n(--template bupyvars.yaml template.bu.j2)", 96 | ), 97 | write: str = typer.Option("", "--write", "-w", help="Write the Ignition JSON to a file."), 98 | force: bool = typer.Option(False, "--force", "-f", help="Overwrite an existing Ignition file."), 99 | stream: str = typer.Option( 100 | "stable", 101 | "--stream", 102 | "-s", 103 | help="Fedora CoreOS Stream: stable, testing, next", 104 | ), 105 | arch: str = typer.Option( 106 | "x86_64", 107 | "--arch", 108 | "-a", 109 | help="Fedora CoreOS arch: aarch64, s390x, x86_64", 110 | ), 111 | ram: int = typer.Option(1024, "--ram", "-r", help="RAM amount in MB"), 112 | ports: Optional[List[str]] = typer.Option( 113 | None, 114 | "--port", 115 | "-p", 116 | help="Pass a single port number (8080) to map a random host port to the VM port. Pass 8080:80 to assign a static host port to the VM port. The --port option can be used many times. The port range allowed is 1 - 65535.", 117 | ), 118 | ): 119 | """ 120 | Launches a QEMU VM with a Butane YAML or Jinja2 Template 121 | """ 122 | 123 | butane_binary = util.find_binary("butane") 124 | qemu_binary = util.find_binary("qemu-system-x86_64") 125 | 126 | if butane_binary is None: 127 | rprint( 128 | "[bold red]Error:[/bold red] The butane binary could not be found! Please [link=https://coreos.github.io/butane/getting-started/]install[/link] it." 129 | ) 130 | raise typer.Exit(code=1) 131 | 132 | if qemu_binary is None: 133 | rprint( 134 | "[bold red]Error:[/bold red] The qemu-kvm binary could not be found! Please [link=https://www.qemu.org/download/]install[/link] it." 135 | ) 136 | raise typer.Exit(code=1) 137 | 138 | # Download FCOS image and stick it in ~/.local/share/libvirt/images 139 | # TODO: move this to fcos.py and add download flags 140 | home = str(Path.home()) 141 | libvirt_image_path = "/.local/share/libvirt/images" 142 | local_fcos_download_path = home + libvirt_image_path 143 | fcos_stream_data = fcos.get_stream_data(stream) 144 | fcos_download_url = fcos.Fcos(fcos_stream_data).get_disk( 145 | arch=arch, platform="qemu", disk_format="qcow2.xz" 146 | ) 147 | fcos_disk = fcos.download_disk(fcos_download_url, local_fcos_download_path) 148 | 149 | if template: 150 | with util.SilenceTemplateException(): 151 | butane_file = tpl.rendered_template(file, tpl.read_template_vars(template)) 152 | else: 153 | butane_file = butane.butane_encode(file) 154 | 155 | ignition_json = butane.butane_to_ignition(butane_file) 156 | 157 | if write: 158 | butane.butane_write(ignition_json, file, force, False) 159 | 160 | ignition_launch_file = NamedTemporaryFile(delete=False, suffix=".ign") 161 | ignition_launch_file_path = ignition_launch_file.name 162 | 163 | with open(ignition_launch_file_path, "wb") as ignition_launch_file: 164 | ignition_launch_file.write(ignition_json) 165 | 166 | qemu.launch(ram, fcos_disk, ignition_launch_file_path, ports) 167 | rprint("VM Launched! :rocket:") 168 | time.sleep(2) 169 | Path(ignition_launch_file_path).unlink() 170 | 171 | 172 | # @app.command() 173 | # def serve(): 174 | # """ 175 | # Serve an Ignition file via HTTP on a specified port 176 | # """ 177 | # typer.echo("Coming soon...") 178 | 179 | 180 | @app.command() 181 | def template( 182 | template: str = typer.Argument( 183 | ... if sys.stdin.isatty() else sys.stdin.read().strip(), 184 | help="Reads a Jinja2 template from a file or stdin, renders the template and converts it to Ignition JSON.", 185 | show_default=False, 186 | ), 187 | variables: str = typer.Argument( 188 | ..., 189 | help="Reads a YAML file to use as variables for rendering a Jinja2 template.", 190 | ), 191 | show: bool = typer.Option( 192 | False, "--show", "-s", help="Print the rendered template.", show_default=False 193 | ), 194 | line_numbers: bool = typer.Option( 195 | True, "--numbers", "-n", help="Show line numbers in printed template." 196 | ), 197 | write: str = typer.Option("", "--write", "-w", help="Write the Ignition JSON to a file."), 198 | force: bool = typer.Option(False, "--force", "-f", help="Overwrite an existing Ignition file."), 199 | pretty: bool = typer.Option( 200 | False, "--pretty", "-p", help="Makes the Ignition JSON pretty. Very pretty..." 201 | ), 202 | ): 203 | """ 204 | Renders a Jinja2 Template to Butane YAML or Ignition JSON 205 | """ 206 | butane_binary = util.find_binary("butane") 207 | 208 | if butane_binary is None: 209 | rprint( 210 | "[bold red]Error:[/bold red] The butane binary could not be found! Please [link=https://coreos.github.io/butane/getting-started/]install[/link] it." 211 | ) 212 | raise typer.Exit(code=1) 213 | 214 | with util.SilenceTemplateException(): 215 | if show: 216 | bu = tpl.rendered_template(template, tpl.read_template_vars(variables)).decode("utf-8") 217 | if sys.stdout.isatty(): 218 | syntax = Syntax(bu, "YAML", line_numbers=line_numbers) 219 | console = Console(color_system=None) 220 | console.print(syntax) 221 | else: 222 | print(bu) 223 | raise typer.Exit() 224 | 225 | # TODO: Add support for finding bupyvars.yaml file in CWD, or in the directory the template resides in. 226 | # cwd = Path.cwd() 227 | template_output = tpl.rendered_template(template, tpl.read_template_vars(variables)) 228 | ignition_json = butane.butane_to_ignition(template_output) 229 | 230 | if write: 231 | butane.butane_write(ignition_json, write, force, True) 232 | if pretty: 233 | print_json(ignition_json.decode("utf-8")) 234 | else: 235 | if sys.stdout.isatty(): 236 | rprint(ignition_json.decode("utf-8")) 237 | else: 238 | print(ignition_json.decode("utf-8")) 239 | -------------------------------------------------------------------------------- /bupy/fcos.py: -------------------------------------------------------------------------------- 1 | from collections import deque 2 | from pathlib import Path 3 | from rich import print as rprint 4 | from rich.progress import Progress, SpinnerColumn, TextColumn 5 | from rich.progress import wrap_file 6 | import copy 7 | import json 8 | import lzma 9 | import os 10 | import shutil 11 | import tempfile 12 | import urllib3 13 | 14 | 15 | class Token: 16 | def __init__(self, name, is_var=False) -> None: 17 | self.name = name 18 | self.is_var = is_var 19 | 20 | def get(self, data, args, **kwargs): 21 | 22 | if not self.is_var: 23 | return data.get(self.name, {}) 24 | v = kwargs.get(self.name, None) 25 | if not v: 26 | v = args.popleft() 27 | return data.get(v, {}) 28 | 29 | 30 | class Fcos: 31 | 32 | lookups = { 33 | "disk": [ 34 | Token("architectures"), 35 | Token("arch", True), 36 | Token("artifacts"), 37 | Token("platform", True), 38 | Token("formats"), 39 | Token("disk_format", True), 40 | Token("disk"), 41 | ], 42 | "disk_location": [ 43 | Token(*x) 44 | for x in [ 45 | ("architectures",), 46 | ("arch", True), 47 | ("artifacts",), 48 | ("platform", True), 49 | ("formats",), 50 | ("disk_format", True), 51 | ("disk",), 52 | ("location",), 53 | ] 54 | ], 55 | "disk_sha256": [ 56 | Token(*x) 57 | for x in [ 58 | ("architectures",), 59 | ("arch", True), 60 | ("artifacts",), 61 | ("platform", True), 62 | ("formats",), 63 | ("disk_format", True), 64 | ("disk",), 65 | ("sha256",), 66 | ] 67 | ], 68 | } 69 | 70 | def __init__(self, data): 71 | self._data = data 72 | 73 | def get_item(self, item_name, *args, **kwargs): 74 | cur_data = copy.deepcopy(self._data) 75 | deque(args) 76 | 77 | for item in self.lookups[item_name]: 78 | cur_data = item.get(cur_data, args, **kwargs) 79 | return cur_data 80 | 81 | def get_disk(self, *args, **kwargs): 82 | return self.get_item("disk_location", *args, **kwargs) 83 | 84 | def get_sha256(self, *args, **kwargs): 85 | return self.get_item("disk_sha256", *args, **kwargs) 86 | 87 | 88 | def get_stream_data( 89 | fcos_stream="stable", 90 | fcos_json_url="https://builds.coreos.fedoraproject.org/streams/", 91 | ): 92 | """ 93 | Grabs FCOS stream data off a URL 94 | """ 95 | http = urllib3.PoolManager() 96 | resp = http.request("GET", fcos_json_url + fcos_stream + ".json") 97 | fcos_stream_data = json.loads(resp.data) 98 | 99 | return fcos_stream_data 100 | 101 | 102 | def libvirt_image_path(libvirt_image_path=None): 103 | 104 | if libvirt_image_path is not None: 105 | local_libvirt_image_path = libvirt_image_path 106 | else: 107 | home = str(Path.home()) 108 | libvirt_image_path = "/.local/share/libvirt/images" 109 | local_libvirt_image_path = home + libvirt_image_path 110 | return local_libvirt_image_path 111 | 112 | 113 | # TODO: Add list disks support 114 | # def list_disks(): 115 | # fcos_disks = 116 | # for path in os.scandir(dir_path): 117 | # if path.is_file(): 118 | # rprint(path.name) 119 | 120 | # TODO: If you ctrl+c in the middle of the extract it leaves a incomplete VM qcow2 file. We should clean that up if we exit in the middle of an extraction 121 | def download_disk(download_url, download_path=None): 122 | """ 123 | Download and verify FCOS disk image 124 | """ 125 | 126 | if download_path is not None: 127 | download_path = download_path 128 | else: 129 | download_path = libvirt_image_path() 130 | 131 | archive_name = os.path.basename(download_url) 132 | disk_name = os.path.splitext(archive_name)[0] 133 | disk_path = download_path + "/" + disk_name 134 | 135 | if not os.path.exists(download_path): 136 | os.makedirs(download_path, mode=0o775) 137 | rprint(download_path + " does not exist. Creating it!") 138 | 139 | if os.path.exists(disk_path): 140 | rprint(disk_path + " already exists. Skipping download!") 141 | rprint("") 142 | else: 143 | with tempfile.TemporaryDirectory() as tmpdirname: 144 | 145 | archive_path = tmpdirname + "/" + archive_name 146 | http = urllib3.PoolManager() 147 | download_file = http.request("GET", download_url, preload_content=False) 148 | download_size = int(download_file.headers["Content-Length"]) 149 | 150 | with wrap_file( 151 | download_file, 152 | download_size, 153 | description=f"Downloading {archive_name}", 154 | ) as req: 155 | with open(archive_path, "wb") as out_file: 156 | shutil.copyfileobj(req, out_file) 157 | 158 | with Progress( 159 | TextColumn("[progress.description]{task.description}"), 160 | SpinnerColumn(), 161 | transient=True, 162 | ) as progress: 163 | progress.add_task(description=f"Extracting {archive_name}...", total=None) 164 | with lzma.open(archive_path) as archive_content: 165 | with open(disk_path, "wb") as write_disk: 166 | shutil.copyfileobj(archive_content, write_disk) 167 | rprint(f"Extracting {archive_name}... Done!") 168 | 169 | return disk_path 170 | -------------------------------------------------------------------------------- /bupy/qemu.py: -------------------------------------------------------------------------------- 1 | import os 2 | import re 3 | import shlex 4 | import socket 5 | import subprocess 6 | import typer 7 | from rich import print as rprint 8 | from typing import List 9 | 10 | 11 | def find_port() -> int: 12 | """ 13 | Find a random open port to use 14 | """ 15 | sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) 16 | sock.bind(("", 0)) 17 | sock.listen(1) 18 | port = sock.getsockname()[1] 19 | sock.close() 20 | return port 21 | 22 | 23 | def check_port(port: int) -> bool: 24 | """ 25 | Check to see if a port is available to use 26 | """ 27 | sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) 28 | result = False 29 | try: 30 | sock.bind(("", port)) 31 | result = True 32 | except: 33 | rprint(f"[bold red]Error:[/bold red] Port {port} is already in use!") 34 | sock.close() 35 | return result 36 | 37 | 38 | def validate_port_format(port: str) -> bool: 39 | """ 40 | Validate port format. The port has to be between 1 and 65535 as a single number (8080) or a port pair (8080:80) 41 | """ 42 | range_expression = r"(\d{1,4}|[1-5]\d{4}|6[0-4]\d{3}|65[0-4]\d{2}|655[0-2]\d|6553[0-5])" 43 | pattern = rf"^{range_expression}$|^{range_expression}:{range_expression}$" 44 | match = re.match(pattern, port) 45 | if match: 46 | return True 47 | else: 48 | rprint( 49 | f"[bold red]Error:[/bold red] The port {port} is not between 1 - 65535 and input as a single number (8080) or a port pair (8080:80)!" 50 | ) 51 | raise typer.Exit(code=1) 52 | 53 | 54 | def launch(ram: int, qcow: str, ign: str, ports: List[str]) -> int: 55 | """ 56 | Launch FCOS with QEMU 57 | """ 58 | 59 | hostfwd_list = [] 60 | port_maps = [] 61 | 62 | if not "22" or not any(port.endswith(":22") for port in ports): 63 | ports.append("22") 64 | 65 | for port in ports: 66 | validate_port_format(port) 67 | if ":" not in port: 68 | port = int(port) 69 | if isinstance(port, int): 70 | host_port = find_port() 71 | vm_port = port 72 | elif isinstance(port, str): 73 | numbers = port.split(":") 74 | host_port = int(numbers[0]) 75 | vm_port = int(numbers[1]) 76 | 77 | if not check_port(host_port): 78 | raise typer.Exit(code=1) 79 | 80 | if vm_port == 22: 81 | ssh_port = host_port 82 | 83 | paired_ports = f"{host_port}:{vm_port}" 84 | port_maps.append(paired_ports) 85 | 86 | hostfwd_port = f"hostfwd=tcp::{host_port}-:{vm_port}" 87 | hostfwd_list.append(hostfwd_port) 88 | 89 | joined_hostfwd = ",".join(hostfwd_list) 90 | 91 | if not os.environ.get("DISPLAY"): 92 | display = "-display none" 93 | else: 94 | display = "" 95 | 96 | qemu_cmd = f"qemu-system-x86_64 \ 97 | -m {ram} \ 98 | -enable-kvm \ 99 | -cpu host \ 100 | -snapshot \ 101 | -daemonize \ 102 | -drive if=virtio,file={qcow} \ 103 | -name bupy-vm-{ssh_port} \ 104 | -fw_cfg name=opt/com.coreos/config,file={ign} \ 105 | -nic user,model=virtio,{joined_hostfwd} \ 106 | {display}" 107 | qemu_cmd_split = shlex.split(qemu_cmd) 108 | 109 | rprint("Launching QEMU VM...") 110 | process = subprocess.Popen(qemu_cmd_split, start_new_session=True) 111 | qemu_pid = process.pid 112 | 113 | rprint(f"The PID is: {qemu_pid}") 114 | rprint("") 115 | rprint(f"The SSH port is: {ssh_port}") 116 | rprint( 117 | f"ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no core@localhost -p {ssh_port}" 118 | ) 119 | rprint("") 120 | rprint("The port mappings are:") 121 | rprint("") 122 | for pairs in port_maps: 123 | rprint(pairs) 124 | rprint("") 125 | return 0 126 | -------------------------------------------------------------------------------- /bupy/template.py: -------------------------------------------------------------------------------- 1 | # Exception handling derived from 2 | # https://github.com/cidrblock/td4a/blob/master/td4a/models/exception_handler.py 3 | # MIT License 4 | # Copyright (c) 2017 Bradley A. Thornton 5 | 6 | from jinja2 import meta, Environment, Template, StrictUndefined, Undefined 7 | import ruamel.yaml as yaml 8 | from typer import Exit 9 | import re 10 | import sys 11 | import traceback 12 | 13 | 14 | class TemplateException(Exception): 15 | def __init__(self, value) -> None: 16 | self.value = value 17 | super().__init__(self) 18 | 19 | def __str__(self): 20 | return repr(self.value) 21 | 22 | 23 | class TemplateExceptionHandler(object): 24 | """ 25 | Handle YAML and Jinja2 exceptions 26 | """ 27 | 28 | def __init__(self, function): 29 | self.function = function 30 | self.error = ( 31 | self.template_file 32 | ) = self.tback = self.exc_type = self.exc_value = self.exc_traceback = None 33 | self.error_map = { 34 | "ruamel.yaml.parser.ParserError": self.parser_error, 35 | "ruamel.yaml.constructor.ConstructorError": self.constructor_error, 36 | "ruamel.yaml.constructor.DuplicateKeyError": self.duplicate_key_error, 37 | "ruamel.yaml.scanner.ScannerError": self.scanner_error, 38 | "jinja2.exceptions": self.jinja_error, 39 | } 40 | 41 | def __call__(self, *args): 42 | try: 43 | return self.function(*args) 44 | except Exception as error: 45 | self.error = error 46 | self.exc_type, self.exc_value, self.exc_traceback = sys.exc_info() 47 | self.tback = traceback.extract_tb(self.exc_traceback) 48 | 49 | error_module = getattr(error, "__module__", None) 50 | if error_module: 51 | full_error = "%s.%s" % (error.__module__, self.exc_type.__name__) 52 | else: 53 | full_error = self.exc_type.__name__ 54 | handler = self.error_map.get(full_error, self.error_map.get(error_module, self.unhandled)) 55 | self.template_file = args[0] 56 | message = handler() 57 | raise TemplateException(message) 58 | 59 | def error_response(self, message, line_number): 60 | if line_number: 61 | error_payload = f"Issue processing {self.template_file}:{line_number} with the error message of: {message}" 62 | else: 63 | error_payload = ( 64 | f"Issue processing {self.template_file} with the error message of: {message}" 65 | ) 66 | return error_payload 67 | 68 | def constructor_error(self): 69 | line_number = self.error.problem_mark.line + 1 70 | message = next(x for x in str(self.error).splitlines() if x.startswith("found")) 71 | return self.error_response(message=message, line_number=line_number) 72 | 73 | def duplicate_key_error(self): 74 | line_number = self.error.problem_mark.line + 1 75 | message = next(x for x in str(self.error).splitlines() if x.startswith("found")).split( 76 | "with" 77 | )[0] 78 | return self.error_response(message=message, line_number=line_number) 79 | 80 | def jinja_error(self): 81 | message = str(self.error).replace("'ruamel.yaml.comments.CommentedMap object'", "Object") 82 | line_numbers = [x for x in self.tback if re.search("^<.*>$", x[0])] 83 | if line_numbers: 84 | line_number = line_numbers[0][1] 85 | else: 86 | line_number = "unknown" 87 | return self.error_response(message=message, line_number=line_number) 88 | 89 | def parser_error(self): 90 | line_number = self.error.problem_mark.line + 1 91 | messages = [x for x in str(self.error).splitlines() if x.startswith("expected")] 92 | if messages: 93 | message = messages[0] 94 | else: 95 | message = str(self.error) 96 | return self.error_response(message=message, line_number=line_number) 97 | 98 | def scanner_error(self): 99 | line_number = self.error.problem_mark.line + 1 100 | message = str(self.error).splitlines()[0] 101 | return self.error_response(message=message, line_number=line_number) 102 | 103 | def unhandled(self): 104 | print(self.exc_type, self.exc_value, self.exc_traceback, self.tback, self.error) 105 | line_numbers = [x for x in self.tback if re.search("^<.*>$", x[0])] 106 | if line_numbers: 107 | line_number = line_numbers[0][1] 108 | else: 109 | line_number = None 110 | message = self.error 111 | return self.error_response(message=message, line_number=line_number) 112 | 113 | 114 | @TemplateExceptionHandler 115 | def read_template_vars(file_path: str) -> dict: 116 | """ 117 | Reads in template vars from a file 118 | """ 119 | try: 120 | with open(file_path, "rb") as f: 121 | template_vars = yaml.load(f, yaml.SafeLoader) 122 | return template_vars 123 | except TemplateException as err: 124 | print(err) 125 | 126 | 127 | @TemplateExceptionHandler 128 | def verify_template(file_path: str) -> bool: 129 | """ 130 | Verifies if the loaded file is a valid Jinja2 template 131 | """ 132 | env = Environment() 133 | try: 134 | with open(file_path, "r") as f: 135 | env.parse(f.read()) 136 | return True 137 | except TemplateException as err: 138 | print(err) 139 | return False 140 | 141 | 142 | @TemplateExceptionHandler 143 | def rendered_template(file_path: str, template_vars: dict) -> bytes: 144 | """ 145 | Renders a Jinja2 template from a file 146 | """ 147 | try: 148 | with open(file_path, "r") as f: 149 | rendered_template = Template(f.read()).render(template_vars) 150 | return rendered_template.encode("utf-8") 151 | except TemplateException as err: 152 | print(err) 153 | -------------------------------------------------------------------------------- /bupy/util.py: -------------------------------------------------------------------------------- 1 | from bupy import __app_name__, __version__ 2 | from rich import print as rprint 3 | import os 4 | import shutil 5 | import typer 6 | import xdg 7 | 8 | 9 | class SilenceTemplateException: 10 | def __init__(self): 11 | pass 12 | 13 | def __enter__(self): 14 | return self 15 | 16 | def __exit__(self, ex_type, ex_value, ex_traceback): 17 | from bupy.template import TemplateException 18 | 19 | if ex_type is TemplateException: 20 | rprint(f"[bold red]Error:[/bold red] [red]{ex_value}[/red]") 21 | raise typer.Abort() 22 | 23 | 24 | def find_binary(name: str): 25 | """ 26 | Finds a binary on the system by name and checks if it is executable. 27 | """ 28 | binary = shutil.which(name) 29 | 30 | return binary 31 | 32 | 33 | def create_xdg_config_dir(name: str) -> str: 34 | """ 35 | Creates the bupy config directory in $XDG_CONFIG_HOME/bupy 36 | """ 37 | 38 | directory = xdg.BaseDirectory.save_config_path(name) 39 | if not os.path.exists(directory): 40 | xdg_config_dir = os.makedirs(directory) 41 | 42 | return xdg_config_dir 43 | 44 | 45 | def version_callback(value: bool) -> None: 46 | if value: 47 | rprint(f"{__app_name__}: {__version__}") 48 | raise typer.Exit() 49 | -------------------------------------------------------------------------------- /examples/autologin.bu: -------------------------------------------------------------------------------- 1 | variant: fcos 2 | version: 1.4.0 3 | storage: 4 | files: 5 | - path: /etc/hostname 6 | mode: 0644 7 | contents: 8 | inline: | 9 | autologin-example 10 | - path: /etc/profile.d/systemd-pager.sh 11 | mode: 0644 12 | contents: 13 | inline: | 14 | # Tell systemd to not use a pager when printing information 15 | export SYSTEMD_PAGER=cat 16 | - path: /etc/sysctl.d/20-silence-audit.conf 17 | mode: 0644 18 | contents: 19 | inline: | 20 | # Raise console message logging level from DEBUG (7) to WARNING (4) 21 | # to hide audit messages from the interactive console 22 | kernel.printk=4 23 | systemd: 24 | units: 25 | - name: serial-getty@ttyS0.service 26 | dropins: 27 | - name: autologin-core.conf 28 | contents: | 29 | [Service] 30 | # Override Execstart in main unit 31 | ExecStart= 32 | # Add new Execstart with `-` prefix to ignore failure` 33 | ExecStart=-/usr/sbin/agetty --autologin core --noclear %I $TERM 34 | -------------------------------------------------------------------------------- /examples/bupyvars.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | passwd: 3 | users: 4 | - name: core 5 | sshkey: 6 | - ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEmTTqLpDYDfxKgCEVcbCNZxaI25rjbHlnhdCfKajHS1 bupy@quickvm.com 7 | - ssh-ed25519 AAAAC3NzaC1lZDI1NTE5BBBBIEmTTqLpDYDfxKgCEVcbCNZxaI25rjbHlnhdCfKajHS1 bupy@quickvm.com 8 | - name: bluey 9 | groups: 10 | - sudo 11 | - wheel 12 | - gooddogs 13 | sshkey: 14 | - ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEmTTqLpDYDfxKgCEVcbCNZxaI25rjbHlnhdCfKajHS1 bupy@quickvm.com 15 | - name: bingo 16 | groups: 17 | - gooddogs 18 | sshkey: 19 | - ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEmTTqLpDYDfxKgCEVcbCNZxaI25rjbHlnhdCfKajHS1 bupy@quickvm.com 20 | - name: bandit 21 | group: 22 | - gooddogs 23 | - name: chili 24 | groups: 25 | - name: gooddogs 26 | - name: devels 27 | - name: managers 28 | hostname: testing 29 | domain_name: quickvm.com 30 | -------------------------------------------------------------------------------- /examples/justssh.bu.j2: -------------------------------------------------------------------------------- 1 | variant: fcos 2 | version: 1.4.0 3 | 4 | passwd: 5 | users: 6 | {%- for item in passwd.users %} 7 | - name: {{ item.name }} 8 | {%- if item.groups %} 9 | groups: 10 | {%- for item in item.groups %} 11 | - {{ item }} 12 | {%- endfor %} 13 | {%- endif %} 14 | {%- if item.sshkey %} 15 | ssh_authorized_keys: 16 | {%- for item in item.sshkey %} 17 | - {{ item }} 18 | {%- endfor %} 19 | {%- endif %} 20 | {%- endfor %} 21 | {%- if passwd.groups %} 22 | groups: 23 | {%- for item in passwd.groups %} 24 | - name: {{ item.name }} 25 | {%- endfor %} 26 | {%- endif %} 27 | 28 | storage: 29 | files: 30 | - path: /etc/hostname 31 | mode: 0644 32 | overwrite: true 33 | contents: 34 | inline: {{ hostname }}.{{ domain_name }} 35 | 36 | - path: /etc/systemd/zram-generator.conf 37 | mode: 0644 38 | contents: 39 | inline: | 40 | # This config file enables a /dev/zram0 device with the default settings 41 | [zram0] 42 | 43 | - path: /etc/sysctl.d/20-silence-audit.conf 44 | contents: 45 | inline: | 46 | kernel.printk=4 47 | -------------------------------------------------------------------------------- /poetry.lock: -------------------------------------------------------------------------------- 1 | # This file is automatically @generated by Poetry 1.4.1 and should not be changed by hand. 2 | 3 | [[package]] 4 | name = "black" 5 | version = "23.7.0" 6 | description = "The uncompromising code formatter." 7 | category = "dev" 8 | optional = false 9 | python-versions = ">=3.8" 10 | files = [ 11 | {file = "black-23.7.0-cp310-cp310-macosx_10_16_arm64.whl", hash = "sha256:5c4bc552ab52f6c1c506ccae05681fab58c3f72d59ae6e6639e8885e94fe2587"}, 12 | {file = "black-23.7.0-cp310-cp310-macosx_10_16_universal2.whl", hash = "sha256:552513d5cd5694590d7ef6f46e1767a4df9af168d449ff767b13b084c020e63f"}, 13 | {file = "black-23.7.0-cp310-cp310-macosx_10_16_x86_64.whl", hash = "sha256:86cee259349b4448adb4ef9b204bb4467aae74a386bce85d56ba4f5dc0da27be"}, 14 | {file = "black-23.7.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:501387a9edcb75d7ae8a4412bb8749900386eaef258f1aefab18adddea1936bc"}, 15 | {file = "black-23.7.0-cp310-cp310-win_amd64.whl", hash = "sha256:fb074d8b213749fa1d077d630db0d5f8cc3b2ae63587ad4116e8a436e9bbe995"}, 16 | {file = "black-23.7.0-cp311-cp311-macosx_10_16_arm64.whl", hash = "sha256:b5b0ee6d96b345a8b420100b7d71ebfdd19fab5e8301aff48ec270042cd40ac2"}, 17 | {file = "black-23.7.0-cp311-cp311-macosx_10_16_universal2.whl", hash = "sha256:893695a76b140881531062d48476ebe4a48f5d1e9388177e175d76234ca247cd"}, 18 | {file = "black-23.7.0-cp311-cp311-macosx_10_16_x86_64.whl", hash = "sha256:c333286dc3ddca6fdff74670b911cccedacb4ef0a60b34e491b8a67c833b343a"}, 19 | {file = "black-23.7.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:831d8f54c3a8c8cf55f64d0422ee875eecac26f5f649fb6c1df65316b67c8926"}, 20 | {file = "black-23.7.0-cp311-cp311-win_amd64.whl", hash = "sha256:7f3bf2dec7d541b4619b8ce526bda74a6b0bffc480a163fed32eb8b3c9aed8ad"}, 21 | {file = "black-23.7.0-cp38-cp38-macosx_10_16_arm64.whl", hash = "sha256:f9062af71c59c004cd519e2fb8f5d25d39e46d3af011b41ab43b9c74e27e236f"}, 22 | {file = "black-23.7.0-cp38-cp38-macosx_10_16_universal2.whl", hash = "sha256:01ede61aac8c154b55f35301fac3e730baf0c9cf8120f65a9cd61a81cfb4a0c3"}, 23 | {file = "black-23.7.0-cp38-cp38-macosx_10_16_x86_64.whl", hash = "sha256:327a8c2550ddc573b51e2c352adb88143464bb9d92c10416feb86b0f5aee5ff6"}, 24 | {file = "black-23.7.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6d1c6022b86f83b632d06f2b02774134def5d4d4f1dac8bef16d90cda18ba28a"}, 25 | {file = "black-23.7.0-cp38-cp38-win_amd64.whl", hash = "sha256:27eb7a0c71604d5de083757fbdb245b1a4fae60e9596514c6ec497eb63f95320"}, 26 | {file = "black-23.7.0-cp39-cp39-macosx_10_16_arm64.whl", hash = "sha256:8417dbd2f57b5701492cd46edcecc4f9208dc75529bcf76c514864e48da867d9"}, 27 | {file = "black-23.7.0-cp39-cp39-macosx_10_16_universal2.whl", hash = "sha256:47e56d83aad53ca140da0af87678fb38e44fd6bc0af71eebab2d1f59b1acf1d3"}, 28 | {file = "black-23.7.0-cp39-cp39-macosx_10_16_x86_64.whl", hash = "sha256:25cc308838fe71f7065df53aedd20327969d05671bac95b38fdf37ebe70ac087"}, 29 | {file = "black-23.7.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:642496b675095d423f9b8448243336f8ec71c9d4d57ec17bf795b67f08132a91"}, 30 | {file = "black-23.7.0-cp39-cp39-win_amd64.whl", hash = "sha256:ad0014efc7acf0bd745792bd0d8857413652979200ab924fbf239062adc12491"}, 31 | {file = "black-23.7.0-py3-none-any.whl", hash = "sha256:9fd59d418c60c0348505f2ddf9609c1e1de8e7493eab96198fc89d9f865e7a96"}, 32 | {file = "black-23.7.0.tar.gz", hash = "sha256:022a582720b0d9480ed82576c920a8c1dde97cc38ff11d8d8859b3bd6ca9eedb"}, 33 | ] 34 | 35 | [package.dependencies] 36 | click = ">=8.0.0" 37 | mypy-extensions = ">=0.4.3" 38 | packaging = ">=22.0" 39 | pathspec = ">=0.9.0" 40 | platformdirs = ">=2" 41 | tomli = {version = ">=1.1.0", markers = "python_version < \"3.11\""} 42 | typing-extensions = {version = ">=3.10.0.0", markers = "python_version < \"3.10\""} 43 | 44 | [package.extras] 45 | colorama = ["colorama (>=0.4.3)"] 46 | d = ["aiohttp (>=3.7.4)"] 47 | jupyter = ["ipython (>=7.8.0)", "tokenize-rt (>=3.2.0)"] 48 | uvloop = ["uvloop (>=0.15.2)"] 49 | 50 | [[package]] 51 | name = "click" 52 | version = "8.1.4" 53 | description = "Composable command line interface toolkit" 54 | category = "main" 55 | optional = false 56 | python-versions = ">=3.7" 57 | files = [ 58 | {file = "click-8.1.4-py3-none-any.whl", hash = "sha256:2739815aaa5d2c986a88f1e9230c55e17f0caad3d958a5e13ad0797c166db9e3"}, 59 | {file = "click-8.1.4.tar.gz", hash = "sha256:b97d0c74955da062a7d4ef92fadb583806a585b2ea81958a81bd72726cbb8e37"}, 60 | ] 61 | 62 | [package.dependencies] 63 | colorama = {version = "*", markers = "platform_system == \"Windows\""} 64 | 65 | [[package]] 66 | name = "colorama" 67 | version = "0.4.6" 68 | description = "Cross-platform colored terminal text." 69 | category = "main" 70 | optional = false 71 | python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,!=3.6.*,>=2.7" 72 | files = [ 73 | {file = "colorama-0.4.6-py2.py3-none-any.whl", hash = "sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6"}, 74 | {file = "colorama-0.4.6.tar.gz", hash = "sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44"}, 75 | ] 76 | 77 | [[package]] 78 | name = "exceptiongroup" 79 | version = "1.1.2" 80 | description = "Backport of PEP 654 (exception groups)" 81 | category = "dev" 82 | optional = false 83 | python-versions = ">=3.7" 84 | files = [ 85 | {file = "exceptiongroup-1.1.2-py3-none-any.whl", hash = "sha256:e346e69d186172ca7cf029c8c1d16235aa0e04035e5750b4b95039e65204328f"}, 86 | {file = "exceptiongroup-1.1.2.tar.gz", hash = "sha256:12c3e887d6485d16943a309616de20ae5582633e0a2eda17f4e10fd61c1e8af5"}, 87 | ] 88 | 89 | [package.extras] 90 | test = ["pytest (>=6)"] 91 | 92 | [[package]] 93 | name = "iniconfig" 94 | version = "2.0.0" 95 | description = "brain-dead simple config-ini parsing" 96 | category = "dev" 97 | optional = false 98 | python-versions = ">=3.7" 99 | files = [ 100 | {file = "iniconfig-2.0.0-py3-none-any.whl", hash = "sha256:b6a85871a79d2e3b22d2d1b94ac2824226a63c6b741c88f7ae975f18b6778374"}, 101 | {file = "iniconfig-2.0.0.tar.gz", hash = "sha256:2d91e135bf72d31a410b17c16da610a82cb55f6b0477d1a902134b24a455b8b3"}, 102 | ] 103 | 104 | [[package]] 105 | name = "jinja2" 106 | version = "3.1.2" 107 | description = "A very fast and expressive template engine." 108 | category = "main" 109 | optional = false 110 | python-versions = ">=3.7" 111 | files = [ 112 | {file = "Jinja2-3.1.2-py3-none-any.whl", hash = "sha256:6088930bfe239f0e6710546ab9c19c9ef35e29792895fed6e6e31a023a182a61"}, 113 | {file = "Jinja2-3.1.2.tar.gz", hash = "sha256:31351a702a408a9e7595a8fc6150fc3f43bb6bf7e319770cbc0db9df9437e852"}, 114 | ] 115 | 116 | [package.dependencies] 117 | MarkupSafe = ">=2.0" 118 | 119 | [package.extras] 120 | i18n = ["Babel (>=2.7)"] 121 | 122 | [[package]] 123 | name = "markdown-it-py" 124 | version = "3.0.0" 125 | description = "Python port of markdown-it. Markdown parsing, done right!" 126 | category = "main" 127 | optional = false 128 | python-versions = ">=3.8" 129 | files = [ 130 | {file = "markdown-it-py-3.0.0.tar.gz", hash = "sha256:e3f60a94fa066dc52ec76661e37c851cb232d92f9886b15cb560aaada2df8feb"}, 131 | {file = "markdown_it_py-3.0.0-py3-none-any.whl", hash = "sha256:355216845c60bd96232cd8d8c40e8f9765cc86f46880e43a8fd22dc1a1a8cab1"}, 132 | ] 133 | 134 | [package.dependencies] 135 | mdurl = ">=0.1,<1.0" 136 | 137 | [package.extras] 138 | benchmarking = ["psutil", "pytest", "pytest-benchmark"] 139 | code-style = ["pre-commit (>=3.0,<4.0)"] 140 | compare = ["commonmark (>=0.9,<1.0)", "markdown (>=3.4,<4.0)", "mistletoe (>=1.0,<2.0)", "mistune (>=2.0,<3.0)", "panflute (>=2.3,<3.0)"] 141 | linkify = ["linkify-it-py (>=1,<3)"] 142 | plugins = ["mdit-py-plugins"] 143 | profiling = ["gprof2dot"] 144 | rtd = ["jupyter_sphinx", "mdit-py-plugins", "myst-parser", "pyyaml", "sphinx", "sphinx-copybutton", "sphinx-design", "sphinx_book_theme"] 145 | testing = ["coverage", "pytest", "pytest-cov", "pytest-regressions"] 146 | 147 | [[package]] 148 | name = "markupsafe" 149 | version = "2.1.3" 150 | description = "Safely add untrusted strings to HTML/XML markup." 151 | category = "main" 152 | optional = false 153 | python-versions = ">=3.7" 154 | files = [ 155 | {file = "MarkupSafe-2.1.3-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:cd0f502fe016460680cd20aaa5a76d241d6f35a1c3350c474bac1273803893fa"}, 156 | {file = "MarkupSafe-2.1.3-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:e09031c87a1e51556fdcb46e5bd4f59dfb743061cf93c4d6831bf894f125eb57"}, 157 | {file = "MarkupSafe-2.1.3-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:68e78619a61ecf91e76aa3e6e8e33fc4894a2bebe93410754bd28fce0a8a4f9f"}, 158 | {file = "MarkupSafe-2.1.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:65c1a9bcdadc6c28eecee2c119465aebff8f7a584dd719facdd9e825ec61ab52"}, 159 | {file = "MarkupSafe-2.1.3-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:525808b8019e36eb524b8c68acdd63a37e75714eac50e988180b169d64480a00"}, 160 | {file = "MarkupSafe-2.1.3-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:962f82a3086483f5e5f64dbad880d31038b698494799b097bc59c2edf392fce6"}, 161 | {file = "MarkupSafe-2.1.3-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:aa7bd130efab1c280bed0f45501b7c8795f9fdbeb02e965371bbef3523627779"}, 162 | {file = "MarkupSafe-2.1.3-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:c9c804664ebe8f83a211cace637506669e7890fec1b4195b505c214e50dd4eb7"}, 163 | {file = "MarkupSafe-2.1.3-cp310-cp310-win32.whl", hash = "sha256:10bbfe99883db80bdbaff2dcf681dfc6533a614f700da1287707e8a5d78a8431"}, 164 | {file = "MarkupSafe-2.1.3-cp310-cp310-win_amd64.whl", hash = "sha256:1577735524cdad32f9f694208aa75e422adba74f1baee7551620e43a3141f559"}, 165 | {file = "MarkupSafe-2.1.3-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:ad9e82fb8f09ade1c3e1b996a6337afac2b8b9e365f926f5a61aacc71adc5b3c"}, 166 | {file = "MarkupSafe-2.1.3-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:3c0fae6c3be832a0a0473ac912810b2877c8cb9d76ca48de1ed31e1c68386575"}, 167 | {file = "MarkupSafe-2.1.3-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:b076b6226fb84157e3f7c971a47ff3a679d837cf338547532ab866c57930dbee"}, 168 | {file = "MarkupSafe-2.1.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:bfce63a9e7834b12b87c64d6b155fdd9b3b96191b6bd334bf37db7ff1fe457f2"}, 169 | {file = "MarkupSafe-2.1.3-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:338ae27d6b8745585f87218a3f23f1512dbf52c26c28e322dbe54bcede54ccb9"}, 170 | {file = "MarkupSafe-2.1.3-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:e4dd52d80b8c83fdce44e12478ad2e85c64ea965e75d66dbeafb0a3e77308fcc"}, 171 | {file = "MarkupSafe-2.1.3-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:df0be2b576a7abbf737b1575f048c23fb1d769f267ec4358296f31c2479db8f9"}, 172 | {file = "MarkupSafe-2.1.3-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:5bbe06f8eeafd38e5d0a4894ffec89378b6c6a625ff57e3028921f8ff59318ac"}, 173 | {file = "MarkupSafe-2.1.3-cp311-cp311-win32.whl", hash = "sha256:dd15ff04ffd7e05ffcb7fe79f1b98041b8ea30ae9234aed2a9168b5797c3effb"}, 174 | {file = "MarkupSafe-2.1.3-cp311-cp311-win_amd64.whl", hash = "sha256:134da1eca9ec0ae528110ccc9e48041e0828d79f24121a1a146161103c76e686"}, 175 | {file = "MarkupSafe-2.1.3-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:8e254ae696c88d98da6555f5ace2279cf7cd5b3f52be2b5cf97feafe883b58d2"}, 176 | {file = "MarkupSafe-2.1.3-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:cb0932dc158471523c9637e807d9bfb93e06a95cbf010f1a38b98623b929ef2b"}, 177 | {file = "MarkupSafe-2.1.3-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9402b03f1a1b4dc4c19845e5c749e3ab82d5078d16a2a4c2cd2df62d57bb0707"}, 178 | {file = "MarkupSafe-2.1.3-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:ca379055a47383d02a5400cb0d110cef0a776fc644cda797db0c5696cfd7e18e"}, 179 | {file = "MarkupSafe-2.1.3-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:b7ff0f54cb4ff66dd38bebd335a38e2c22c41a8ee45aa608efc890ac3e3931bc"}, 180 | {file = "MarkupSafe-2.1.3-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:c011a4149cfbcf9f03994ec2edffcb8b1dc2d2aede7ca243746df97a5d41ce48"}, 181 | {file = "MarkupSafe-2.1.3-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:56d9f2ecac662ca1611d183feb03a3fa4406469dafe241673d521dd5ae92a155"}, 182 | {file = "MarkupSafe-2.1.3-cp37-cp37m-win32.whl", hash = "sha256:8758846a7e80910096950b67071243da3e5a20ed2546e6392603c096778d48e0"}, 183 | {file = "MarkupSafe-2.1.3-cp37-cp37m-win_amd64.whl", hash = "sha256:787003c0ddb00500e49a10f2844fac87aa6ce977b90b0feaaf9de23c22508b24"}, 184 | {file = "MarkupSafe-2.1.3-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:2ef12179d3a291be237280175b542c07a36e7f60718296278d8593d21ca937d4"}, 185 | {file = "MarkupSafe-2.1.3-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:2c1b19b3aaacc6e57b7e25710ff571c24d6c3613a45e905b1fde04d691b98ee0"}, 186 | {file = "MarkupSafe-2.1.3-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8afafd99945ead6e075b973fefa56379c5b5c53fd8937dad92c662da5d8fd5ee"}, 187 | {file = "MarkupSafe-2.1.3-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8c41976a29d078bb235fea9b2ecd3da465df42a562910f9022f1a03107bd02be"}, 188 | {file = "MarkupSafe-2.1.3-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:d080e0a5eb2529460b30190fcfcc4199bd7f827663f858a226a81bc27beaa97e"}, 189 | {file = "MarkupSafe-2.1.3-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:69c0f17e9f5a7afdf2cc9fb2d1ce6aabdb3bafb7f38017c0b77862bcec2bbad8"}, 190 | {file = "MarkupSafe-2.1.3-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:504b320cd4b7eff6f968eddf81127112db685e81f7e36e75f9f84f0df46041c3"}, 191 | {file = "MarkupSafe-2.1.3-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:42de32b22b6b804f42c5d98be4f7e5e977ecdd9ee9b660fda1a3edf03b11792d"}, 192 | {file = "MarkupSafe-2.1.3-cp38-cp38-win32.whl", hash = "sha256:ceb01949af7121f9fc39f7d27f91be8546f3fb112c608bc4029aef0bab86a2a5"}, 193 | {file = "MarkupSafe-2.1.3-cp38-cp38-win_amd64.whl", hash = "sha256:1b40069d487e7edb2676d3fbdb2b0829ffa2cd63a2ec26c4938b2d34391b4ecc"}, 194 | {file = "MarkupSafe-2.1.3-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:8023faf4e01efadfa183e863fefde0046de576c6f14659e8782065bcece22198"}, 195 | {file = "MarkupSafe-2.1.3-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:6b2b56950d93e41f33b4223ead100ea0fe11f8e6ee5f641eb753ce4b77a7042b"}, 196 | {file = "MarkupSafe-2.1.3-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:9dcdfd0eaf283af041973bff14a2e143b8bd64e069f4c383416ecd79a81aab58"}, 197 | {file = "MarkupSafe-2.1.3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:05fb21170423db021895e1ea1e1f3ab3adb85d1c2333cbc2310f2a26bc77272e"}, 198 | {file = "MarkupSafe-2.1.3-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:282c2cb35b5b673bbcadb33a585408104df04f14b2d9b01d4c345a3b92861c2c"}, 199 | {file = "MarkupSafe-2.1.3-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:ab4a0df41e7c16a1392727727e7998a467472d0ad65f3ad5e6e765015df08636"}, 200 | {file = "MarkupSafe-2.1.3-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:7ef3cb2ebbf91e330e3bb937efada0edd9003683db6b57bb108c4001f37a02ea"}, 201 | {file = "MarkupSafe-2.1.3-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:0a4e4a1aff6c7ac4cd55792abf96c915634c2b97e3cc1c7129578aa68ebd754e"}, 202 | {file = "MarkupSafe-2.1.3-cp39-cp39-win32.whl", hash = "sha256:fec21693218efe39aa7f8599346e90c705afa52c5b31ae019b2e57e8f6542bb2"}, 203 | {file = "MarkupSafe-2.1.3-cp39-cp39-win_amd64.whl", hash = "sha256:3fd4abcb888d15a94f32b75d8fd18ee162ca0c064f35b11134be77050296d6ba"}, 204 | {file = "MarkupSafe-2.1.3.tar.gz", hash = "sha256:af598ed32d6ae86f1b747b82783958b1a4ab8f617b06fe68795c7f026abbdcad"}, 205 | ] 206 | 207 | [[package]] 208 | name = "mdurl" 209 | version = "0.1.2" 210 | description = "Markdown URL utilities" 211 | category = "main" 212 | optional = false 213 | python-versions = ">=3.7" 214 | files = [ 215 | {file = "mdurl-0.1.2-py3-none-any.whl", hash = "sha256:84008a41e51615a49fc9966191ff91509e3c40b939176e643fd50a5c2196b8f8"}, 216 | {file = "mdurl-0.1.2.tar.gz", hash = "sha256:bb413d29f5eea38f31dd4754dd7377d4465116fb207585f97bf925588687c1ba"}, 217 | ] 218 | 219 | [[package]] 220 | name = "mypy-extensions" 221 | version = "1.0.0" 222 | description = "Type system extensions for programs checked with the mypy type checker." 223 | category = "dev" 224 | optional = false 225 | python-versions = ">=3.5" 226 | files = [ 227 | {file = "mypy_extensions-1.0.0-py3-none-any.whl", hash = "sha256:4392f6c0eb8a5668a69e23d168ffa70f0be9ccfd32b5cc2d26a34ae5b844552d"}, 228 | {file = "mypy_extensions-1.0.0.tar.gz", hash = "sha256:75dbf8955dc00442a438fc4d0666508a9a97b6bd41aa2f0ffe9d2f2725af0782"}, 229 | ] 230 | 231 | [[package]] 232 | name = "packaging" 233 | version = "23.1" 234 | description = "Core utilities for Python packages" 235 | category = "dev" 236 | optional = false 237 | python-versions = ">=3.7" 238 | files = [ 239 | {file = "packaging-23.1-py3-none-any.whl", hash = "sha256:994793af429502c4ea2ebf6bf664629d07c1a9fe974af92966e4b8d2df7edc61"}, 240 | {file = "packaging-23.1.tar.gz", hash = "sha256:a392980d2b6cffa644431898be54b0045151319d1e7ec34f0cfed48767dd334f"}, 241 | ] 242 | 243 | [[package]] 244 | name = "pathspec" 245 | version = "0.11.1" 246 | description = "Utility library for gitignore style pattern matching of file paths." 247 | category = "dev" 248 | optional = false 249 | python-versions = ">=3.7" 250 | files = [ 251 | {file = "pathspec-0.11.1-py3-none-any.whl", hash = "sha256:d8af70af76652554bd134c22b3e8a1cc46ed7d91edcdd721ef1a0c51a84a5293"}, 252 | {file = "pathspec-0.11.1.tar.gz", hash = "sha256:2798de800fa92780e33acca925945e9a19a133b715067cf165b8866c15a31687"}, 253 | ] 254 | 255 | [[package]] 256 | name = "pip" 257 | version = "23.1.2" 258 | description = "The PyPA recommended tool for installing Python packages." 259 | category = "main" 260 | optional = false 261 | python-versions = ">=3.7" 262 | files = [ 263 | {file = "pip-23.1.2-py3-none-any.whl", hash = "sha256:3ef6ac33239e4027d9a5598a381b9d30880a1477e50039db2eac6e8a8f6d1b18"}, 264 | {file = "pip-23.1.2.tar.gz", hash = "sha256:0e7c86f486935893c708287b30bd050a36ac827ec7fe5e43fe7cb198dd835fba"}, 265 | ] 266 | 267 | [[package]] 268 | name = "platformdirs" 269 | version = "3.8.1" 270 | description = "A small Python package for determining appropriate platform-specific dirs, e.g. a \"user data dir\"." 271 | category = "dev" 272 | optional = false 273 | python-versions = ">=3.7" 274 | files = [ 275 | {file = "platformdirs-3.8.1-py3-none-any.whl", hash = "sha256:cec7b889196b9144d088e4c57d9ceef7374f6c39694ad1577a0aab50d27ea28c"}, 276 | {file = "platformdirs-3.8.1.tar.gz", hash = "sha256:f87ca4fcff7d2b0f81c6a748a77973d7af0f4d526f98f308477c3c436c74d528"}, 277 | ] 278 | 279 | [package.extras] 280 | docs = ["furo (>=2023.5.20)", "proselint (>=0.13)", "sphinx (>=7.0.1)", "sphinx-autodoc-typehints (>=1.23,!=1.23.4)"] 281 | test = ["appdirs (==1.4.4)", "covdefaults (>=2.3)", "pytest (>=7.3.1)", "pytest-cov (>=4.1)", "pytest-mock (>=3.10)"] 282 | 283 | [[package]] 284 | name = "pluggy" 285 | version = "1.2.0" 286 | description = "plugin and hook calling mechanisms for python" 287 | category = "dev" 288 | optional = false 289 | python-versions = ">=3.7" 290 | files = [ 291 | {file = "pluggy-1.2.0-py3-none-any.whl", hash = "sha256:c2fd55a7d7a3863cba1a013e4e2414658b1d07b6bc57b3919e0c63c9abb99849"}, 292 | {file = "pluggy-1.2.0.tar.gz", hash = "sha256:d12f0c4b579b15f5e054301bb226ee85eeeba08ffec228092f8defbaa3a4c4b3"}, 293 | ] 294 | 295 | [package.extras] 296 | dev = ["pre-commit", "tox"] 297 | testing = ["pytest", "pytest-benchmark"] 298 | 299 | [[package]] 300 | name = "pygments" 301 | version = "2.15.1" 302 | description = "Pygments is a syntax highlighting package written in Python." 303 | category = "main" 304 | optional = false 305 | python-versions = ">=3.7" 306 | files = [ 307 | {file = "Pygments-2.15.1-py3-none-any.whl", hash = "sha256:db2db3deb4b4179f399a09054b023b6a586b76499d36965813c71aa8ed7b5fd1"}, 308 | {file = "Pygments-2.15.1.tar.gz", hash = "sha256:8ace4d3c1dd481894b2005f560ead0f9f19ee64fe983366be1a21e171d12775c"}, 309 | ] 310 | 311 | [package.extras] 312 | plugins = ["importlib-metadata"] 313 | 314 | [[package]] 315 | name = "pytest" 316 | version = "7.4.0" 317 | description = "pytest: simple powerful testing with Python" 318 | category = "dev" 319 | optional = false 320 | python-versions = ">=3.7" 321 | files = [ 322 | {file = "pytest-7.4.0-py3-none-any.whl", hash = "sha256:78bf16451a2eb8c7a2ea98e32dc119fd2aa758f1d5d66dbf0a59d69a3969df32"}, 323 | {file = "pytest-7.4.0.tar.gz", hash = "sha256:b4bf8c45bd59934ed84001ad51e11b4ee40d40a1229d2c79f9c592b0a3f6bd8a"}, 324 | ] 325 | 326 | [package.dependencies] 327 | colorama = {version = "*", markers = "sys_platform == \"win32\""} 328 | exceptiongroup = {version = ">=1.0.0rc8", markers = "python_version < \"3.11\""} 329 | iniconfig = "*" 330 | packaging = "*" 331 | pluggy = ">=0.12,<2.0" 332 | tomli = {version = ">=1.0.0", markers = "python_version < \"3.11\""} 333 | 334 | [package.extras] 335 | testing = ["argcomplete", "attrs (>=19.2.0)", "hypothesis (>=3.56)", "mock", "nose", "pygments (>=2.7.2)", "requests", "setuptools", "xmlschema"] 336 | 337 | [[package]] 338 | name = "pyxdg" 339 | version = "0.28" 340 | description = "PyXDG contains implementations of freedesktop.org standards in python." 341 | category = "main" 342 | optional = false 343 | python-versions = "*" 344 | files = [ 345 | {file = "pyxdg-0.28-py2.py3-none-any.whl", hash = "sha256:bdaf595999a0178ecea4052b7f4195569c1ff4d344567bccdc12dfdf02d545ab"}, 346 | {file = "pyxdg-0.28.tar.gz", hash = "sha256:3267bb3074e934df202af2ee0868575484108581e6f3cb006af1da35395e88b4"}, 347 | ] 348 | 349 | [[package]] 350 | name = "rich" 351 | version = "13.4.2" 352 | description = "Render rich text, tables, progress bars, syntax highlighting, markdown and more to the terminal" 353 | category = "main" 354 | optional = false 355 | python-versions = ">=3.7.0" 356 | files = [ 357 | {file = "rich-13.4.2-py3-none-any.whl", hash = "sha256:8f87bc7ee54675732fa66a05ebfe489e27264caeeff3728c945d25971b6485ec"}, 358 | {file = "rich-13.4.2.tar.gz", hash = "sha256:d653d6bccede5844304c605d5aac802c7cf9621efd700b46c7ec2b51ea914898"}, 359 | ] 360 | 361 | [package.dependencies] 362 | markdown-it-py = ">=2.2.0" 363 | pygments = ">=2.13.0,<3.0.0" 364 | typing-extensions = {version = ">=4.0.0,<5.0", markers = "python_version < \"3.9\""} 365 | 366 | [package.extras] 367 | jupyter = ["ipywidgets (>=7.5.1,<9)"] 368 | 369 | [[package]] 370 | name = "ruamel-yaml" 371 | version = "0.17.32" 372 | description = "ruamel.yaml is a YAML parser/emitter that supports roundtrip preservation of comments, seq/map flow style, and map key order" 373 | category = "main" 374 | optional = false 375 | python-versions = ">=3" 376 | files = [ 377 | {file = "ruamel.yaml-0.17.32-py3-none-any.whl", hash = "sha256:23cd2ed620231677564646b0c6a89d138b6822a0d78656df7abda5879ec4f447"}, 378 | {file = "ruamel.yaml-0.17.32.tar.gz", hash = "sha256:ec939063761914e14542972a5cba6d33c23b0859ab6342f61cf070cfc600efc2"}, 379 | ] 380 | 381 | [package.dependencies] 382 | "ruamel.yaml.clib" = {version = ">=0.2.7", markers = "platform_python_implementation == \"CPython\" and python_version < \"3.12\""} 383 | 384 | [package.extras] 385 | docs = ["ryd"] 386 | jinja2 = ["ruamel.yaml.jinja2 (>=0.2)"] 387 | 388 | [[package]] 389 | name = "ruamel-yaml-clib" 390 | version = "0.2.7" 391 | description = "C version of reader, parser and emitter for ruamel.yaml derived from libyaml" 392 | category = "main" 393 | optional = false 394 | python-versions = ">=3.5" 395 | files = [ 396 | {file = "ruamel.yaml.clib-0.2.7-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:d5859983f26d8cd7bb5c287ef452e8aacc86501487634573d260968f753e1d71"}, 397 | {file = "ruamel.yaml.clib-0.2.7-cp310-cp310-macosx_12_0_arm64.whl", hash = "sha256:debc87a9516b237d0466a711b18b6ebeb17ba9f391eb7f91c649c5c4ec5006c7"}, 398 | {file = "ruamel.yaml.clib-0.2.7-cp310-cp310-manylinux2014_aarch64.whl", hash = "sha256:df5828871e6648db72d1c19b4bd24819b80a755c4541d3409f0f7acd0f335c80"}, 399 | {file = "ruamel.yaml.clib-0.2.7-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl", hash = "sha256:efa08d63ef03d079dcae1dfe334f6c8847ba8b645d08df286358b1f5293d24ab"}, 400 | {file = "ruamel.yaml.clib-0.2.7-cp310-cp310-win32.whl", hash = "sha256:763d65baa3b952479c4e972669f679fe490eee058d5aa85da483ebae2009d231"}, 401 | {file = "ruamel.yaml.clib-0.2.7-cp310-cp310-win_amd64.whl", hash = "sha256:d000f258cf42fec2b1bbf2863c61d7b8918d31ffee905da62dede869254d3b8a"}, 402 | {file = "ruamel.yaml.clib-0.2.7-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:045e0626baf1c52e5527bd5db361bc83180faaba2ff586e763d3d5982a876a9e"}, 403 | {file = "ruamel.yaml.clib-0.2.7-cp311-cp311-macosx_12_6_arm64.whl", hash = "sha256:721bc4ba4525f53f6a611ec0967bdcee61b31df5a56801281027a3a6d1c2daf5"}, 404 | {file = "ruamel.yaml.clib-0.2.7-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl", hash = "sha256:41d0f1fa4c6830176eef5b276af04c89320ea616655d01327d5ce65e50575c94"}, 405 | {file = "ruamel.yaml.clib-0.2.7-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:4b3a93bb9bc662fc1f99c5c3ea8e623d8b23ad22f861eb6fce9377ac07ad6072"}, 406 | {file = "ruamel.yaml.clib-0.2.7-cp36-cp36m-macosx_12_0_arm64.whl", hash = "sha256:a234a20ae07e8469da311e182e70ef6b199d0fbeb6c6cc2901204dd87fb867e8"}, 407 | {file = "ruamel.yaml.clib-0.2.7-cp36-cp36m-manylinux2014_aarch64.whl", hash = "sha256:15910ef4f3e537eea7fe45f8a5d19997479940d9196f357152a09031c5be59f3"}, 408 | {file = "ruamel.yaml.clib-0.2.7-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl", hash = "sha256:370445fd795706fd291ab00c9df38a0caed0f17a6fb46b0f607668ecb16ce763"}, 409 | {file = "ruamel.yaml.clib-0.2.7-cp36-cp36m-win32.whl", hash = "sha256:ecdf1a604009bd35c674b9225a8fa609e0282d9b896c03dd441a91e5f53b534e"}, 410 | {file = "ruamel.yaml.clib-0.2.7-cp36-cp36m-win_amd64.whl", hash = "sha256:f34019dced51047d6f70cb9383b2ae2853b7fc4dce65129a5acd49f4f9256646"}, 411 | {file = "ruamel.yaml.clib-0.2.7-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:2aa261c29a5545adfef9296b7e33941f46aa5bbd21164228e833412af4c9c75f"}, 412 | {file = "ruamel.yaml.clib-0.2.7-cp37-cp37m-macosx_12_0_arm64.whl", hash = "sha256:f01da5790e95815eb5a8a138508c01c758e5f5bc0ce4286c4f7028b8dd7ac3d0"}, 413 | {file = "ruamel.yaml.clib-0.2.7-cp37-cp37m-manylinux2014_aarch64.whl", hash = "sha256:40d030e2329ce5286d6b231b8726959ebbe0404c92f0a578c0e2482182e38282"}, 414 | {file = "ruamel.yaml.clib-0.2.7-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl", hash = "sha256:c3ca1fbba4ae962521e5eb66d72998b51f0f4d0f608d3c0347a48e1af262efa7"}, 415 | {file = "ruamel.yaml.clib-0.2.7-cp37-cp37m-win32.whl", hash = "sha256:7bdb4c06b063f6fd55e472e201317a3bb6cdeeee5d5a38512ea5c01e1acbdd93"}, 416 | {file = "ruamel.yaml.clib-0.2.7-cp37-cp37m-win_amd64.whl", hash = "sha256:be2a7ad8fd8f7442b24323d24ba0b56c51219513cfa45b9ada3b87b76c374d4b"}, 417 | {file = "ruamel.yaml.clib-0.2.7-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:91a789b4aa0097b78c93e3dc4b40040ba55bef518f84a40d4442f713b4094acb"}, 418 | {file = "ruamel.yaml.clib-0.2.7-cp38-cp38-macosx_12_0_arm64.whl", hash = "sha256:99e77daab5d13a48a4054803d052ff40780278240a902b880dd37a51ba01a307"}, 419 | {file = "ruamel.yaml.clib-0.2.7-cp38-cp38-manylinux2014_aarch64.whl", hash = "sha256:3243f48ecd450eddadc2d11b5feb08aca941b5cd98c9b1db14b2fd128be8c697"}, 420 | {file = "ruamel.yaml.clib-0.2.7-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl", hash = "sha256:8831a2cedcd0f0927f788c5bdf6567d9dc9cc235646a434986a852af1cb54b4b"}, 421 | {file = "ruamel.yaml.clib-0.2.7-cp38-cp38-win32.whl", hash = "sha256:3110a99e0f94a4a3470ff67fc20d3f96c25b13d24c6980ff841e82bafe827cac"}, 422 | {file = "ruamel.yaml.clib-0.2.7-cp38-cp38-win_amd64.whl", hash = "sha256:92460ce908546ab69770b2e576e4f99fbb4ce6ab4b245345a3869a0a0410488f"}, 423 | {file = "ruamel.yaml.clib-0.2.7-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:5bc0667c1eb8f83a3752b71b9c4ba55ef7c7058ae57022dd9b29065186a113d9"}, 424 | {file = "ruamel.yaml.clib-0.2.7-cp39-cp39-macosx_12_0_arm64.whl", hash = "sha256:4a4d8d417868d68b979076a9be6a38c676eca060785abaa6709c7b31593c35d1"}, 425 | {file = "ruamel.yaml.clib-0.2.7-cp39-cp39-manylinux2014_aarch64.whl", hash = "sha256:bf9a6bc4a0221538b1a7de3ed7bca4c93c02346853f44e1cd764be0023cd3640"}, 426 | {file = "ruamel.yaml.clib-0.2.7-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl", hash = "sha256:a7b301ff08055d73223058b5c46c55638917f04d21577c95e00e0c4d79201a6b"}, 427 | {file = "ruamel.yaml.clib-0.2.7-cp39-cp39-win32.whl", hash = "sha256:d5e51e2901ec2366b79f16c2299a03e74ba4531ddcfacc1416639c557aef0ad8"}, 428 | {file = "ruamel.yaml.clib-0.2.7-cp39-cp39-win_amd64.whl", hash = "sha256:184faeaec61dbaa3cace407cffc5819f7b977e75360e8d5ca19461cd851a5fc5"}, 429 | {file = "ruamel.yaml.clib-0.2.7.tar.gz", hash = "sha256:1f08fd5a2bea9c4180db71678e850b995d2a5f4537be0e94557668cf0f5f9497"}, 430 | ] 431 | 432 | [[package]] 433 | name = "shellingham" 434 | version = "1.5.0.post1" 435 | description = "Tool to Detect Surrounding Shell" 436 | category = "main" 437 | optional = false 438 | python-versions = ">=3.7" 439 | files = [ 440 | {file = "shellingham-1.5.0.post1-py2.py3-none-any.whl", hash = "sha256:368bf8c00754fd4f55afb7bbb86e272df77e4dc76ac29dbcbb81a59e9fc15744"}, 441 | {file = "shellingham-1.5.0.post1.tar.gz", hash = "sha256:823bc5fb5c34d60f285b624e7264f4dda254bc803a3774a147bf99c0e3004a28"}, 442 | ] 443 | 444 | [[package]] 445 | name = "tomli" 446 | version = "2.0.1" 447 | description = "A lil' TOML parser" 448 | category = "dev" 449 | optional = false 450 | python-versions = ">=3.7" 451 | files = [ 452 | {file = "tomli-2.0.1-py3-none-any.whl", hash = "sha256:939de3e7a6161af0c887ef91b7d41a53e7c5a1ca976325f429cb46ea9bc30ecc"}, 453 | {file = "tomli-2.0.1.tar.gz", hash = "sha256:de526c12914f0c550d15924c62d72abc48d6fe7364aa87328337a31007fe8a4f"}, 454 | ] 455 | 456 | [[package]] 457 | name = "typer" 458 | version = "0.9.0" 459 | description = "Typer, build great CLIs. Easy to code. Based on Python type hints." 460 | category = "main" 461 | optional = false 462 | python-versions = ">=3.6" 463 | files = [ 464 | {file = "typer-0.9.0-py3-none-any.whl", hash = "sha256:5d96d986a21493606a358cae4461bd8cdf83cbf33a5aa950ae629ca3b51467ee"}, 465 | {file = "typer-0.9.0.tar.gz", hash = "sha256:50922fd79aea2f4751a8e0408ff10d2662bd0c8bbfa84755a699f3bada2978b2"}, 466 | ] 467 | 468 | [package.dependencies] 469 | click = ">=7.1.1,<9.0.0" 470 | colorama = {version = ">=0.4.3,<0.5.0", optional = true, markers = "extra == \"all\""} 471 | rich = {version = ">=10.11.0,<14.0.0", optional = true, markers = "extra == \"all\""} 472 | shellingham = {version = ">=1.3.0,<2.0.0", optional = true, markers = "extra == \"all\""} 473 | typing-extensions = ">=3.7.4.3" 474 | 475 | [package.extras] 476 | all = ["colorama (>=0.4.3,<0.5.0)", "rich (>=10.11.0,<14.0.0)", "shellingham (>=1.3.0,<2.0.0)"] 477 | dev = ["autoflake (>=1.3.1,<2.0.0)", "flake8 (>=3.8.3,<4.0.0)", "pre-commit (>=2.17.0,<3.0.0)"] 478 | doc = ["cairosvg (>=2.5.2,<3.0.0)", "mdx-include (>=1.4.1,<2.0.0)", "mkdocs (>=1.1.2,<2.0.0)", "mkdocs-material (>=8.1.4,<9.0.0)", "pillow (>=9.3.0,<10.0.0)"] 479 | test = ["black (>=22.3.0,<23.0.0)", "coverage (>=6.2,<7.0)", "isort (>=5.0.6,<6.0.0)", "mypy (==0.910)", "pytest (>=4.4.0,<8.0.0)", "pytest-cov (>=2.10.0,<5.0.0)", "pytest-sugar (>=0.9.4,<0.10.0)", "pytest-xdist (>=1.32.0,<4.0.0)", "rich (>=10.11.0,<14.0.0)", "shellingham (>=1.3.0,<2.0.0)"] 480 | 481 | [[package]] 482 | name = "typing-extensions" 483 | version = "4.7.1" 484 | description = "Backported and Experimental Type Hints for Python 3.7+" 485 | category = "main" 486 | optional = false 487 | python-versions = ">=3.7" 488 | files = [ 489 | {file = "typing_extensions-4.7.1-py3-none-any.whl", hash = "sha256:440d5dd3af93b060174bf433bccd69b0babc3b15b1a8dca43789fd7f61514b36"}, 490 | {file = "typing_extensions-4.7.1.tar.gz", hash = "sha256:b75ddc264f0ba5615db7ba217daeb99701ad295353c45f9e95963337ceeeffb2"}, 491 | ] 492 | 493 | [[package]] 494 | name = "urllib3" 495 | version = "1.26.16" 496 | description = "HTTP library with thread-safe connection pooling, file post, and more." 497 | category = "main" 498 | optional = false 499 | python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, !=3.5.*" 500 | files = [ 501 | {file = "urllib3-1.26.16-py2.py3-none-any.whl", hash = "sha256:8d36afa7616d8ab714608411b4a3b13e58f463aee519024578e062e141dce20f"}, 502 | {file = "urllib3-1.26.16.tar.gz", hash = "sha256:8f135f6502756bde6b2a9b28989df5fbe87c9970cecaa69041edcce7f0589b14"}, 503 | ] 504 | 505 | [package.extras] 506 | brotli = ["brotli (>=1.0.9)", "brotlicffi (>=0.8.0)", "brotlipy (>=0.6.0)"] 507 | secure = ["certifi", "cryptography (>=1.3.4)", "idna (>=2.0.0)", "ipaddress", "pyOpenSSL (>=0.14)", "urllib3-secure-extra"] 508 | socks = ["PySocks (>=1.5.6,!=1.5.7,<2.0)"] 509 | 510 | [metadata] 511 | lock-version = "2.0" 512 | python-versions = "^3.8.10" 513 | content-hash = "6d3a84d8f5e8d9f30b01fbf3ce394834dafbc1de271654b7b1c3527b5279bc19" 514 | -------------------------------------------------------------------------------- /poetry.toml: -------------------------------------------------------------------------------- 1 | [virtualenvs] 2 | in-project = true 3 | -------------------------------------------------------------------------------- /pyproject.toml: -------------------------------------------------------------------------------- 1 | [tool.poetry] 2 | name = "bupy" 3 | version = "0.1.2" 4 | description = "A Python toolkit for Butane and Ignition" 5 | authors = ["QuickVM "] 6 | readme = "README.md" 7 | 8 | [tool.poetry.scripts] 9 | bupy = "bupy.cli:app" 10 | 11 | [tool.poetry.dependencies] 12 | python = "^3.8.10" 13 | typer = {extras = ["all"], version = "^0.9.0"} 14 | pyxdg = "^0.28" 15 | urllib3 = "^1.26.10" 16 | Jinja2 = "^3.1.2" 17 | "ruamel.yaml" = "^0.17.21" 18 | rich = "^13.4.2" 19 | pip = "^23.0.1" 20 | 21 | [tool.poetry.group.dev.dependencies] 22 | black = "^23.7.0" 23 | pytest = "^7.4.0" 24 | 25 | [build-system] 26 | requires = ["poetry-core>=1.0.0"] 27 | build-backend = "poetry.core.masonry.api" 28 | 29 | [tool.black] 30 | line-length = 102 31 | target-version = ['py38',] 32 | include = '\.py?$' 33 | exclude = ''' 34 | /( 35 | \.git 36 | | \.eggs 37 | | \.vscode 38 | | makefiles 39 | | build 40 | | dist 41 | | venv 42 | | pycache 43 | )/ 44 | ''' 45 | -------------------------------------------------------------------------------- /pyrightconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "venvPath": ".", 3 | "venv": ".venv" 4 | } 5 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | black==23.7.0 2 | click==8.1.4 3 | colorama==0.4.6 4 | iniconfig==2.0.0 5 | Jinja2==3.1.2 6 | markdown-it-py==3.0.0 7 | MarkupSafe==2.1.3 8 | mdurl==0.1.2 9 | mypy-extensions==1.0.0 10 | packaging==23.1 11 | pathspec==0.11.1 12 | platformdirs==3.8.1 13 | pluggy==1.2.0 14 | Pygments==2.15.1 15 | pyparsing==3.0.9 16 | pytest==7.4.0 17 | pyxdg==0.28 18 | rich==13.4.2 19 | ruamel.yaml==0.17.32 20 | ruamel.yaml.clib==0.2.7 21 | shellingham==1.5.0.post1 22 | typer==0.9.0 23 | typing_extensions==4.7.1 24 | urllib3==1.26.16 25 | -------------------------------------------------------------------------------- /setup.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | from setuptools import setup 3 | 4 | packages = ["bupy"] 5 | 6 | package_data = {"": ["*"]} 7 | 8 | with open("requirements.txt") as f: 9 | required = f.read().splitlines() 10 | 11 | install_requires = required 12 | 13 | entry_points = {"console_scripts": ["bupy = bupy.cli:app"]} 14 | 15 | setup_kwargs = { 16 | "name": "bupy", 17 | "version": "0.1.2", 18 | "description": "A Python toolkit for Butane and Ignition", 19 | "author": "QuickVM", 20 | "author_email": "hello@quickvm.com", 21 | "maintainer": "QuickVM", 22 | "maintainer_email": "hello@quickvm.com", 23 | "url": "https://github.com/quickvm/bupy", 24 | "packages": packages, 25 | "package_data": package_data, 26 | "install_requires": install_requires, 27 | "entry_points": entry_points, 28 | "python_requires": ">=3.8.10,<4.0.0", 29 | } 30 | 31 | 32 | setup(**setup_kwargs) 33 | -------------------------------------------------------------------------------- /tests/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/quickvm/bupy/a7d1b12c499ee410fcc3c03be22a27009cfb9793/tests/__init__.py -------------------------------------------------------------------------------- /tests/data/bad.bu.j2: -------------------------------------------------------------------------------- 1 | variant: fcos 2 | version: 1.4.0 3 | 4 | passwd: 5 | users: 6 | {%- for item in passwd.users %} 7 | {%- if item.key %} 8 | - name: {{ item.name }} 9 | groups: 10 | {%- if item.groups %} 11 | {%- for item in item.groups %} 12 | - {{ item.group }} 13 | {%- endfor %} 14 | {%- endif %} 15 | ssh_authorized_keys: 16 | {%- if item.ssh_key %} 17 | {%- for item in item.ssh_key %} 18 | - {{ item.ssh_key }} 19 | {%- endfor %} 20 | {%- endif %} 21 | {%- endif %} 22 | {%- endfor %} 23 | 24 | storage: 25 | files: 26 | - path: /etc/hostname 27 | mode: 0644 28 | overwrite: true 29 | contents: 30 | inline: {{ hostname }}.{{ }} 31 | 32 | - path: /etc/systemd/zram-generator.conf 33 | mode: 0644 34 | contents: 35 | inline: | 36 | # This config file enables a /dev/zram0 device with the default settings 37 | [zram0] 38 | 39 | - path: /etc/sysctl.d/20-silence-audit.conf 40 | contents: 41 | inline: | 42 | kernel.printk=4 43 | -------------------------------------------------------------------------------- /tests/data/bad.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | passwd: 3 | users: 4 | - name: core 5 | sshkey: 6 | - ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEmTTqLpDYDfxKgCEVcbCNZxaI25rjbHlnhdCfKajHS1 bupy@quickvm.com 7 | - ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEmTTqLpDYDfxKgCEVcbCNZxaI25rjbHlnhdCfKajHS1 bupy@quickvm.com 8 | - name: bluey 9 | groups: 10 | - sudo 11 | - wheel 12 | - gooddogs 13 | sshkey: 14 | - ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEmTTqLpDYDfxKgCEVcbCNZxaI25rjbHlnhdCfKajHS1 bupy@quickvm.com 15 | - name: bingo 16 | groups: 17 | - gooddogs 18 | sshkey: 19 | - ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEmTTqLpDYDfxKgCEVcbCNZxaI25rjbHlnhdCfKajHS1 bupy@quickvm.com 20 | - name: bandit 21 | group: 22 | - gooddogs 23 | - name: chili 24 | groups: 25 | - name: gooddogs 26 | hostname: testing 27 | domain_name: quickvm.com 28 | domain_name: foo 29 | -------------------------------------------------------------------------------- /tests/test_bupy.py: -------------------------------------------------------------------------------- 1 | from bupy import __version__ 2 | 3 | 4 | def test_version(): 5 | assert __version__ == "0.1.2" 6 | --------------------------------------------------------------------------------