-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
38 lines (31 loc) · 1.28 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
SHELL := /bin/bash
petrol-si.osm: requirements petrol-si-scraped.json
# run the conflate of scraped json in the virtual environment with all the requirements met
source venv/bin/activate; \
conflate petrol-si-profile.py --source petrol-si-scraped.json -o petrol-si.osm --osc --osm existingdata.osm --changes petrol-si-changes.geojson --verbose
petrol-si-scraped.json: requirements
# run the web page scraping in the virtual environment with all the requirements met
source venv/bin/activate; \
python scrape-petrol.py petrol-si-scraped.json
requirements: requirements.txt.out
# install requirements if requirements.txt.out is missing or older than requirements.txt
requirements.txt.out: venv requirements.txt
# install the requirements into virtual environments and record the action to requirements.txt.out
source venv/bin/activate && pip install -r requirements.txt | tee requirements.txt.out
venv:
# basic setup
pip install virtualenv
virtualenv -p `which python3` venv
test: petrol-si-scraped.json
wc -l petrol-si-scraped.json
clean:
# clean up all generated artefacts
rm -f existingdata.osm
rm -f requirements.txt.out
# rm -f webcache.sqlite
rm -rf venv
rm -f *.pyc
rm -f petrol-si-scraped.json
rm -f petrol-si.osm
rm -f existingdata.osm
rm -f petrol-si-changes.geojson