kitecmd 0.6__tar.gz → 0.7__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,7 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: kitecmd
3
- Version: 0.6
4
- Summary: A CLI tool with update checking
3
+ Version: 0.7
4
+ Summary: A CLI tool with update checking and other tools.
5
5
  Author: coltonsr77
6
6
  Requires-Python: >=3.8
7
7
  Requires-Dist: requests
@@ -0,0 +1 @@
1
+ __version__ = "0.7"
@@ -1,6 +1,8 @@
1
1
  import argparse
2
2
  import requests
3
3
  import sys
4
+ import platform
5
+ import os
4
6
  from importlib.metadata import version, PackageNotFoundError
5
7
 
6
8
 
@@ -22,6 +24,7 @@ def main():
22
24
  # === test command ===
23
25
  test_parser = subparsers.add_parser("test", help="Run a test message")
24
26
  test_parser.add_argument("--msg", "-m", default="This is a test.", help="Custom test message")
27
+ test_parser.add_argument("--verbose", "-V", action="store_true", help="Show detailed system info")
25
28
 
26
29
  # === checkupdate command ===
27
30
  subparsers.add_parser("checkupdate", help="Check if a new version is available on PyPI")
@@ -36,7 +39,7 @@ def main():
36
39
  show_version("kitecmd")
37
40
 
38
41
  elif args.command == "test":
39
- print(f"🧪 {args.msg}")
42
+ run_test(args)
40
43
 
41
44
  elif args.command == "checkupdate":
42
45
  check_for_update("kitecmd")
@@ -45,35 +48,49 @@ def main():
45
48
  parser.print_help()
46
49
 
47
50
 
48
- def show_version(package_name):
49
- """Print the installed version."""
51
+ def run_test(args):
52
+ """Handle the 'test' command logic."""
53
+ print(args.msg)
54
+
55
+ if args.verbose:
56
+ print("\n--- Verbose Info ---")
57
+ print(f"kitecmd version: {get_package_version('kitecmd')}")
58
+ print(f"Python version: {platform.python_version()}")
59
+ print(f"Platform: {platform.system()} {platform.release()}")
60
+ print(f"Working directory: {os.getcwd()}")
61
+ print(f"User: {os.getenv('USERNAME') or os.getenv('USER')}")
62
+ print("--------------------")
63
+
64
+
65
+ def get_package_version(package_name):
66
+ """Safely get the package version."""
50
67
  try:
51
- current_version = version(package_name)
52
- print(f"kitecmd version {current_version}")
68
+ return version(package_name)
53
69
  except PackageNotFoundError:
54
- print("⚠️ Could not determine the version (package not found).")
70
+ return "Unknown"
71
+
72
+
73
+ def show_version(package_name):
74
+ """Print the installed version."""
75
+ print(f"kitecmd version {get_package_version(package_name)}")
55
76
 
56
77
 
57
78
  def check_for_update(package_name):
58
79
  """Check PyPI for the latest version of this package."""
59
- try:
60
- current_version = version(package_name)
61
- except PackageNotFoundError:
62
- print("⚠️ Unable to detect installed version.")
63
- sys.exit(1)
80
+ current_version = get_package_version(package_name)
64
81
 
65
82
  try:
66
83
  resp = requests.get(f"https://pypi.org/pypi/{package_name}/json", timeout=5)
67
84
  resp.raise_for_status()
68
85
  latest_version = resp.json()["info"]["version"]
69
86
  except requests.RequestException as e:
70
- print(f"❌ Could not fetch update info: {e}")
87
+ print(f"Could not fetch update info: {e}")
71
88
  sys.exit(1)
72
89
 
73
90
  if current_version == latest_version:
74
- print(f"✅ You are using the latest version ({current_version})")
91
+ print(f"You are using the latest version ({current_version})")
75
92
  else:
76
- print(f"⬆️ A new version is available!")
77
- print(f" Installed: {current_version}")
78
- print(f" Latest: {latest_version}")
79
- print(f"👉 To update, run: pip install --upgrade {package_name}")
93
+ print("A new version is available!")
94
+ print(f"Installed: {current_version}")
95
+ print(f"Latest: {latest_version}")
96
+ print(f"To update, run: pip install --upgrade {package_name}")
@@ -1,7 +1,7 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: kitecmd
3
- Version: 0.6
4
- Summary: A CLI tool with update checking
3
+ Version: 0.7
4
+ Summary: A CLI tool with update checking and other tools.
5
5
  Author: coltonsr77
6
6
  Requires-Python: >=3.8
7
7
  Requires-Dist: requests
@@ -2,9 +2,9 @@ from setuptools import setup, find_packages
2
2
 
3
3
  setup(
4
4
  name="kitecmd",
5
- version="0.6",
5
+ version="0.7",
6
6
  author="coltonsr77",
7
- description="A CLI tool with update checking",
7
+ description="A CLI tool with update checking and other tools.",
8
8
  packages=find_packages(include=["kitecmd", "kitecmd.*"]),
9
9
  install_requires=["requests"],
10
10
  entry_points={
@@ -1 +0,0 @@
1
- __version__ = "0.6"
File without changes
File without changes
File without changes
File without changes