From ba3c34c7a7213c1db199d58ed4c5d0b6a558a23e Mon Sep 17 00:00:00 2001 From: ldericher <40151420+ldericher@users.noreply.github.com> Date: Tue, 28 Sep 2021 12:17:53 +0200 Subject: [PATCH] pip installable, but not correct --- bump-version.sh | 2 ++ {src => data}/etc/command_help.txt | 0 {src => data}/etc/docker-compose_default.yml | 0 {src => data}/etc/kiwi_default.yml | 0 {src => data}/etc/kiwi_header.yml | 0 {src => data}/etc/kiwi_help.txt | 0 {src => data}/etc/version_tag | 0 {src => data}/images/rsync.Dockerfile | 0 {src/kiwi => kiwi_scp}/__init__.py | 0 {src/kiwi => kiwi_scp}/_constants.py | 0 {src/kiwi => kiwi_scp}/config.py | 0 {src/kiwi => kiwi_scp}/executable.py | 3 --- {src/kiwi => kiwi_scp}/misc.py | 0 {src/kiwi => kiwi_scp}/parser.py | 0 {src/kiwi => kiwi_scp}/project.py | 0 {src/kiwi => kiwi_scp}/projects.py | 2 +- {src/kiwi => kiwi_scp}/rootkit.py | 0 {src/kiwi => kiwi_scp}/runner.py | 0 kiwi_scp/scripts/__init__.py | 0 src/kiwi-scp.py => kiwi_scp/scripts/kiwi.py | 6 ++--- {src/kiwi => kiwi_scp}/subcommand.py | 0 .../kiwi => kiwi_scp}/subcommands/__init__.py | 0 {src/kiwi => kiwi_scp}/subcommands/_hidden.py | 1 - {src/kiwi => kiwi_scp}/subcommands/build.py | 0 {src/kiwi => kiwi_scp}/subcommands/cmd.py | 0 {src/kiwi => kiwi_scp}/subcommands/disable.py | 0 {src/kiwi => kiwi_scp}/subcommands/down.py | 0 {src/kiwi => kiwi_scp}/subcommands/enable.py | 0 {src/kiwi => kiwi_scp}/subcommands/init.py | 0 {src/kiwi => kiwi_scp}/subcommands/logs.py | 0 {src/kiwi => kiwi_scp}/subcommands/new.py | 0 {src/kiwi => kiwi_scp}/subcommands/pull.py | 0 {src/kiwi => kiwi_scp}/subcommands/purge.py | 0 {src/kiwi => kiwi_scp}/subcommands/push.py | 0 {src/kiwi => kiwi_scp}/subcommands/restart.py | 0 {src/kiwi => kiwi_scp}/subcommands/shell.py | 0 {src/kiwi => kiwi_scp}/subcommands/show.py | 0 {src/kiwi => kiwi_scp}/subcommands/up.py | 0 {src/kiwi => kiwi_scp}/subcommands/update.py | 0 setup.py | 23 +++++++++++++++++++ 40 files changed, 29 insertions(+), 8 deletions(-) rename {src => data}/etc/command_help.txt (100%) rename {src => data}/etc/docker-compose_default.yml (100%) rename {src => data}/etc/kiwi_default.yml (100%) rename {src => data}/etc/kiwi_header.yml (100%) rename {src => data}/etc/kiwi_help.txt (100%) rename {src => data}/etc/version_tag (100%) rename {src => data}/images/rsync.Dockerfile (100%) rename {src/kiwi => kiwi_scp}/__init__.py (100%) rename {src/kiwi => kiwi_scp}/_constants.py (100%) rename {src/kiwi => kiwi_scp}/config.py (100%) rename {src/kiwi => kiwi_scp}/executable.py (97%) rename {src/kiwi => kiwi_scp}/misc.py (100%) rename {src/kiwi => kiwi_scp}/parser.py (100%) rename {src/kiwi => kiwi_scp}/project.py (100%) rename {src/kiwi => kiwi_scp}/projects.py (98%) rename {src/kiwi => kiwi_scp}/rootkit.py (100%) rename {src/kiwi => kiwi_scp}/runner.py (100%) create mode 100644 kiwi_scp/scripts/__init__.py rename src/kiwi-scp.py => kiwi_scp/scripts/kiwi.py (88%) rename {src/kiwi => kiwi_scp}/subcommand.py (100%) rename {src/kiwi => kiwi_scp}/subcommands/__init__.py (100%) rename {src/kiwi => kiwi_scp}/subcommands/_hidden.py (98%) rename {src/kiwi => kiwi_scp}/subcommands/build.py (100%) rename {src/kiwi => kiwi_scp}/subcommands/cmd.py (100%) rename {src/kiwi => kiwi_scp}/subcommands/disable.py (100%) rename {src/kiwi => kiwi_scp}/subcommands/down.py (100%) rename {src/kiwi => kiwi_scp}/subcommands/enable.py (100%) rename {src/kiwi => kiwi_scp}/subcommands/init.py (100%) rename {src/kiwi => kiwi_scp}/subcommands/logs.py (100%) rename {src/kiwi => kiwi_scp}/subcommands/new.py (100%) rename {src/kiwi => kiwi_scp}/subcommands/pull.py (100%) rename {src/kiwi => kiwi_scp}/subcommands/purge.py (100%) rename {src/kiwi => kiwi_scp}/subcommands/push.py (100%) rename {src/kiwi => kiwi_scp}/subcommands/restart.py (100%) rename {src/kiwi => kiwi_scp}/subcommands/shell.py (100%) rename {src/kiwi => kiwi_scp}/subcommands/show.py (100%) rename {src/kiwi => kiwi_scp}/subcommands/up.py (100%) rename {src/kiwi => kiwi_scp}/subcommands/update.py (100%) create mode 100644 setup.py diff --git a/bump-version.sh b/bump-version.sh index a9cd35a..9278bd4 100755 --- a/bump-version.sh +++ b/bump-version.sh @@ -4,7 +4,9 @@ this="$(readlink -f "${0}")" this_dir="$(dirname "${this}")" git_branch="$(git rev-parse --abbrev-ref HEAD)" +git_tag="$(git describe --abbrev=0)" version_str="${git_branch##*/}" echo "${version_str}" > "${this_dir}/src/etc/version_tag" sed -ri "s/(version\s*:).*$/\1 '${version_str}'/" "${this_dir}/example/kiwi.yml" +sed -ri "s/(version\s*=\s*).*$/\1\"${version_str}\",/" "${this_dir}/setup.py" diff --git a/src/etc/command_help.txt b/data/etc/command_help.txt similarity index 100% rename from src/etc/command_help.txt rename to data/etc/command_help.txt diff --git a/src/etc/docker-compose_default.yml b/data/etc/docker-compose_default.yml similarity index 100% rename from src/etc/docker-compose_default.yml rename to data/etc/docker-compose_default.yml diff --git a/src/etc/kiwi_default.yml b/data/etc/kiwi_default.yml similarity index 100% rename from src/etc/kiwi_default.yml rename to data/etc/kiwi_default.yml diff --git a/src/etc/kiwi_header.yml b/data/etc/kiwi_header.yml similarity index 100% rename from src/etc/kiwi_header.yml rename to data/etc/kiwi_header.yml diff --git a/src/etc/kiwi_help.txt b/data/etc/kiwi_help.txt similarity index 100% rename from src/etc/kiwi_help.txt rename to data/etc/kiwi_help.txt diff --git a/src/etc/version_tag b/data/etc/version_tag similarity index 100% rename from src/etc/version_tag rename to data/etc/version_tag diff --git a/src/images/rsync.Dockerfile b/data/images/rsync.Dockerfile similarity index 100% rename from src/images/rsync.Dockerfile rename to data/images/rsync.Dockerfile diff --git a/src/kiwi/__init__.py b/kiwi_scp/__init__.py similarity index 100% rename from src/kiwi/__init__.py rename to kiwi_scp/__init__.py diff --git a/src/kiwi/_constants.py b/kiwi_scp/_constants.py similarity index 100% rename from src/kiwi/_constants.py rename to kiwi_scp/_constants.py diff --git a/src/kiwi/config.py b/kiwi_scp/config.py similarity index 100% rename from src/kiwi/config.py rename to kiwi_scp/config.py diff --git a/src/kiwi/executable.py b/kiwi_scp/executable.py similarity index 97% rename from src/kiwi/executable.py rename to kiwi_scp/executable.py index 3d79983..1c054f5 100644 --- a/src/kiwi/executable.py +++ b/kiwi_scp/executable.py @@ -3,9 +3,6 @@ import logging import os import subprocess -# local -from .config import LoadedConfig - def _is_executable(filename): if filename is None: diff --git a/src/kiwi/misc.py b/kiwi_scp/misc.py similarity index 100% rename from src/kiwi/misc.py rename to kiwi_scp/misc.py diff --git a/src/kiwi/parser.py b/kiwi_scp/parser.py similarity index 100% rename from src/kiwi/parser.py rename to kiwi_scp/parser.py diff --git a/src/kiwi/project.py b/kiwi_scp/project.py similarity index 100% rename from src/kiwi/project.py rename to kiwi_scp/project.py diff --git a/src/kiwi/projects.py b/kiwi_scp/projects.py similarity index 98% rename from src/kiwi/projects.py rename to kiwi_scp/projects.py index 620fc81..1444646 100644 --- a/src/kiwi/projects.py +++ b/kiwi_scp/projects.py @@ -1,6 +1,6 @@ import os -from kiwi.project import Project +from .project import Project class Projects: diff --git a/src/kiwi/rootkit.py b/kiwi_scp/rootkit.py similarity index 100% rename from src/kiwi/rootkit.py rename to kiwi_scp/rootkit.py diff --git a/src/kiwi/runner.py b/kiwi_scp/runner.py similarity index 100% rename from src/kiwi/runner.py rename to kiwi_scp/runner.py diff --git a/kiwi_scp/scripts/__init__.py b/kiwi_scp/scripts/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/kiwi-scp.py b/kiwi_scp/scripts/kiwi.py similarity index 88% rename from src/kiwi-scp.py rename to kiwi_scp/scripts/kiwi.py index 7435727..9bcbc20 100755 --- a/src/kiwi-scp.py +++ b/kiwi_scp/scripts/kiwi.py @@ -4,7 +4,7 @@ import logging # local -import kiwi +import kiwi_scp def set_verbosity(logger, handler, verbosity): @@ -28,10 +28,10 @@ def main(): # add a new handler (needed to set the level) log_handler = logging.StreamHandler() logging.getLogger().addHandler(log_handler) - set_verbosity(logging.getLogger(), log_handler, kiwi.verbosity()) + set_verbosity(logging.getLogger(), log_handler, kiwi_scp.verbosity()) # run the app - if not kiwi.run(): + if not kiwi_scp.run(): quit(1) diff --git a/src/kiwi/subcommand.py b/kiwi_scp/subcommand.py similarity index 100% rename from src/kiwi/subcommand.py rename to kiwi_scp/subcommand.py diff --git a/src/kiwi/subcommands/__init__.py b/kiwi_scp/subcommands/__init__.py similarity index 100% rename from src/kiwi/subcommands/__init__.py rename to kiwi_scp/subcommands/__init__.py diff --git a/src/kiwi/subcommands/_hidden.py b/kiwi_scp/subcommands/_hidden.py similarity index 98% rename from src/kiwi/subcommands/_hidden.py rename to kiwi_scp/subcommands/_hidden.py index d3e0901..062495b 100644 --- a/src/kiwi/subcommands/_hidden.py +++ b/kiwi_scp/subcommands/_hidden.py @@ -3,7 +3,6 @@ import logging import subprocess # local -from .._constants import CONF_DIRECTORY_NAME from ..config import LoadedConfig from ..executable import Executable from ..projects import Projects diff --git a/src/kiwi/subcommands/build.py b/kiwi_scp/subcommands/build.py similarity index 100% rename from src/kiwi/subcommands/build.py rename to kiwi_scp/subcommands/build.py diff --git a/src/kiwi/subcommands/cmd.py b/kiwi_scp/subcommands/cmd.py similarity index 100% rename from src/kiwi/subcommands/cmd.py rename to kiwi_scp/subcommands/cmd.py diff --git a/src/kiwi/subcommands/disable.py b/kiwi_scp/subcommands/disable.py similarity index 100% rename from src/kiwi/subcommands/disable.py rename to kiwi_scp/subcommands/disable.py diff --git a/src/kiwi/subcommands/down.py b/kiwi_scp/subcommands/down.py similarity index 100% rename from src/kiwi/subcommands/down.py rename to kiwi_scp/subcommands/down.py diff --git a/src/kiwi/subcommands/enable.py b/kiwi_scp/subcommands/enable.py similarity index 100% rename from src/kiwi/subcommands/enable.py rename to kiwi_scp/subcommands/enable.py diff --git a/src/kiwi/subcommands/init.py b/kiwi_scp/subcommands/init.py similarity index 100% rename from src/kiwi/subcommands/init.py rename to kiwi_scp/subcommands/init.py diff --git a/src/kiwi/subcommands/logs.py b/kiwi_scp/subcommands/logs.py similarity index 100% rename from src/kiwi/subcommands/logs.py rename to kiwi_scp/subcommands/logs.py diff --git a/src/kiwi/subcommands/new.py b/kiwi_scp/subcommands/new.py similarity index 100% rename from src/kiwi/subcommands/new.py rename to kiwi_scp/subcommands/new.py diff --git a/src/kiwi/subcommands/pull.py b/kiwi_scp/subcommands/pull.py similarity index 100% rename from src/kiwi/subcommands/pull.py rename to kiwi_scp/subcommands/pull.py diff --git a/src/kiwi/subcommands/purge.py b/kiwi_scp/subcommands/purge.py similarity index 100% rename from src/kiwi/subcommands/purge.py rename to kiwi_scp/subcommands/purge.py diff --git a/src/kiwi/subcommands/push.py b/kiwi_scp/subcommands/push.py similarity index 100% rename from src/kiwi/subcommands/push.py rename to kiwi_scp/subcommands/push.py diff --git a/src/kiwi/subcommands/restart.py b/kiwi_scp/subcommands/restart.py similarity index 100% rename from src/kiwi/subcommands/restart.py rename to kiwi_scp/subcommands/restart.py diff --git a/src/kiwi/subcommands/shell.py b/kiwi_scp/subcommands/shell.py similarity index 100% rename from src/kiwi/subcommands/shell.py rename to kiwi_scp/subcommands/shell.py diff --git a/src/kiwi/subcommands/show.py b/kiwi_scp/subcommands/show.py similarity index 100% rename from src/kiwi/subcommands/show.py rename to kiwi_scp/subcommands/show.py diff --git a/src/kiwi/subcommands/up.py b/kiwi_scp/subcommands/up.py similarity index 100% rename from src/kiwi/subcommands/up.py rename to kiwi_scp/subcommands/up.py diff --git a/src/kiwi/subcommands/update.py b/kiwi_scp/subcommands/update.py similarity index 100% rename from src/kiwi/subcommands/update.py rename to kiwi_scp/subcommands/update.py diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..ee07190 --- /dev/null +++ b/setup.py @@ -0,0 +1,23 @@ +from setuptools import setup, find_packages + +setup( + name="kiwi_scp", + version="0.1.6", + packages=find_packages(), + author="LDericher", + author_email="ldericher@gmx.de", + setup_requires="setuptools-pipfile", + use_pipfile=True, + entry_points={ + "console_scripts": [ + "kiwi = kiwi_scp.scripts.kiwi:main" + ], + }, + data_files=[ + ("", ["data/etc/kiwi_help.txt"]) + ], + include_package_data=True, + license="LICENSE", + description="kiwi is the simple tool for managing container servers.", + long_description=open("README.md").read(), +)