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(), +)