From 00a57bc786a85c10b448e3b533d8bf2e1b83d44f Mon Sep 17 00:00:00 2001 From: "Waylon S. Walker" Date: Tue, 3 Jan 2023 20:33:45 -0600 Subject: [PATCH] refactor to hatch --- .github/workflows/release.yml | 2 +- LICENSE.txt | 9 ++ README.md | 21 +++ creeper_adventure/__about__.py | 4 + creeper_adventure/__init__.py | 3 + creeper_adventure/__main__.py | 9 ++ .../assets}/bee/idle/1.png | Bin .../assets}/chest.png | Bin .../assets}/crafting-table.png | Bin .../assets}/creeper/idle/1.png | Bin .../assets}/creeper/idle/2.png | Bin .../assets}/creeper/idle/3.png | Bin .../assets}/creeper/idle/4.png | Bin .../assets}/creeper/idle/5.png | Bin .../assets}/grass.png | Bin {assets => creeper_adventure/assets}/leaf.png | Bin {assets => creeper_adventure/assets}/log.png | Bin .../assets}/oak_trees/1.png | Bin .../assets}/oak_trees/2.png | Bin .../assets}/oak_trees/4.png | Bin .../assets}/oak_trees/5.png | Bin .../assets}/sounds/axe.mp3 | Bin .../assets}/sounds/short-axe.mp3 | Bin .../assets}/sounds/walking.mp3 | Bin .../assets}/spotlight.png | Bin .../assets}/stev/idle/0.png | Bin .../assets}/stev/idle/1.png | Bin creeper_adventure/cli/__init__.py | 19 +++ creeper.py => creeper_adventure/creeper.py | 40 +++-- game.py => creeper_adventure/game.py | 2 + creeper_adventure/joytest.py | 149 ++++++++++++++++++ pyproject.toml | 69 ++++++++ tests/__init__.py | 3 + 33 files changed, 312 insertions(+), 18 deletions(-) create mode 100644 LICENSE.txt create mode 100644 README.md create mode 100644 creeper_adventure/__about__.py create mode 100644 creeper_adventure/__init__.py create mode 100644 creeper_adventure/__main__.py rename {assets => creeper_adventure/assets}/bee/idle/1.png (100%) rename {assets => creeper_adventure/assets}/chest.png (100%) rename {assets => creeper_adventure/assets}/crafting-table.png (100%) rename {assets => creeper_adventure/assets}/creeper/idle/1.png (100%) rename {assets => creeper_adventure/assets}/creeper/idle/2.png (100%) rename {assets => creeper_adventure/assets}/creeper/idle/3.png (100%) rename {assets => creeper_adventure/assets}/creeper/idle/4.png (100%) rename {assets => creeper_adventure/assets}/creeper/idle/5.png (100%) rename {assets => creeper_adventure/assets}/grass.png (100%) rename {assets => creeper_adventure/assets}/leaf.png (100%) rename {assets => creeper_adventure/assets}/log.png (100%) rename {assets => creeper_adventure/assets}/oak_trees/1.png (100%) rename {assets => creeper_adventure/assets}/oak_trees/2.png (100%) rename {assets => creeper_adventure/assets}/oak_trees/4.png (100%) rename {assets => creeper_adventure/assets}/oak_trees/5.png (100%) rename {assets => creeper_adventure/assets}/sounds/axe.mp3 (100%) rename {assets => creeper_adventure/assets}/sounds/short-axe.mp3 (100%) rename {assets => creeper_adventure/assets}/sounds/walking.mp3 (100%) rename {assets => creeper_adventure/assets}/spotlight.png (100%) rename {assets => creeper_adventure/assets}/stev/idle/0.png (100%) rename {assets => creeper_adventure/assets}/stev/idle/1.png (100%) create mode 100644 creeper_adventure/cli/__init__.py rename creeper.py => creeper_adventure/creeper.py (94%) rename game.py => creeper_adventure/game.py (92%) create mode 100644 creeper_adventure/joytest.py create mode 100644 pyproject.toml create mode 100644 tests/__init__.py diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 30c8643..5cb548c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -16,7 +16,7 @@ jobs: with: python-version: '3.10' - run: pip install -r requirements.txt - - run: pyinstaller --noconsole creeper.py + - run: pyinstaller --noconsole creeper_adventure/creeper.py - run: cp -r assets dist/creeper - name: Step 3 - Use the Upload Artifact GitHub Action uses: actions/upload-artifact@v2 diff --git a/LICENSE.txt b/LICENSE.txt new file mode 100644 index 0000000..9cde24d --- /dev/null +++ b/LICENSE.txt @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) 2023-present Waylon S. Walker + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..0319349 --- /dev/null +++ b/README.md @@ -0,0 +1,21 @@ +# creeper-adventure + +[![PyPI - Version](https://img.shields.io/pypi/v/creeper-adventure.svg)](https://pypi.org/project/creeper-adventure) +[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/creeper-adventure.svg)](https://pypi.org/project/creeper-adventure) + +----- + +**Table of Contents** + +- [Installation](#installation) +- [License](#license) + +## Installation + +```console +pip install creeper-adventure +``` + +## License + +`creeper-adventure` is distributed under the terms of the [MIT](https://spdx.org/licenses/MIT.html) license. diff --git a/creeper_adventure/__about__.py b/creeper_adventure/__about__.py new file mode 100644 index 0000000..dc32659 --- /dev/null +++ b/creeper_adventure/__about__.py @@ -0,0 +1,4 @@ +# SPDX-FileCopyrightText: 2023-present Waylon S. Walker +# +# SPDX-License-Identifier: MIT +__version__ = '0.0.1' diff --git a/creeper_adventure/__init__.py b/creeper_adventure/__init__.py new file mode 100644 index 0000000..2a9f0e4 --- /dev/null +++ b/creeper_adventure/__init__.py @@ -0,0 +1,3 @@ +# SPDX-FileCopyrightText: 2023-present Waylon S. Walker +# +# SPDX-License-Identifier: MIT diff --git a/creeper_adventure/__main__.py b/creeper_adventure/__main__.py new file mode 100644 index 0000000..45a740a --- /dev/null +++ b/creeper_adventure/__main__.py @@ -0,0 +1,9 @@ +# SPDX-FileCopyrightText: 2023-present Waylon S. Walker +# +# SPDX-License-Identifier: MIT +import sys + +if __name__ == '__main__': + from .cli import creeper_adventure + + sys.exit(creeper_adventure()) diff --git a/assets/bee/idle/1.png b/creeper_adventure/assets/bee/idle/1.png similarity index 100% rename from assets/bee/idle/1.png rename to creeper_adventure/assets/bee/idle/1.png diff --git a/assets/chest.png b/creeper_adventure/assets/chest.png similarity index 100% rename from assets/chest.png rename to creeper_adventure/assets/chest.png diff --git a/assets/crafting-table.png b/creeper_adventure/assets/crafting-table.png similarity index 100% rename from assets/crafting-table.png rename to creeper_adventure/assets/crafting-table.png diff --git a/assets/creeper/idle/1.png b/creeper_adventure/assets/creeper/idle/1.png similarity index 100% rename from assets/creeper/idle/1.png rename to creeper_adventure/assets/creeper/idle/1.png diff --git a/assets/creeper/idle/2.png b/creeper_adventure/assets/creeper/idle/2.png similarity index 100% rename from assets/creeper/idle/2.png rename to creeper_adventure/assets/creeper/idle/2.png diff --git a/assets/creeper/idle/3.png b/creeper_adventure/assets/creeper/idle/3.png similarity index 100% rename from assets/creeper/idle/3.png rename to creeper_adventure/assets/creeper/idle/3.png diff --git a/assets/creeper/idle/4.png b/creeper_adventure/assets/creeper/idle/4.png similarity index 100% rename from assets/creeper/idle/4.png rename to creeper_adventure/assets/creeper/idle/4.png diff --git a/assets/creeper/idle/5.png b/creeper_adventure/assets/creeper/idle/5.png similarity index 100% rename from assets/creeper/idle/5.png rename to creeper_adventure/assets/creeper/idle/5.png diff --git a/assets/grass.png b/creeper_adventure/assets/grass.png similarity index 100% rename from assets/grass.png rename to creeper_adventure/assets/grass.png diff --git a/assets/leaf.png b/creeper_adventure/assets/leaf.png similarity index 100% rename from assets/leaf.png rename to creeper_adventure/assets/leaf.png diff --git a/assets/log.png b/creeper_adventure/assets/log.png similarity index 100% rename from assets/log.png rename to creeper_adventure/assets/log.png diff --git a/assets/oak_trees/1.png b/creeper_adventure/assets/oak_trees/1.png similarity index 100% rename from assets/oak_trees/1.png rename to creeper_adventure/assets/oak_trees/1.png diff --git a/assets/oak_trees/2.png b/creeper_adventure/assets/oak_trees/2.png similarity index 100% rename from assets/oak_trees/2.png rename to creeper_adventure/assets/oak_trees/2.png diff --git a/assets/oak_trees/4.png b/creeper_adventure/assets/oak_trees/4.png similarity index 100% rename from assets/oak_trees/4.png rename to creeper_adventure/assets/oak_trees/4.png diff --git a/assets/oak_trees/5.png b/creeper_adventure/assets/oak_trees/5.png similarity index 100% rename from assets/oak_trees/5.png rename to creeper_adventure/assets/oak_trees/5.png diff --git a/assets/sounds/axe.mp3 b/creeper_adventure/assets/sounds/axe.mp3 similarity index 100% rename from assets/sounds/axe.mp3 rename to creeper_adventure/assets/sounds/axe.mp3 diff --git a/assets/sounds/short-axe.mp3 b/creeper_adventure/assets/sounds/short-axe.mp3 similarity index 100% rename from assets/sounds/short-axe.mp3 rename to creeper_adventure/assets/sounds/short-axe.mp3 diff --git a/assets/sounds/walking.mp3 b/creeper_adventure/assets/sounds/walking.mp3 similarity index 100% rename from assets/sounds/walking.mp3 rename to creeper_adventure/assets/sounds/walking.mp3 diff --git a/assets/spotlight.png b/creeper_adventure/assets/spotlight.png similarity index 100% rename from assets/spotlight.png rename to creeper_adventure/assets/spotlight.png diff --git a/assets/stev/idle/0.png b/creeper_adventure/assets/stev/idle/0.png similarity index 100% rename from assets/stev/idle/0.png rename to creeper_adventure/assets/stev/idle/0.png diff --git a/assets/stev/idle/1.png b/creeper_adventure/assets/stev/idle/1.png similarity index 100% rename from assets/stev/idle/1.png rename to creeper_adventure/assets/stev/idle/1.png diff --git a/creeper_adventure/cli/__init__.py b/creeper_adventure/cli/__init__.py new file mode 100644 index 0000000..76b12d9 --- /dev/null +++ b/creeper_adventure/cli/__init__.py @@ -0,0 +1,19 @@ +# SPDX-FileCopyrightText: 2023-present Waylon S. Walker +# +# SPDX-License-Identifier: MIT +import click + +from ..__about__ import __version__ +from ..creeper import main + + +@click.group( + context_settings={"help_option_names": ["-h", "--help"]}, + invoke_without_command=True, +) +@click.version_option(version=__version__, prog_name="creeper-adventure") +@click.pass_context +@click.option("--debug", is_flag=True, help="start with the debug menu open") +def creeper_adventure(ctx: click.Context, debug): + print(debug) + main(debug) diff --git a/creeper.py b/creeper_adventure/creeper.py similarity index 94% rename from creeper.py rename to creeper_adventure/creeper.py index 430b51b..e90309d 100755 --- a/creeper.py +++ b/creeper_adventure/creeper.py @@ -6,7 +6,9 @@ from pathlib import Path import pygame from more_itertools import flatten -from game import Game +from creeper_adventure.game import Game + +ASSETS = Path(__file__).parent / "assets" class MouseSprite: @@ -29,7 +31,7 @@ class MouseSprite: if self.hotbar.selected.type is None: pygame.draw.rect(self.surf, (255, 0, 0), self.rect) else: - self.img = pygame.image.load(f"assets/{self.hotbar.selected.type}.png") + self.img = pygame.image.load(ASSETS / f"{self.hotbar.selected.type}.png") self.surf.blit( pygame.transform.scale(self.img, (16, 16)), self.get_nearest_block_pos(), @@ -169,7 +171,7 @@ class HotBarItem: self.surf.fill((185, 185, 205, 60)) if self.type: - self.img = pygame.image.load(f"assets/{self.type}.png") + self.img = pygame.image.load(ASSETS / f"{self.type}.png") self.ui.blit( pygame.transform.scale( self.img, @@ -269,7 +271,7 @@ class LightSource: self.img = img self.center = center self.sx, self.sy = center - self.spot = pygame.image.load("assets/spotlight.png") + self.spot = pygame.image.load(ASSETS / "spotlight.png") class Leaf: @@ -279,7 +281,7 @@ class Leaf: self.center = center self.sx, self.sy = center self.img = pygame.transform.scale( - pygame.image.load("assets/leaf.png"), (4, 4) + pygame.image.load(ASSETS / "leaf.png"), (4, 4) ).convert_alpha() self.lifespan = lifespan self.r = random.randint(0, 360) @@ -314,7 +316,7 @@ class Leaf: class Bee: def __init__(self): - self.bee = pygame.image.load("assets/bee/idle/1.png") + self.bee = pygame.image.load(ASSETS / "bee/idle/1.png") self.x = 0 self.y = 0 @@ -331,7 +333,7 @@ class Bee: class Creeper(Game): - def __init__(self): + def __init__(self, debug=False): super().__init__() self.inventory = {} self.day_len = 1000 * 60 @@ -339,29 +341,29 @@ class Creeper(Game): self.foreground = pygame.Surface(self.screen.get_size()) self.build = pygame.Surface(self.screen.get_size()) self.darkness = pygame.Surface(self.screen.get_size()).convert_alpha() - self.axe_sound = pygame.mixer.Sound("assets/sounds/axe.mp3") - self.walking_sound = pygame.mixer.Sound("assets/sounds/walking.mp3") + self.axe_sound = pygame.mixer.Sound(ASSETS / "sounds/axe.mp3") + self.walking_sound = pygame.mixer.Sound(ASSETS / "sounds/walking.mp3") self.walking_sound_is_playing = False self.background.fill((0, 255, 247)) self.x, self.y = [i / 2 for i in self.screen.get_size()] - self.spot = pygame.image.load("assets/spotlight.png") + self.spot = pygame.image.load(ASSETS / "spotlight.png") self.light_power = 1.1 self.leaf = pygame.transform.scale( - pygame.image.load("assets/leaf.png"), (4, 4) + pygame.image.load(ASSETS / "leaf.png"), (4, 4) ).convert_alpha() self.creepers = cycle( flatten( [ repeat(pygame.image.load(img), 5) - for img in Path("assets/stev/idle/").glob("*.png") + for img in Path(ASSETS / "stev/idle/").glob("*.png") ] ) ) self.tree_imgs = [ - pygame.image.load(img) for img in Path("assets/oak_trees/").glob("*.png") + pygame.image.load(img) for img in Path(ASSETS / "oak_trees/").glob("*.png") ] - # self.creeper = pygame.image.load("assets/creeper/idle/1.png") + # self.creeper = pygame.image.load(ASSETS/"creeper/idle/1.png") self.creeper = next(self.creepers) self.bee = Bee() x = 0 @@ -402,7 +404,7 @@ class Creeper(Game): self.main_open_debounce = 1 self.inventory_menu = Menu(self, title="inventory") self.debug_menu = DebugMenu(self) - self.debug_menu.is_open = True + self.debug_menu.is_open = debug self.main_menu = Menu(self, title="main menu") def attack(self): @@ -619,6 +621,10 @@ class Creeper(Game): self.normal_keys() -if __name__ == "__main__": - creeper = Creeper() +def main(debug=False): + creeper = Creeper(debug=debug) creeper.run() + + +if __name__ == "__main__": + main() diff --git a/game.py b/creeper_adventure/game.py similarity index 92% rename from game.py rename to creeper_adventure/game.py index 46d728a..852a343 100755 --- a/game.py +++ b/creeper_adventure/game.py @@ -8,6 +8,8 @@ class Game: pygame.display.set_caption(__file__) self.screen_size = (854, 480) + self.screen_size = (1280, 800) + self.screen_size = (1920, 1080) self.screen = pygame.display.set_mode(self.screen_size) self.clock = pygame.time.Clock() diff --git a/creeper_adventure/joytest.py b/creeper_adventure/joytest.py new file mode 100644 index 0000000..c508b08 --- /dev/null +++ b/creeper_adventure/joytest.py @@ -0,0 +1,149 @@ +import pygame + +pygame.init() +# This is a simple class that will help us print to the screen. +# It has nothing to do with the joysticks, just outputting the +# information. +class TextPrint: + def __init__(self): + self.reset() + self.font = pygame.font.Font(None, 25) + + def tprint(self, screen, text): + text_bitmap = self.font.render(text, True, (0, 0, 0)) + screen.blit(text_bitmap, (self.x, self.y)) + self.y += self.line_height + + def reset(self): + self.x = 10 + self.y = 10 + self.line_height = 15 + + def indent(self): + self.x += 10 + + def unindent(self): + self.x -= 10 + + +def main(): + # Set the width and height of the screen (width, height), and name the window. + screen = pygame.display.set_mode((500, 700)) + pygame.display.set_caption("Joystick example") + + # Used to manage how fast the screen updates. + clock = pygame.time.Clock() + + # Get ready to print. + text_print = TextPrint() + + # This dict can be left as-is, since pygame will generate a + # pygame.JOYDEVICEADDED event for every joystick connected + # at the start of the program. + joysticks = {} + + done = False + while not done: + # Event processing step. + # Possible joystick events: JOYAXISMOTION, JOYBALLMOTION, JOYBUTTONDOWN, + # JOYBUTTONUP, JOYHATMOTION, JOYDEVICEADDED, JOYDEVICEREMOVED + for event in pygame.event.get(): + if event.type == pygame.QUIT: + done = True # Flag that we are done so we exit this loop. + + if event.type == pygame.JOYBUTTONDOWN: + print("Joystick button pressed.") + if event.button == 0: + joystick = joysticks[event.instance_id] + if joystick.rumble(0, 0.7, 500): + print(f"Rumble effect played on joystick {event.instance_id}") + + if event.type == pygame.JOYBUTTONUP: + print("Joystick button released.") + + # Handle hotplugging + if event.type == pygame.JOYDEVICEADDED: + # This event will be generated when the program starts for every + # joystick, filling up the list without needing to create them manually. + joy = pygame.joystick.Joystick(event.device_index) + joysticks[joy.get_instance_id()] = joy + print(f"Joystick {joy.get_instance_id()} connencted") + + if event.type == pygame.JOYDEVICEREMOVED: + del joysticks[event.instance_id] + print(f"Joystick {event.instance_id} disconnected") + + # Drawing step + # First, clear the screen to white. Don't put other drawing commands + # above this, or they will be erased with this command. + screen.fill((255, 255, 255)) + text_print.reset() + + # Get count of joysticks. + joystick_count = pygame.joystick.get_count() + + text_print.tprint(screen, f"Number of joysticks: {joystick_count}") + text_print.indent() + + # For each joystick: + for joystick in joysticks.values(): + jid = joystick.get_instance_id() + + text_print.tprint(screen, f"Joystick {jid}") + text_print.indent() + + # Get the name from the OS for the controller/joystick. + name = joystick.get_name() + text_print.tprint(screen, f"Joystick name: {name}") + + guid = joystick.get_guid() + text_print.tprint(screen, f"GUID: {guid}") + + power_level = joystick.get_power_level() + text_print.tprint(screen, f"Joystick's power level: {power_level}") + + # Usually axis run in pairs, up/down for one, and left/right for + # the other. Triggers count as axes. + axes = joystick.get_numaxes() + text_print.tprint(screen, f"Number of axes: {axes}") + text_print.indent() + + for i in range(axes): + axis = joystick.get_axis(i) + text_print.tprint(screen, f"Axis {i} value: {axis:>6.3f}") + text_print.unindent() + + buttons = joystick.get_numbuttons() + text_print.tprint(screen, f"Number of buttons: {buttons}") + text_print.indent() + + for i in range(buttons): + button = joystick.get_button(i) + text_print.tprint(screen, f"Button {i:>2} value: {button}") + text_print.unindent() + + hats = joystick.get_numhats() + text_print.tprint(screen, f"Number of hats: {hats}") + text_print.indent() + + # Hat position. All or nothing for direction, not a float like + # get_axis(). Position is a tuple of int values (x, y). + for i in range(hats): + hat = joystick.get_hat(i) + text_print.tprint(screen, f"Hat {i} value: {str(hat)}") + text_print.unindent() + + text_print.unindent() + + # Go ahead and update the screen with what we've drawn. + pygame.display.flip() + + # Limit to 30 frames per second. + clock.tick(30) + + +if __name__ == "__main__": + main() + # If you forget this line, the program will 'hang' + # on exit if running from IDLE. + pygame.quit() diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..ec8968e --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,69 @@ +[build-system] +requires = ["hatchling"] +build-backend = "hatchling.build" + +[project] +name = "creeper-adventure" +description = 'a top down 2d adventure game' +readme = "README.md" +requires-python = ">=3.7" +license = "MIT" +keywords = [] +authors = [ + { name = "Waylon S. Walker", email = "waylon@waylonwalker.com" }, +] +classifiers = [ + "Development Status :: 4 - Beta", + "Programming Language :: Python", + "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: Implementation :: CPython", + "Programming Language :: Python :: Implementation :: PyPy", +] +dependencies = [ + "click", + "pygame", + "more_itertools", +] +dynamic = ["version"] + +[project.urls] +Documentation = "https://github.com/unknown/creeper-adventure#readme" +Issues = "https://github.com/unknown/creeper-adventure/issues" +Source = "https://github.com/unknown/creeper-adventure" + +[project.scripts] +creeper-adventure = "creeper_adventure.cli:creeper_adventure" +joytest = "creeper_adventure.joytest:main" + +[tool.hatch.version] +path = "creeper_adventure/__about__.py" + +[tool.hatch.envs.default] +dependencies = [ + "pytest", + "pytest-cov", +] +[tool.hatch.envs.default.scripts] +cov = "pytest --cov-report=term-missing --cov-config=pyproject.toml --cov=creeper_adventure --cov=tests {args}" +no-cov = "cov --no-cov {args}" + +[[tool.hatch.envs.test.matrix]] +python = ["37", "38", "39", "310", "311"] + +[tool.coverage.run] +branch = true +parallel = true +omit = [ + "creeper_adventure/__about__.py", +] + +[tool.coverage.report] +exclude_lines = [ + "no cov", + "if __name__ == .__main__.:", + "if TYPE_CHECKING:", +] diff --git a/tests/__init__.py b/tests/__init__.py new file mode 100644 index 0000000..2a9f0e4 --- /dev/null +++ b/tests/__init__.py @@ -0,0 +1,3 @@ +# SPDX-FileCopyrightText: 2023-present Waylon S. Walker +# +# SPDX-License-Identifier: MIT