Skip to content

Commit 0b38258

Browse files
domenicsideshowbarker
authored andcommitted
Remove Python-based search-index postprocessing
Introduced in whatwg#114, this script was a good stopgap for getting dev-edition search working again. However, as of whatwg/wattsi#56, we were able to get Wattsi to output the search-index.json file while it was doing all its other processing, so this is no longer necessary. That frees us from the Python dependency and increases the build speed.
1 parent 28c90f0 commit 0b38258

File tree

4 files changed

+1
-99
lines changed

4 files changed

+1
-99
lines changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ FROM debian:sid
44
## enable some apache mods (the ln -s lines)
55
## cleanup freepascal since it is no longer needed after wattsi build
66
RUN apt-get update && \
7-
apt-get install -y ca-certificates curl git unzip fp-compiler-3.0.0 apache2 python python-dev python-virtualenv && \
7+
apt-get install -y ca-certificates curl git unzip fp-compiler-3.0.0 apache2 && \
88
cd /etc/apache2/mods-enabled && \
99
ln -s ../mods-available/headers.load && \
1010
ln -s ../mods-available/expires.load && \

README.md

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,6 @@ To build locally, you'll need the following commands installed on your system:
2222

2323
- `curl`, `grep`, `perl`, `unzip`
2424

25-
Additionally, unless you use the `--no-post` flag, you'll need the following:
26-
27-
- `python`, `virtualenv`
28-
- Various dev dependencies usually provided by the `python-dev` package
29-
3025
Optionally, for faster builds, you can install [Wattsi](https://github.com/whatwg/wattsi). If you don't bother with that, the build will use [Wattsi Server](https://github.com/domenic/wattsi-server), which requires an internet connection.
3126

3227
### Running the build

build.sh

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ cd "$( dirname "${BASH_SOURCE[0]}" )"
77
DIR=$(pwd)
88

99
DO_UPDATE=true
10-
DO_POST=true
1110
USE_DOCKER=false
1211
VERBOSE=false
1312
QUIET=false
@@ -40,7 +39,6 @@ do
4039
echo " -c|--clean Remove downloaded dependencies and generated files (then stop)."
4140
echo " -h|--help Show this usage statement."
4241
echo " -n|--no-update Don't update before building; just build."
43-
echo " -p|--no-post Don't perform potentially-slow postprocessing."
4442
echo " -d|--docker Use Docker to build in and serve from a container."
4543
echo " -q|--quiet Don't emit any messages except errors/warnings."
4644
echo " -v|--verbose Show verbose output from every build step."
@@ -49,9 +47,6 @@ do
4947
-n|--no-update|--no-updates)
5048
DO_UPDATE=false
5149
;;
52-
-p|--no-post)
53-
DO_POST=false
54-
;;
5550
-d|--docker)
5651
USE_DOCKER=true
5752
;;
@@ -432,28 +427,6 @@ fi
432427

433428
perl .post-process-partial-backlink-generator.pl "$HTML_TEMP/wattsi-output/index-html" > "$HTML_OUTPUT/index.html";
434429

435-
if [[ "$DO_POST" == true && ("$DO_UPDATE" == true || ! -f "$HTML_CACHE/seach-index.json") ]]; then
436-
$QUIET || echo "Performing Python-based postprocessing for DEV variant..."
437-
438-
PYTHON_STUFF_ARGS="--quiet" # silence by default; this stuff is very noisy
439-
if $VERBOSE; then
440-
PYTHON_STUFF_ARGS="--verbose"
441-
fi
442-
443-
virtualenv "$HTML_CACHE/python-env" "$PYTHON_STUFF_ARGS"
444-
# Shellcheck doesn't know about the bin/activate created by virtualenv:
445-
# shellcheck disable=SC1090
446-
if [[ -f "$HTML_CACHE/python-env/bin/activate" ]]; then
447-
source "$HTML_CACHE/python-env/bin/activate"
448-
else
449-
# Windows virtualenv seems to be gratuitously different
450-
source "$HTML_CACHE/python-env/Scripts/activate"
451-
fi
452-
pip install lxml cssselect "$PYTHON_STUFF_ARGS"
453-
python ./search-index.py -i "$HTML_TEMP/wattsi-output/multipage-dev/index.html" -o "$HTML_CACHE/search-index.json"
454-
deactivate
455-
fi
456-
457430
cp -p entities/out/entities.json "$HTML_OUTPUT"
458431
cp -p "$HTML_TEMP/wattsi-output/xrefs.json" "$HTML_OUTPUT"
459432

@@ -472,7 +445,5 @@ cp -pR "$HTML_SOURCE/images" "$HTML_OUTPUT"
472445
cp -pR "$HTML_SOURCE/demos" "$HTML_OUTPUT"
473446
cp -pR "$HTML_SOURCE/dev" "$HTML_OUTPUT"
474447

475-
"$DO_POST" == true && cp -p "$HTML_CACHE/search-index.json" "$HTML_OUTPUT/dev"
476-
477448
$QUIET || echo
478449
$QUIET || echo "Success!"

search-index.py

Lines changed: 0 additions & 64 deletions
This file was deleted.

0 commit comments

Comments
 (0)