Skip to content

feat(unix): add Python version constraints and development environment #276

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions unix/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ Get familiar with Machine Stats, Tidal Tools and Tidal Accelerator!

[![Open in Cloud Shell](https://gstatic.com/cloudssh/images/open-btn.svg)](https://ssh.cloud.google.com/cloudshell/editor?cloudshell_git_repo=https%3A%2F%2Fgithub.51.al%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:
Expand Down
36 changes: 36 additions & 0 deletions unix/dev-env.sh
Original file line number Diff line number Diff line change
@@ -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 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..."
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."
19 changes: 18 additions & 1 deletion unix/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand Down