From c8f58e8d6ea2cccbae9d1707652aa7c7789ebff1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn-Michael=20Miehe?= <40151420+ldericher@users.noreply.github.com> Date: Tue, 30 Apr 2024 00:47:55 +0200 Subject: [PATCH] create new monorepo --- .gitignore | 160 ++++++++++++++++++++++++ LICENSE | 21 ++++ README.md | 1 + _common/.devcontainer/devcontainer.json | 55 ++++++++ _common/.flake8 | 4 + _common/.isort.cfg | 3 + _common/.vscode/launch.json | 16 +++ _common/.vscode/settings.json | 20 +++ kiwi-core/.devcontainer | 1 + kiwi-core/.flake8 | 1 + kiwi-core/.isort.cfg | 1 + kiwi-core/.vscode | 1 + kiwi-core/kiwi_scp_core/lib.py | 2 + kiwi-core/poetry.lock | 7 ++ kiwi-core/pyproject.toml | 13 ++ kiwi-scp/.devcontainer | 1 + kiwi-scp/.flake8 | 1 + kiwi-scp/.isort.cfg | 1 + kiwi-scp/.vscode | 1 + kiwi-scp/README.md | 5 + kiwi-scp/kiwi_scp/main.py | 10 ++ kiwi-scp/poetry.lock | 19 +++ kiwi-scp/pyproject.toml | 18 +++ 23 files changed, 362 insertions(+) create mode 100644 .gitignore create mode 100644 LICENSE create mode 120000 README.md create mode 100644 _common/.devcontainer/devcontainer.json create mode 100644 _common/.flake8 create mode 100644 _common/.isort.cfg create mode 100644 _common/.vscode/launch.json create mode 100644 _common/.vscode/settings.json create mode 120000 kiwi-core/.devcontainer create mode 120000 kiwi-core/.flake8 create mode 120000 kiwi-core/.isort.cfg create mode 120000 kiwi-core/.vscode create mode 100644 kiwi-core/kiwi_scp_core/lib.py create mode 100644 kiwi-core/poetry.lock create mode 100644 kiwi-core/pyproject.toml create mode 120000 kiwi-scp/.devcontainer create mode 120000 kiwi-scp/.flake8 create mode 120000 kiwi-scp/.isort.cfg create mode 120000 kiwi-scp/.vscode create mode 100644 kiwi-scp/README.md create mode 100644 kiwi-scp/kiwi_scp/main.py create mode 100644 kiwi-scp/poetry.lock create mode 100644 kiwi-scp/pyproject.toml diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..68bc17f --- /dev/null +++ b/.gitignore @@ -0,0 +1,160 @@ +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[cod] +*$py.class + +# C extensions +*.so + +# Distribution / packaging +.Python +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +wheels/ +share/python-wheels/ +*.egg-info/ +.installed.cfg +*.egg +MANIFEST + +# PyInstaller +# Usually these files are written by a python script from a template +# before PyInstaller builds the exe, so as to inject date/other infos into it. +*.manifest +*.spec + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt + +# Unit test / coverage reports +htmlcov/ +.tox/ +.nox/ +.coverage +.coverage.* +.cache +nosetests.xml +coverage.xml +*.cover +*.py,cover +.hypothesis/ +.pytest_cache/ +cover/ + +# Translations +*.mo +*.pot + +# Django stuff: +*.log +local_settings.py +db.sqlite3 +db.sqlite3-journal + +# Flask stuff: +instance/ +.webassets-cache + +# Scrapy stuff: +.scrapy + +# Sphinx documentation +docs/_build/ + +# PyBuilder +.pybuilder/ +target/ + +# Jupyter Notebook +.ipynb_checkpoints + +# IPython +profile_default/ +ipython_config.py + +# pyenv +# For a library or package, you might want to ignore these files since the code is +# intended to run in multiple environments; otherwise, check them in: +# .python-version + +# pipenv +# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. +# However, in case of collaboration, if having platform-specific dependencies or dependencies +# having no cross-platform support, pipenv may install dependencies that don't work, or not +# install all needed dependencies. +#Pipfile.lock + +# poetry +# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control. +# This is especially recommended for binary packages to ensure reproducibility, and is more +# commonly ignored for libraries. +# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control +#poetry.lock + +# pdm +# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control. +#pdm.lock +# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it +# in version control. +# https://pdm.fming.dev/#use-with-ide +.pdm.toml + +# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm +__pypackages__/ + +# Celery stuff +celerybeat-schedule +celerybeat.pid + +# SageMath parsed files +*.sage.py + +# Environments +.env +.venv +env/ +venv/ +ENV/ +env.bak/ +venv.bak/ + +# Spyder project settings +.spyderproject +.spyproject + +# Rope project settings +.ropeproject + +# mkdocs documentation +/site + +# mypy +.mypy_cache/ +.dmypy.json +dmypy.json + +# Pyre type checker +.pyre/ + +# pytype static type analyzer +.pytype/ + +# Cython debug symbols +cython_debug/ + +# PyCharm +# JetBrains specific template is maintained in a separate JetBrains.gitignore that can +# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore +# and can be added to the global gitignore or merged into this file. For a more nuclear +# option (not recommended) you can uncomment the following to ignore the entire idea folder. +#.idea/ diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..3310a91 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2024 yavook.de + +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 120000 index 0000000..9eb06cd --- /dev/null +++ b/README.md @@ -0,0 +1 @@ +kiwi-scp/README.md \ No newline at end of file diff --git a/_common/.devcontainer/devcontainer.json b/_common/.devcontainer/devcontainer.json new file mode 100644 index 0000000..56cd891 --- /dev/null +++ b/_common/.devcontainer/devcontainer.json @@ -0,0 +1,55 @@ +// For format details, see https://aka.ms/devcontainer.json. For config options, see the +// README at: https://github.com/devcontainers/templates/tree/main/src/python +{ + "name": "kiwi-scp", + + // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile + "image": "mcr.microsoft.com/vscode/devcontainers/python:1-3.9-bookworm", + + // Features to add to the dev container. More info: https://containers.dev/features. + "features": { + "ghcr.io/devcontainers/features/docker-outside-of-docker:1": {}, + "ghcr.io/devcontainers-contrib/features/poetry:2": {}, + "ghcr.io/devcontainers-contrib/features/apt-get-packages:1": { + "packages": "git-flow" + } + }, + + "containerEnv": { + "TZ": "Europe/Berlin" + }, + + // Configure tool-specific properties. + "customizations": { + // Configure properties specific to VS Code. + "vscode": { + // Set *default* container specific settings.json values on container create. + "settings": { + "python.defaultInterpreterPath": "/usr/local/bin/python", + "terminal.integrated.defaultProfile.linux": "zsh" + }, + // Add the IDs of extensions you want installed when the container is created. + "extensions": [ + "be5invis.toml", + "mhutchie.git-graph", + "ms-python.python", + "ms-python.black-formatter", + "ms-python.flake8", + "ms-python.isort", + "ms-python.vscode-pylance" + ] + } + }, + + // Use 'postCreateCommand' to run commands after the container is created. + "postCreateCommand": "sudo /usr/local/py-utils/bin/poetry self add poetry-plugin-up", + + // Use 'postStartCommand' to run commands after the container is started. + "postStartCommand": "poetry install" + + // Use 'forwardPorts' to make a list of ports inside the container available locally. + // "forwardPorts": [], + + // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. + // "remoteUser": "root" +} \ No newline at end of file diff --git a/_common/.flake8 b/_common/.flake8 new file mode 100644 index 0000000..a77cb08 --- /dev/null +++ b/_common/.flake8 @@ -0,0 +1,4 @@ +[flake8] +max-line-length = 80 +extend-select = B950 +extend-ignore = E203,E501,E701 diff --git a/_common/.isort.cfg b/_common/.isort.cfg new file mode 100644 index 0000000..cea3788 --- /dev/null +++ b/_common/.isort.cfg @@ -0,0 +1,3 @@ +[settings] +profile = "black" +line_length = 80 \ No newline at end of file diff --git a/_common/.vscode/launch.json b/_common/.vscode/launch.json new file mode 100644 index 0000000..3dfb4bc --- /dev/null +++ b/_common/.vscode/launch.json @@ -0,0 +1,16 @@ +{ + // Verwendet IntelliSense zum Ermitteln möglicher Attribute. + // Zeigen Sie auf vorhandene Attribute, um die zugehörigen Beschreibungen anzuzeigen. + // Weitere Informationen finden Sie unter https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "name": "Kiwi main", + "type": "debugpy", + "request": "launch", + "module": "kiwi_scp.main", + "justMyCode": true, + "env": {}, + } + ] +} \ No newline at end of file diff --git a/_common/.vscode/settings.json b/_common/.vscode/settings.json new file mode 100644 index 0000000..59ec155 --- /dev/null +++ b/_common/.vscode/settings.json @@ -0,0 +1,20 @@ +{ + "python.languageServer": "Pylance", + "[python]": { + "editor.formatOnSave": true, + "editor.defaultFormatter": "ms-python.black-formatter", + "editor.codeActionsOnSave": { + "source.organizeImports": "explicit" + }, + }, + "git.closeDiffOnOperation": true, + "python.analysis.typeCheckingMode": "basic", + "python.analysis.diagnosticMode": "workspace", + "python.testing.unittestEnabled": false, + "python.testing.pytestEnabled": true, + "python.testing.pytestArgs": [ + "--import-mode=importlib" + ], + "black-formatter.importStrategy": "fromEnvironment", + "flake8.importStrategy": "fromEnvironment", +} \ No newline at end of file diff --git a/kiwi-core/.devcontainer b/kiwi-core/.devcontainer new file mode 120000 index 0000000..2744295 --- /dev/null +++ b/kiwi-core/.devcontainer @@ -0,0 +1 @@ +../_common/.devcontainer \ No newline at end of file diff --git a/kiwi-core/.flake8 b/kiwi-core/.flake8 new file mode 120000 index 0000000..a0c467f --- /dev/null +++ b/kiwi-core/.flake8 @@ -0,0 +1 @@ +../_common/.flake8 \ No newline at end of file diff --git a/kiwi-core/.isort.cfg b/kiwi-core/.isort.cfg new file mode 120000 index 0000000..edfae6e --- /dev/null +++ b/kiwi-core/.isort.cfg @@ -0,0 +1 @@ +../_common/.isort.cfg \ No newline at end of file diff --git a/kiwi-core/.vscode b/kiwi-core/.vscode new file mode 120000 index 0000000..a442d7b --- /dev/null +++ b/kiwi-core/.vscode @@ -0,0 +1 @@ +../_common/.vscode \ No newline at end of file diff --git a/kiwi-core/kiwi_scp_core/lib.py b/kiwi-core/kiwi_scp_core/lib.py new file mode 100644 index 0000000..d10b8bd --- /dev/null +++ b/kiwi-core/kiwi_scp_core/lib.py @@ -0,0 +1,2 @@ +def hello() -> None: + print("Hello kiwi-core") diff --git a/kiwi-core/poetry.lock b/kiwi-core/poetry.lock new file mode 100644 index 0000000..aed336c --- /dev/null +++ b/kiwi-core/poetry.lock @@ -0,0 +1,7 @@ +# This file is automatically @generated by Poetry 1.8.2 and should not be changed by hand. +package = [] + +[metadata] +lock-version = "2.0" +python-versions = "^3.9" +content-hash = "c595a0588c25d58f3e3834ad7169126836d262b925fe6ca9b5d540dcf301d254" diff --git a/kiwi-core/pyproject.toml b/kiwi-core/pyproject.toml new file mode 100644 index 0000000..271f5a6 --- /dev/null +++ b/kiwi-core/pyproject.toml @@ -0,0 +1,13 @@ +[tool.poetry] +name = "kiwi-scp-core" +version = "0.1.0" +description = "" +license = "MIT" +authors = ["Jörn-Michael <40151420+ldericher@users.noreply.github.com>"] + +[tool.poetry.dependencies] +python = "^3.9" + +[build-system] +build-backend = "poetry.core.masonry.api" +requires = ["poetry-core"] diff --git a/kiwi-scp/.devcontainer b/kiwi-scp/.devcontainer new file mode 120000 index 0000000..2744295 --- /dev/null +++ b/kiwi-scp/.devcontainer @@ -0,0 +1 @@ +../_common/.devcontainer \ No newline at end of file diff --git a/kiwi-scp/.flake8 b/kiwi-scp/.flake8 new file mode 120000 index 0000000..a0c467f --- /dev/null +++ b/kiwi-scp/.flake8 @@ -0,0 +1 @@ +../_common/.flake8 \ No newline at end of file diff --git a/kiwi-scp/.isort.cfg b/kiwi-scp/.isort.cfg new file mode 120000 index 0000000..edfae6e --- /dev/null +++ b/kiwi-scp/.isort.cfg @@ -0,0 +1 @@ +../_common/.isort.cfg \ No newline at end of file diff --git a/kiwi-scp/.vscode b/kiwi-scp/.vscode new file mode 120000 index 0000000..a442d7b --- /dev/null +++ b/kiwi-scp/.vscode @@ -0,0 +1 @@ +../_common/.vscode \ No newline at end of file diff --git a/kiwi-scp/README.md b/kiwi-scp/README.md new file mode 100644 index 0000000..649c74d --- /dev/null +++ b/kiwi-scp/README.md @@ -0,0 +1,5 @@ +# kiwi-scp + +> `kiwi` - simple, consistent, powerful + +The simple tool for managing container servers \ No newline at end of file diff --git a/kiwi-scp/kiwi_scp/main.py b/kiwi-scp/kiwi_scp/main.py new file mode 100644 index 0000000..44bf55a --- /dev/null +++ b/kiwi-scp/kiwi_scp/main.py @@ -0,0 +1,10 @@ +import kiwi_scp_core.lib + + +def main() -> None: + print("Hello kiwi") + kiwi_scp_core.lib.hello() + + +if __name__ == "__main__": + main() diff --git a/kiwi-scp/poetry.lock b/kiwi-scp/poetry.lock new file mode 100644 index 0000000..8068870 --- /dev/null +++ b/kiwi-scp/poetry.lock @@ -0,0 +1,19 @@ +# This file is automatically @generated by Poetry 1.8.2 and should not be changed by hand. + +[[package]] +name = "kiwi-scp-core" +version = "0.1.0" +description = "" +optional = false +python-versions = "^3.9" +files = [] +develop = true + +[package.source] +type = "directory" +url = "../kiwi-core" + +[metadata] +lock-version = "2.0" +python-versions = "^3.9" +content-hash = "daa3a0a80c900e2c198fd5d5c312db186c787f85c78e314648658ea38b26bdf1" diff --git a/kiwi-scp/pyproject.toml b/kiwi-scp/pyproject.toml new file mode 100644 index 0000000..9d24b8e --- /dev/null +++ b/kiwi-scp/pyproject.toml @@ -0,0 +1,18 @@ +[tool.poetry] +name = "kiwi-scp" +version = "0.3.0" +description = "kiwi is the simple tool for managing container servers." +license = "MIT" +authors = ["Jörn-Michael <40151420+ldericher@users.noreply.github.com>"] +readme = "README.md" + +[tool.poetry.dependencies] +kiwi-scp-core = {path="../kiwi-core", develop=true} +python = "^3.9" + +[tool.poetry.scripts] +kiwi = "kiwi_scp.main:main" + +[build-system] +build-backend = "poetry.core.masonry.api" +requires = ["poetry-core"]