Migrate to Poetry packaging and restructure codebase #21

Merged
Sudo-Ivan merged 23 commits from codebase-improvements into master 2025-12-01 18:24:25 +00:00
Showing only changes of commit 5627ae1640 - Show all commits

View File

@@ -1,13 +1,30 @@
#!/bin/bash
coderabbitai[bot] commented 2025-12-01 06:13:58 +00:00 (Migrated from github.com)
Review

⚠️ Potential issue | 🟠 Major

Hardcoded version will break on version bumps.

The wheel path contains a hardcoded version 2.41.0. This will fail when the version changes via sync_version.py.

Consider using a glob pattern or dynamically reading the version:

-WHEEL_PATH="python-dist/reticulum_meshchatx-2.41.0-py3-none-any.whl"
+WHEEL_PATH=$(ls python-dist/reticulum_meshchatx-*.whl 2>/dev/null | head -1)
+
+if [ -z "$WHEEL_PATH" ]; then
+    echo "Error: No wheel found in python-dist/"
+    exit 1
+fi
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

WHEEL_PATH=$(ls python-dist/reticulum_meshchatx-*.whl 2>/dev/null | head -1)

if [ -z "$WHEEL_PATH" ]; then
    echo "Error: No wheel found in python-dist/"
    exit 1
fi
🤖 Prompt for AI Agents
In scripts/test_wheel.sh around line 4, the WHEEL_PATH is hardcoded to
"python-dist/reticulum_meshchatx-2.41.0-py3-none-any.whl" which will break when
the package version changes; update the script to determine the wheel path
dynamically (either use a glob like
python-dist/reticulum_meshchatx-*-py3-none-any.whl and pick the single match
with proper error handling, or read the current version produced by
sync_version.py / pyproject metadata and construct the filename from that) and
add checks to fail with a clear error if zero or multiple matches are found.

Addressed in commits ac839df to c98131f

_⚠️ Potential issue_ | _🟠 Major_ **Hardcoded version will break on version bumps.** The wheel path contains a hardcoded version `2.41.0`. This will fail when the version changes via `sync_version.py`. Consider using a glob pattern or dynamically reading the version: ```diff -WHEEL_PATH="python-dist/reticulum_meshchatx-2.41.0-py3-none-any.whl" +WHEEL_PATH=$(ls python-dist/reticulum_meshchatx-*.whl 2>/dev/null | head -1) + +if [ -z "$WHEEL_PATH" ]; then + echo "Error: No wheel found in python-dist/" + exit 1 +fi ``` <!-- suggestion_start --> <details> <summary>📝 Committable suggestion</summary> > ‼️ **IMPORTANT** > Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements. ```suggestion WHEEL_PATH=$(ls python-dist/reticulum_meshchatx-*.whl 2>/dev/null | head -1) if [ -z "$WHEEL_PATH" ]; then echo "Error: No wheel found in python-dist/" exit 1 fi ``` </details> <!-- suggestion_end --> <details> <summary>🤖 Prompt for AI Agents</summary> ``` In scripts/test_wheel.sh around line 4, the WHEEL_PATH is hardcoded to "python-dist/reticulum_meshchatx-2.41.0-py3-none-any.whl" which will break when the package version changes; update the script to determine the wheel path dynamically (either use a glob like python-dist/reticulum_meshchatx-*-py3-none-any.whl and pick the single match with proper error handling, or read the current version produced by sync_version.py / pyproject metadata and construct the filename from that) and add checks to fail with a clear error if zero or multiple matches are found. ``` </details> <!-- fingerprinting:phantom:medusa:ocelot --> <!-- This is an auto-generated comment by CodeRabbit --> ✅ Addressed in commits ac839df to c98131f
set -e
WHEEL_PATH="python-dist/reticulum_meshchatx-2.41.0-py3-none-any.whl"
# Find wheel file dynamically
WHEEL_PATTERN="python-dist/reticulum_meshchatx-*-py3-none-any.whl"
WHEEL_FILES=($WHEEL_PATTERN)
if [ ${#WHEEL_FILES[@]} -eq 0 ]; then
echo "Error: No wheel files found matching pattern: $WHEEL_PATTERN"
echo "Make sure to run 'poetry build' or similar to create the wheel first."
exit 1
elif [ ${#WHEEL_FILES[@]} -gt 1 ]; then
echo "Error: Multiple wheel files found:"
printf ' %s\n' "${WHEEL_FILES[@]}"
echo "Please clean up old wheels or specify which one to use."
exit 1
fi
WHEEL_PATH="${WHEEL_FILES[0]}"
if [ ! -f "$WHEEL_PATH" ]; then
echo "Error: Wheel not found at $WHEEL_PATH"
exit 1
fi
echo "Found wheel: $WHEEL_PATH"
echo "Creating test virtual environment..."
TEST_VENV=$(mktemp -d)/test-venv
python3 -m venv "$TEST_VENV"