File tree Expand file tree Collapse file tree 4 files changed +32
-12
lines changed
Expand file tree Collapse file tree 4 files changed +32
-12
lines changed Original file line number Diff line number Diff line change @@ -4,7 +4,9 @@ name: Code Quality Check
44permissions :
55 contents : read
66
7- on : [pull_request]
7+ on :
8+ - pull_request
9+ - workflow_dispatch
810
911jobs :
1012 pre-commit :
@@ -13,11 +15,10 @@ jobs:
1315
1416 steps :
1517 - uses : actions/checkout@v3
16- - name : setup environment
17- run : |
18- ./dev-setup.sh
19- - name : run pre-commit hooks
18+ - name : setup environment and run pre-commit hooks
19+ shell : bash
2020 run : |
21+ source ./dev-setup.sh
2122 pre-commit run --all-files --show-diff-on-failure --color=always
2223 - name : Print message on failure
2324 if : failure()
Original file line number Diff line number Diff line change @@ -17,19 +17,16 @@ jobs:
1717 steps :
1818 - uses : actions/checkout@v3
1919
20- - name : Install package
21- run : |
22- ./dev-setup.sh
23-
2420 - name : Install xmllint
2521 run : |
2622 apt-get update
2723 apt-get install -y libxml2-utils bc
2824
29-
30- - name : Run unit tests with coverage
25+ - name : Install package and run unit tests with coverage
3126 id : extract_coverage
27+ shell : bash
3228 run : |
29+ source ./dev-setup.sh
3330 pytest test/unit -s --cov=nodescraper --cov-report=xml --cov-report=term --cov-fail-under=70 --maxfail=1 --disable-warnings -v
3431
3532 - name : Print coverage
Original file line number Diff line number Diff line change @@ -32,6 +32,27 @@ a python virtual environment and also configures the pre-commit hooks for the pr
3232source dev-setup.sh
3333```
3434
35+ Alternatively, follow these manual steps:
36+
37+ ### 1. Virtual Environment (Optional)
38+ ``` sh
39+ python3 -m venv venv
40+ source venv/bin/activate
41+ ```
42+ On Debian/Ubuntu, you may need: ` sudo apt install python3-venv `
43+
44+ ### 2. Install from Source (Required)
45+ ``` sh
46+ python3 -m pip install --editable .[dev] --upgrade
47+ ```
48+ This installs Node Scraper in editable mode with development dependencies. To verify: ` node-scraper --help `
49+
50+ ### 3. Git Hooks (Optional)
51+ ``` sh
52+ pre-commit install
53+ ```
54+ Sets up pre-commit hooks for code quality checks. On Debian/Ubuntu, you may need: ` sudo apt install pre-commit `
55+
3556## CLI Usage
3657The Node Scraper CLI can be used to run Node Scraper plugins on a target system. The following CLI
3758options are available:
Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+
13# Create venv if not already present
24if [ ! -d " venv" ]; then
3- python3 -m pip install venv
45 python3 -m venv venv
56fi
67
You can’t perform that action at this time.
0 commit comments