-
Notifications
You must be signed in to change notification settings - Fork 33
Expand file tree
/
Copy pathMakefile
More file actions
105 lines (81 loc) · 4.29 KB
/
Copy pathMakefile
File metadata and controls
105 lines (81 loc) · 4.29 KB
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
-include .env
export
# Get current year dynamically
CURRENT_YEAR := $(shell date +%Y)
install:
uv sync
.PHONY: install
pre-commit-setup:
pre-commit install
.PHONY: pre-commit-setup
test:
uv run pytest tests/ --cov=lex --cov-report=term-missing
.PHONY: test
run:
uv run src/backend/main.py
.PHONY: run
# Pipeline data ingestion commands - SAMPLE (limited data for testing)
ingest-caselaw-sample:
docker compose exec pipeline uv run src/lex/main.py -m caselaw --non-interactive --years 2020-$(CURRENT_YEAR) --limit 50 --batch-size 20
.PHONY: ingest-caselaw-sample
ingest-caselaw-section-sample:
docker compose exec pipeline uv run src/lex/main.py -m caselaw-section --non-interactive --years 2020-$(CURRENT_YEAR) --limit 50
.PHONY: ingest-caselaw-section-sample
ingest-legislation-sample:
docker compose exec pipeline uv run src/lex/main.py -m legislation --non-interactive --types ukpga --years 2020-$(CURRENT_YEAR) --limit 50
.PHONY: ingest-legislation-sample
ingest-legislation-section-sample:
docker compose exec pipeline uv run src/lex/main.py -m legislation-section --non-interactive --types ukpga --years 2020-$(CURRENT_YEAR) --limit 50
.PHONY: ingest-legislation-section-sample
ingest-explanatory-note-sample:
docker compose exec pipeline uv run src/lex/main.py -m explanatory-note --non-interactive --types ukpga --years 2020-$(CURRENT_YEAR) --limit 50
.PHONY: ingest-explanatory-note-sample
ingest-amendment-sample:
docker compose exec pipeline uv run src/lex/main.py -m amendment --non-interactive --years 2020-$(CURRENT_YEAR) --limit 250
.PHONY: ingest-amendment-sample
# Ingest all sample data
ingest-all-sample: ingest-legislation-sample ingest-legislation-section-sample ingest-explanatory-note-sample ingest-amendment-sample ingest-caselaw-sample ingest-caselaw-section-sample
@echo "All sample data types have been ingested."
.PHONY: ingest-all-sample
# Pipeline data ingestion commands - FULL (all types, legislation from 1963, caselaw from 2001)
ingest-caselaw-full:
docker compose exec pipeline uv run src/lex/main.py -m caselaw --non-interactive --years 2001-$(CURRENT_YEAR) --batch-size 50
.PHONY: ingest-caselaw-full
ingest-caselaw-section-full:
docker compose exec pipeline uv run src/lex/main.py -m caselaw-section --non-interactive --years 2001-$(CURRENT_YEAR) --batch-size 50
.PHONY: ingest-caselaw-section-full
ingest-legislation-full:
docker compose exec pipeline uv run src/lex/main.py -m legislation --non-interactive --years 1963-$(CURRENT_YEAR) --batch-size 50
.PHONY: ingest-legislation-full
ingest-legislation-section-full:
docker compose exec pipeline uv run src/lex/main.py -m legislation-section --non-interactive --years 1963-$(CURRENT_YEAR) --batch-size 50
.PHONY: ingest-legislation-section-full
ingest-explanatory-note-full:
docker compose exec pipeline uv run src/lex/main.py -m explanatory-note --non-interactive --years 1963-$(CURRENT_YEAR) --batch-size 50
.PHONY: ingest-explanatory-note-full
ingest-amendment-full:
docker compose exec pipeline uv run src/lex/main.py -m amendment --non-interactive --years 1963-$(CURRENT_YEAR) --batch-size 50
.PHONY: ingest-amendment-full
# Ingest all full data
ingest-all-full: ingest-legislation-full ingest-legislation-section-full ingest-explanatory-note-full ingest-amendment-full ingest-caselaw-full ingest-caselaw-section-full
@echo "All full data types have been ingested."
.PHONY: ingest-all-full
# Pipeline data ingestion commands - HISTORICAL (pre-1963 legislation using regnal year numbering)
# Uses Atom feed discovery with year-level caching for efficiency
ingest-legislation-section-historical:
docker compose exec pipeline uv run src/lex/main.py -m legislation-section --non-interactive --years 1267-1962 --batch-size 50
.PHONY: ingest-legislation-section-historical
# Ingest complete legislation dataset (1267 to present)
ingest-legislation-section-complete:
docker compose exec pipeline uv run src/lex/main.py -m legislation-section --non-interactive --years 1267-$(CURRENT_YEAR) --batch-size 50
.PHONY: ingest-legislation-section-complete
# Start Docker environment
docker-up:
@echo "Starting Docker environment..."
docker compose up -d
@echo "Ready to ingest data. Run 'make ingest-all-sample' for sample data or 'make ingest-all-full' for full data."
.PHONY: docker-up
# Stop Docker environment
docker-down:
docker compose down
.PHONY: docker-down