Skip to content

Commit ff90f5d

Browse files
committed
Ship modular split, LLM control-surface upgrades, and publish-ready docs
1 parent 4b92ae1 commit ff90f5d

99 files changed

Lines changed: 17647 additions & 2473 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/ci.yml

Lines changed: 89 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@ on:
77
branches: [ main, master ]
88
pull_request:
99
workflow_dispatch:
10+
inputs:
11+
run_integration:
12+
description: "Run integration tests (live network/browser)"
13+
required: false
14+
default: false
15+
type: boolean
1016

1117
concurrency:
1218
group: ${{ github.workflow }}-${{ github.ref }}
@@ -50,12 +56,14 @@ jobs:
5056
- name: Ruff lint
5157
run: ruff check src
5258

53-
# - name: Mypy type-check
54-
# run: mypy src/web_scraper_toolkit
55-
# continue-on-error: true # Strict typing is a work in progress
59+
- name: Mypy type-check
60+
run: mypy
5661

5762
- name: Run tests
58-
run: pytest -q
63+
run: pytest -q -m "not integration"
64+
65+
- name: Workspace hygiene dry run
66+
run: python scripts/clean_workspace.py --dry-run
5967

6068
- name: Build sdist and wheel
6169
run: python -m build
@@ -67,3 +75,80 @@ jobs:
6775
run: |
6876
python -m pip install --force-reinstall dist/*.whl
6977
python -c "import web_scraper_toolkit, subprocess, sys; print('Toolkit version:', getattr(web_scraper_toolkit, '__version__', 'unknown')); subprocess.run(['web-scraper', '--help'], check=True)"
78+
79+
security:
80+
name: security gates
81+
runs-on: ubuntu-latest
82+
env:
83+
PIP_DISABLE_PIP_VERSION_CHECK: "1"
84+
steps:
85+
- name: Checkout
86+
uses: actions/checkout@v4
87+
88+
- name: Set up Python 3.12
89+
uses: actions/setup-python@v5
90+
with:
91+
python-version: "3.12"
92+
cache: "pip"
93+
94+
- name: Upgrade pip
95+
run: python -m pip install -U pip
96+
97+
- name: Install security tooling
98+
run: python -m pip install -U bandit pip-audit
99+
100+
- name: Run Bandit (high severity only)
101+
run: python -m bandit -q -r src/web_scraper_toolkit -lll -iii
102+
103+
- name: Build dependency audit requirements
104+
run: |
105+
python - <<'PY'
106+
import pathlib
107+
import tomllib
108+
109+
pyproject = pathlib.Path("pyproject.toml")
110+
data = tomllib.loads(pyproject.read_text(encoding="utf-8"))
111+
deps = list(data.get("project", {}).get("dependencies", []))
112+
out = pathlib.Path(".audit-requirements.txt")
113+
out.write_text("\n".join(deps) + "\n", encoding="utf-8")
114+
print(out.read_text(encoding="utf-8"))
115+
PY
116+
117+
- name: Run pip-audit
118+
run: python -m pip_audit -r .audit-requirements.txt --strict
119+
120+
- name: Run Gitleaks secret scan
121+
uses: gitleaks/gitleaks-action@v2
122+
env:
123+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
124+
125+
integration:
126+
name: integration tests (manual)
127+
if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.run_integration == 'true' }}
128+
runs-on: ubuntu-latest
129+
env:
130+
PIP_DISABLE_PIP_VERSION_CHECK: "1"
131+
SKIP_CF_TEST: "0"
132+
steps:
133+
- name: Checkout
134+
uses: actions/checkout@v4
135+
136+
- name: Set up Python 3.12
137+
uses: actions/setup-python@v5
138+
with:
139+
python-version: "3.12"
140+
cache: "pip"
141+
142+
- name: Upgrade pip
143+
run: python -m pip install -U pip
144+
145+
- name: Install project and test tooling
146+
run: |
147+
python -m pip install -e .
148+
python -m pip install -U pytest pytest-asyncio
149+
150+
- name: Install Playwright browsers
151+
run: playwright install --with-deps chromium
152+
153+
- name: Run integration tests
154+
run: pytest -q -m integration

.github/workflows/publish.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,9 @@ jobs:
6262
6363
# Simple check or warn if static version in toml differs from git tag
6464
if built_ver != exp:
65-
print(f"WARNING: Built version {built_ver} != tag version {exp}")
66-
print("ensure pyproject.toml version matches your git tag!")
67-
# raise SystemExit(1) # Uncomment to enforce strict match logic
65+
print(f"ERROR: Built version {built_ver} != tag version {exp}")
66+
print("pyproject.toml version must match the release git tag.")
67+
raise SystemExit(1)
6868
else:
6969
print("Verified version:", built_ver)
7070
PY
@@ -75,4 +75,4 @@ jobs:
7575
- name: Publish to PyPI (Trusted Publishing)
7676
uses: pypa/gh-action-pypi-publish@release/v1
7777
with:
78-
verbose: true
78+
verbose: true

.gitignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,13 @@ debug_*.html
8787
debug_*.png
8888
proxy_account_config.json
8989
socks5_proxies.json
90+
cache/
91+
sessions/
92+
scripts/out/
93+
scripts/*.log
94+
scripts/results*.txt
95+
host_profiles.json
96+
config.json
9097
settings.cfg
9198
settings.local.cfg
9299
*.local.cfg

0 commit comments

Comments
 (0)