Initial Commit

This commit is contained in:
2026-02-10 23:00:19 -06:00
commit a6690b4382
12 changed files with 130 additions and 0 deletions

12
.editorconfig Normal file
View File

@@ -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

5
.gitignore vendored Normal file
View File

@@ -0,0 +1,5 @@
.chinook/
.environ/
.pytest_cache/
*.egg-info/
__pycache__/

13
CHANGELOG.md Normal file
View File

@@ -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] - <DATE>
### Added
### Changed
### Fixed
### Removed

7
LICENSE.md Normal file
View File

@@ -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.

1
README.md Normal file
View File

@@ -0,0 +1 @@
# Chinook

0
chinook/__init__.py Normal file
View File

47
chinook/__main__.py Normal file
View File

@@ -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()

View File

@@ -0,0 +1 @@
from ._chinookfile import ChinookFile

View File

@@ -0,0 +1,5 @@
from dataclasses import dataclass
@dataclass
class ChinookFile:
pass

View File

@@ -0,0 +1,3 @@
from ._build import build
__all__ = [ build ]

View File

@@ -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

11
pyproject.toml Normal file
View File

@@ -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 = {}