diff --git a/main.py b/main.py index 1a2a1b6..e7112e3 100755 --- a/main.py +++ b/main.py @@ -64,6 +64,10 @@ def main(): yaml.dump(local_config, f) def create_ssh_client(hostname: str, port: str, username: str, identity_file: str, identity_passphrase: str) -> SSHClient: + ''' + create_ssh_client returns based on passed arguments an SSHClient for example + to establish a connection. + ''' ssh_client = paramiko.SSHClient() ssh_client.set_missing_host_key_policy(paramiko.AutoAddPolicy()) @@ -77,8 +81,12 @@ def create_ssh_client(hostname: str, port: str, username: str, identity_file: st return ssh_client - def from_private_key(file_obj, password=None) -> PKey: + ''' + from_private_key returns a private key object based on a passed file and an + optional password + ''' + private_key = None file_bytes = bytes(file_obj.read(), "utf-8") try: diff --git a/requirements.txt b/requirements.txt index 3bc094c..23d966f 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,3 +2,4 @@ cryptography==39.0.1 paramiko==2.11.1 PyYAML==6.0 scp==0.14.4 +setuptools==67.3.0 diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..9f3042d --- /dev/null +++ b/setup.py @@ -0,0 +1,37 @@ +import os +from setuptools import setup + +try: + readme = open(os.path.join(os.path.dirname(__file__), "README.md")).read() +except ValueError: + readme = "" + +setup( + name="kcf", + description="A script to merge a remote kubectl configuration with a local one", + long_description=readme, + long_description_content_type="text/markdown", + # Documentation: https://gist.github.com/nazrulworld/3800c84e28dc464b2b30cec8bc1287fc + classifiers=[ + "Programming Language :: Python", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.10", + "Development Status :: 3 - Alpha", + "Topic :: Software Development", + "License :: OSI Approved :: MIT License" + ], + keywords="kubernetes, kubectl", + author="Markus Pesch", + author_email="markus.pesch@cryptic.systems", + url="https://github.com/volker-raschek/kcf", + # py_modules=[""], + # include_package_data=True, + license="Apache 2.0", + install_requires=[ + "cryptography>=39.0.1", + "paramiko>=2.11.1", + "PyYAML>=6.0", + "scp>=0.14.4", + "setuptools>=67.3.0" + ], +)