From b2b8211929a21045739fe67b6563b980e3a8720a Mon Sep 17 00:00:00 2001 From: Prem Rara
Date: Wed, 2 Jul 2025 11:34:46 -0400 Subject: [PATCH 1/2] feat(unix): add Python version constraints and development environment - Add python_requires=">=3.6,<3.12" to setup.py to enforce compatibility - Add Python version classifiers for better PyPI metadata - Document Python version requirements in README.md - Add dev-env.sh script for easy development environment setup This change addresses the incompatibility with Python 3.12+ due to Ansible 2.9.x dependency limitations. The project now officially supports Python 3.6 through 3.11. --- unix/README.md | 5 +++++ unix/dev-env.sh | 36 ++++++++++++++++++++++++++++++++++++ unix/setup.py | 19 ++++++++++++++++++- 3 files changed, 59 insertions(+), 1 deletion(-) create mode 100755 unix/dev-env.sh diff --git a/unix/README.md b/unix/README.md index 7ab0e6f..a30d8e8 100644 --- a/unix/README.md +++ b/unix/README.md @@ -14,6 +14,11 @@ Get familiar with Machine Stats, Tidal Tools and Tidal Accelerator! [](https://ssh.cloud.google.com/cloudshell/editor?cloudshell_git_repo=https%3A%2F%2Fgithub.com%2Ftidalmigrations%2Fmachine-stats-workshop&cloudshell_image=gcr.io%2Ftidal-1529434400027%2Fmachine-stats-workshop&cloudshell_tutorial=machine-stats.md&shellonly=true) +## Requirements + +- **Python**: 3.6 - 3.11 (Python 3.12+ is not supported due to Ansible 2.9.x compatibility) +- **Operating System**: Linux/Unix-like systems + ## Installation Install locally in a Python 3 environment: diff --git a/unix/dev-env.sh b/unix/dev-env.sh new file mode 100755 index 0000000..e9627f4 --- /dev/null +++ b/unix/dev-env.sh @@ -0,0 +1,36 @@ +#!/bin/bash +# Development environment setup script for machine-stats +# Run this script with: source dev-env.sh + +echo "Setting up development environment for machine-stats..." + +# Initialize pyenv +eval "$(pyenv init -)" + +# Check if we're using the correct Python version +current_version=$(python --version 2>&1 | cut -d' ' -f2) +expected_version="3.11.13" + +if [[ "$current_version" == "$expected_version" ]]; then + echo "✓ Using Python $current_version" +else + echo "⚠ Python version mismatch. Expected $expected_version, got $current_version" + echo "Setting local Python version to $expected_version..." + pyenv local $expected_version +fi + +# Verify machine-stats is installed in development mode +if pip list | grep -q "machine_stats.*dev0.*$(pwd)"; then + echo "✓ machine-stats is installed in development mode" +else + echo "⚠ machine-stats not found in development mode. Installing..." + pip install -e . +fi + +echo "✓ Development environment ready!" +echo "" +echo "You can now use:" +echo " machine-stats --help" +echo " machine_stats --help" +echo "" +echo "Any changes you make to the source code will be immediately reflected." \ No newline at end of file diff --git a/unix/setup.py b/unix/setup.py index 5bfb931..fa517d6 100644 --- a/unix/setup.py +++ b/unix/setup.py @@ -5,7 +5,7 @@ setup( name="machine_stats", - version="develop", + version="0.0.1.dev0", author="Tidal SW", author_email="support@tidalcloud.com", description="A simple and effective way to gather machine statistics (RAM, Storage, CPU, etc.) from server environment", @@ -19,6 +19,23 @@ "ansible<2.10", "pluginbase==1.0.1", ], + python_requires=">=3.6,<3.12", + classifiers=[ + "Development Status :: 4 - Beta", + "Intended Audience :: System Administrators", + "License :: OSI Approved :: MIT License", + "Operating System :: POSIX :: Linux", + "Operating System :: Unix", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.6", + "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Topic :: System :: Systems Administration", + "Topic :: System :: Monitoring", + ], entry_points={ "console_scripts": [ "machine_stats=machine_stats:main", From f288a1a5cece9fa0d699e6e3e1497de9e9d88285 Mon Sep 17 00:00:00 2001 From: Prem Rara
Date: Wed, 2 Jul 2025 14:17:45 -0400 Subject: [PATCH 2/2] fix(dev-env): update machine-stats installation check in dev-env.sh - Change the verification method for machine-stats installation from pip list to pip show for improved accuracy. --- unix/dev-env.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/unix/dev-env.sh b/unix/dev-env.sh index e9627f4..79cba3f 100755 --- a/unix/dev-env.sh +++ b/unix/dev-env.sh @@ -20,7 +20,7 @@ else fi # Verify machine-stats is installed in development mode -if pip list | grep -q "machine_stats.*dev0.*$(pwd)"; then +if pip show machine-stats | grep -q "Location: $(pwd)"; then echo "✓ machine-stats is installed in development mode" else echo "⚠ machine-stats not found in development mode. Installing..."