From 3d53e0bf7718ba9a66578dc35bbbc6d071c6d3a4 Mon Sep 17 00:00:00 2001 From: Roberto Berto Date: Tue, 27 Aug 2024 15:04:58 -0300 Subject: created Makefile added dev/ to ignore changed whitespaces only in example.py --- .gitignore | 1 + Makefile | 15 +++++++++++++++ example.py | 14 +++++++------- 3 files changed, 23 insertions(+), 7 deletions(-) create mode 100644 Makefile diff --git a/.gitignore b/.gitignore index 87cb9f4..9f1438a 100644 --- a/.gitignore +++ b/.gitignore @@ -164,4 +164,5 @@ vagrant/.vagrant packer/ *.code-workspace .env +dev/ diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..04ed05a --- /dev/null +++ b/Makefile @@ -0,0 +1,15 @@ +.PHONE: help +help: + @echo "build - build the package" + @echo "upload - upload the package to PyPI" + +.PHONY: build +build: + source env/bin/activate + python -m build --sdist + python -m build --wheel + +upload: + source env/bin/activate + twine check dist/* + twine upload dist/* diff --git a/example.py b/example.py index 3f81de0..2796329 100644 --- a/example.py +++ b/example.py @@ -1,6 +1,6 @@ # importing modules import warnings -warnings.filterwarnings("ignore", category=RuntimeWarning) +warnings.filterwarnings("ignore", category=RuntimeWarning) import sys import os # adding pyvyos to sys.path @@ -8,7 +8,7 @@ import os import unittest from dotenv import load_dotenv -import pprint +import pprint import random import string @@ -18,7 +18,7 @@ from pyvyos.device import ApiResponse # getting env variables -load_dotenv() +load_dotenv() hostname = os.getenv('VYDEVICE_HOSTNAME') apikey = os.getenv('VYDEVICE_APIKEY') port = os.getenv('VYDEVICE_PORT') @@ -51,16 +51,16 @@ if __name__ == '__main__': #pprint.pprint(response) #response = device.reset(path=["conntrack-sync", "internal-cache"]) - #pprint.pprint(response) + #pprint.pprint(response) #response = device.reboot(path=["now"]) - #pprint.pprint(response) + #pprint.pprint(response) #response = device.shutdown(path=["now"]) - #pprint.pprint(response) + #pprint.pprint(response) #response = device.image_add(url="https://github.com/vyos/vyos-rolling-nightly-builds/releases/download/1.5-rolling-202312130023/vyos-1.5-rolling-202312130023-amd64.iso") #pprint.pprint(response) response = device.image_delete(name="foo") - pprint.pprint(response) + pprint.pprint(response) -- cgit v1.2.3