From b3d2c6dbe1dd2ffc831f544a8466417192cc09dc Mon Sep 17 00:00:00 2001 From: Pavel Date: Fri, 24 Apr 2026 15:12:19 +0200 Subject: [PATCH 1/3] docs: better instructions for Windows (bash) --- CONTRIBUTING.md | 41 +++++++++++++++++++++++++---------------- 1 file changed, 25 insertions(+), 16 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 930d8a966e..590cf39229 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -5,7 +5,7 @@ This guide covers how to contribute to the Prowlarr Indexers repository, includi ## Prerequisites > [!IMPORTANT] -> **Python 3.11 or higher** is required - must be installed and accessible via `python3` command +> **Python 3.11 or higher** is required - must be installed and accessible via `python3` command (alternatively `python` command if it points to Python 3) - Git - Basic understanding of YAML and JSON Schema @@ -13,20 +13,29 @@ This guide covers how to contribute to the Prowlarr Indexers repository, includi ## Setup 1. Fork and clone the repository: -```bash -git clone https://github.com/YOUR_USERNAME/Indexers.git -cd Indexers -``` + ```bash + git clone https://github.com/YOUR_USERNAME/Indexers.git + cd Indexers + ``` 2. Set up Python environment: -```bash -# Create virtual environment (recommended) -python3 -m venv .venv -source .venv/bin/activate + (on Linux/Mac) + ```bash + # Create virtual environment (recommended) + python3 -m venv .venv + source .venv/bin/activate + ``` + (or on Windows) + ```bash + # Create virtual environment (recommended) + python -m venv .venv + source .venv/Scripts/activate + ``` -# Install dependencies -pip install -r requirements.txt -``` +3. Install dependencies: + ```bash + pip install -r requirements.txt + ``` ## Script Commands @@ -208,7 +217,7 @@ The repository uses several automated workflows to ensure code quality: - **Tools**: `yamllint` with GitHub annotations - **Runs**: On every change to definition files -#### 2. Python Validation (`python-validation.yml`) +#### 2. Python Validation (`python-validation.yml`) - **Triggers**: Push/PR to `master` on Python files in `scripts/` or `requirements.txt` - **Purpose**: Validates Python script syntax and functionality - **Tools**: `py_compile` syntax checking @@ -222,7 +231,7 @@ The repository uses several automated workflows to ensure code quality: #### 4. Indexer Sync Automation (`indexer-sync.yml`) - **Schedule**: 3 times daily (2 AM, 10 AM, 6 PM UTC) - **Purpose**: Automatically syncs indexers from Jackett repository -- **Features**: +- **Features**: - Automated PR creation for updates - Manual trigger with debug options - Caching for performance (Python deps + Jackett data) @@ -285,13 +294,13 @@ We sync indexer definitions from [Jackett](https://github.com/Jackett/Jackett). ```bash # Create virtual environment (recommended) python -m venv .venv - + # Activate virtual environment # On Linux/Mac: source .venv/bin/activate # On Windows: source .venv/Scripts/activate - + # Install Python dependencies pip install -r requirements.txt ``` From d0f82a86c240336263ff1242fdca3ee3f87499db Mon Sep 17 00:00:00 2001 From: Pavel Date: Fri, 24 Apr 2026 15:20:03 +0200 Subject: [PATCH 2/3] fix: prefer .venv/Scripts/python.exe if it exists fixes this error on Windows: > ERROR|required python packages are missing. Install with: pip install -r requirements.txt --- scripts/indexer-sync-v2.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/indexer-sync-v2.sh b/scripts/indexer-sync-v2.sh index 1fe9505823..029420e979 100755 --- a/scripts/indexer-sync-v2.sh +++ b/scripts/indexer-sync-v2.sh @@ -245,7 +245,9 @@ initialize_script() { # Check for Python and virtual environment # Check for Python and determine command to use PYTHON_CMD="" - if command -v python3 &> /dev/null; then + if [ -f ".venv/Scripts/python.exe" ]; then + PYTHON_CMD=".venv/Scripts/python.exe" + elif command -v python3 &> /dev/null; then PYTHON_CMD="python3" elif command -v python &> /dev/null; then PYTHON_CMD="python" From fc6a349a5e31307cc017180de0dcb28b958af83c Mon Sep 17 00:00:00 2001 From: Pavel Date: Sat, 2 May 2026 19:33:56 +0200 Subject: [PATCH 3/3] Use '[[' instead of '[' for conditional tests. The '[[' construct is safer and more feature-rich See more on https://sonarcloud.io/project/issues?id=Prowlarr_Indexers&issues=AZ2_rA-n1rS-lU5QzC4f&open=AZ2_rA-n1rS-lU5QzC4f&pullRequest=879 --- scripts/indexer-sync-v2.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/indexer-sync-v2.sh b/scripts/indexer-sync-v2.sh index 029420e979..b5d1aef6fd 100755 --- a/scripts/indexer-sync-v2.sh +++ b/scripts/indexer-sync-v2.sh @@ -245,7 +245,7 @@ initialize_script() { # Check for Python and virtual environment # Check for Python and determine command to use PYTHON_CMD="" - if [ -f ".venv/Scripts/python.exe" ]; then + if [[ -f ".venv/Scripts/python.exe" ]]; then PYTHON_CMD=".venv/Scripts/python.exe" elif command -v python3 &> /dev/null; then PYTHON_CMD="python3"