diff --git a/README.md b/README.md index f0b15270..c020fdd1 100644 --- a/README.md +++ b/README.md @@ -32,6 +32,27 @@ a python virtual environment and also configures the pre-commit hooks for the pr source dev-setup.sh ``` +Alternatively, follow these manual steps: + +### 1. Virtual Environment (Optional) +```sh +python3 -m venv venv +source venv/bin/activate +``` +On Debian/Ubuntu, you may need: `sudo apt install python3-venv` + +### 2. Install from Source (Required) +```sh +python3 -m pip install --editable .[dev] --upgrade +``` +This installs Node Scraper in editable mode with development dependencies. To verify: `node-scraper --help` + +### 3. Git Hooks (Optional) +```sh +pre-commit install +``` +Sets up pre-commit hooks for code quality checks. On Debian/Ubuntu, you may need: `sudo apt install pre-commit` + ## CLI Usage The Node Scraper CLI can be used to run Node Scraper plugins on a target system. The following CLI options are available: diff --git a/dev-setup.sh b/dev-setup.sh index 7cafc606..fff7804d 100755 --- a/dev-setup.sh +++ b/dev-setup.sh @@ -1,12 +1,17 @@ -# Create venv if not already present +#!/bin/bash + +# Create venv if not present if [ ! -d "venv" ]; then - python3 -m pip install venv - python3 -m venv venv + python3 -m venv venv || { echo "Failed to create venv. Try: sudo apt install python3-venv"; exit 1; } fi # Activate the desired venv source venv/bin/activate +# Install package python3 -m pip install --editable .[dev] --upgrade -pre-commit install +# Install pre-commit hooks if available +if command -v pre-commit &> /dev/null; then + pre-commit install +fi