fix: add setup.py

This commit is contained in:
Markus Pesch 2023-03-25 14:23:04 +01:00
parent 5a8b71bfbe
commit 0a46ed0c87
Signed by: volker.raschek
GPG Key ID: 852BCC170D81A982
3 changed files with 47 additions and 1 deletions

10
main.py
View File

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

View File

@ -2,3 +2,4 @@ cryptography==39.0.1
paramiko==2.11.1
PyYAML==6.0
scp==0.14.4
setuptools==67.3.0

37
setup.py Normal file
View File

@ -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"
],
)