commit a6690b43823c0e97651ce01af7046e7b922e4221 Author: SoraKatadzuma Date: Tue Feb 10 23:00:19 2026 -0600 Initial Commit diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..c1186c2 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,12 @@ +root = true + +[*] +indent_style = space +indent_size = 4 +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true + +[*.py] +indent_size = 2 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..db3ca83 --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +.chinook/ +.environ/ +.pytest_cache/ +*.egg-info/ +__pycache__/ diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..4f569a1 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,13 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [0.0.1] - + +### Added +### Changed +### Fixed +### Removed diff --git a/LICENSE.md b/LICENSE.md new file mode 100644 index 0000000..b407907 --- /dev/null +++ b/LICENSE.md @@ -0,0 +1,7 @@ +Copyright 2026 John Christman + +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..2493519 --- /dev/null +++ b/README.md @@ -0,0 +1 @@ +# Chinook diff --git a/chinook/__init__.py b/chinook/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/chinook/__main__.py b/chinook/__main__.py new file mode 100644 index 0000000..17e19ed --- /dev/null +++ b/chinook/__main__.py @@ -0,0 +1,47 @@ +import logging + +from chinook import pipeline +from argparse import ArgumentParser +from pathlib import Path +from semver import Version + + +def main() -> None: + formatter = logging.Formatter("%(asctime)s %(levelname)s %(message)s") + console = logging.StreamHandler() + console.setLevel(logging.DEBUG) + console.setFormatter(formatter) + + logger = logging.getLogger("chinook") + logger.addHandler(console) + logger.setLevel(logging.INFO) + + # Parent parser to all subcommands. + parser = ArgumentParser( + prog = "chinook", + description = "Opinionated build tool for C/C++!" + ) + + commands = parser.add_subparsers(required=True) + buildcmd = commands.add_parser("build",help="Builds your Chinook project") + buildcmd.set_defaults(func=pipeline.build) + buildcmd.add_argument( + "project", + nargs="?", + default=".", + type=Path, + help="The path to the project to build", + metavar="PROJECT" + ) + + print("\n".join([ + "┏┓┓ • ┓ ", + "┃ ┣┓┓┏┓┏┓┏┓┃┏", + "┗┛┛┗┗┛┗┗┛┗┛┛┗ v" + str(Version(major=0,minor=1,patch=0)) + ])) + arguments = parser.parse_args() + arguments.func(arguments) + + +# Auto execute. +if __name__ == "__main__": main() diff --git a/chinook/models/__init__.py b/chinook/models/__init__.py new file mode 100644 index 0000000..1f6ad00 --- /dev/null +++ b/chinook/models/__init__.py @@ -0,0 +1 @@ +from ._chinookfile import ChinookFile diff --git a/chinook/models/_chinookfile.py b/chinook/models/_chinookfile.py new file mode 100644 index 0000000..d098494 --- /dev/null +++ b/chinook/models/_chinookfile.py @@ -0,0 +1,5 @@ +from dataclasses import dataclass + +@dataclass +class ChinookFile: + pass diff --git a/chinook/pipeline/__init__.py b/chinook/pipeline/__init__.py new file mode 100644 index 0000000..acb421c --- /dev/null +++ b/chinook/pipeline/__init__.py @@ -0,0 +1,3 @@ +from ._build import build + +__all__ = [ build ] diff --git a/chinook/pipeline/_build.py b/chinook/pipeline/_build.py new file mode 100644 index 0000000..735df15 --- /dev/null +++ b/chinook/pipeline/_build.py @@ -0,0 +1,25 @@ +from ..models import ChinookFile + +from pathlib import Path +from typing import overload + + +@overload +def build(path: Path) -> None: ... + +@overload +def build(file: ChinookFile) -> None: ... + + +def build(value) -> None: + if isinstance(value, Path): + return _build_from_path(value) + elif isinstance(value, ChinookFile): + return _build_from_file(value) + + +def _build_from_path(path: Path) -> None: + pass + +def _build_from_file(file: ChinookFile) -> None: + pass diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..45fb7a9 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,11 @@ +[project] +name = "chinook" +version = "1.0.0-alpha" +description = "Opinionated build tool for C/C++." +dependencies = ["PyYAML", "semver"] + +[project.scripts] +chinook = "chinook.__main__:main" + +[tool.setuptools.packages] +find = {}