From 2292d5360f757e292c1afa39f4a23e0843461992 Mon Sep 17 00:00:00 2001 From: Marius S <39998+winding-lines@users.noreply.github.com> Date: Wed, 18 Nov 2026 05:59:18 -0800 Subject: [PATCH] customs v0.4.0: no unused imports customs v0.4.0 adds unused-import. 81 unused imports removed; the seven shims that only pass names on (morca.cli, handover, pressure, sqlite_store, state, _internal.batches, _internal.live) become packages, with the same import paths. Co-Authored-By: Claude Opus 5.5 --- .github/workflows/ci.yml | 2 +- examples/taxi/taxi.mojo | 1 - src/morca/_cli.mojo | 1 - src/morca/_internal/actions.mojo | 2 +- src/morca/_internal/aws_replace.mojo | 2 +- src/morca/_internal/{batches.mojo => batches/__init__.mojo} | 0 src/morca/_internal/config_show.mojo | 1 - src/morca/_internal/db/starting.mojo | 2 +- src/morca/_internal/fleet.mojo | 3 +-- src/morca/_internal/follow.mojo | 4 +--- src/morca/_internal/handover.mojo | 1 - src/morca/_internal/http_store.mojo | 2 -- src/morca/_internal/instances.mojo | 1 - src/morca/_internal/lineage.mojo | 1 - src/morca/_internal/{live.mojo => live/__init__.mojo} | 0 src/morca/_internal/queueing.mojo | 1 - src/morca/_internal/registering.mojo | 1 - src/morca/_internal/run_cluster.mojo | 1 - src/morca/_internal/sample.mojo | 2 -- src/morca/_internal/scheduler.mojo | 1 - src/morca/_internal/sqlite_store.mojo | 3 +-- src/morca/_internal/starting.mojo | 1 - src/morca/_internal/state.mojo | 6 +----- src/morca/_internal/system.mojo | 2 +- src/morca/_internal/ui/data.mojo | 2 +- src/morca/_internal/ui/layout.mojo | 1 - src/morca/_internal/ui/ops.mojo | 2 -- src/morca/_internal/ui/pipeline.mojo | 1 - src/morca/_internal/ui/runs.mojo | 2 -- src/morca/_internal/usage.mojo | 1 - src/morca/_internal/views/data.mojo | 3 +-- src/morca/_internal/views/pipelines.mojo | 1 - src/morca/_internal/views/recent.mojo | 1 - src/morca/_internal/views/runs.mojo | 3 +-- src/morca/_internal/worker.mojo | 1 - src/morca/_internal/workers.mojo | 5 ++--- src/morca/_lake/batch.mojo | 3 --- src/morca/_lake/calls.mojo | 2 +- src/morca/_lake/impl.mojo | 2 -- src/morca/_lake/lib.mojo | 4 +--- src/morca/{cli.mojo => cli/__init__.mojo} | 0 src/morca/{handover.mojo => handover/__init__.mojo} | 0 src/morca/{pressure.mojo => pressure/__init__.mojo} | 0 src/morca/{sqlite_store.mojo => sqlite_store/__init__.mojo} | 0 src/morca/{state.mojo => state/__init__.mojo} | 0 src/morca/tasks.mojo | 2 +- tests/compile_fail/duplicate_name.mojo | 2 +- tests/compile_fail/edge_mismatch.mojo | 2 +- tests/compile_fail/first_gather_not_seq.mojo | 2 +- tests/compile_fail/first_not_key.mojo | 2 +- tests/compile_fail/month_under_daily.mojo | 2 +- tests/compile_fail/not_in_pipeline.mojo | 2 +- tests/compile_fail/out_of_order.mojo | 2 +- tests/compile_fail/same_name_other_step.mojo | 2 +- tests/sensors/other.mojo | 2 +- tests/store_suite.mojo | 1 - tests/test_graph.mojo | 2 +- tests/test_hcloud.mojo | 1 - tests/test_store.mojo | 1 - tests/test_tasks.mojo | 3 +-- tests/test_usage.mojo | 1 - 61 files changed, 28 insertions(+), 76 deletions(-) rename src/morca/_internal/{batches.mojo => batches/__init__.mojo} (100%) rename src/morca/_internal/{live.mojo => live/__init__.mojo} (100%) rename src/morca/{cli.mojo => cli/__init__.mojo} (100%) rename src/morca/{handover.mojo => handover/__init__.mojo} (100%) rename src/morca/{pressure.mojo => pressure/__init__.mojo} (100%) rename src/morca/{sqlite_store.mojo => sqlite_store/__init__.mojo} (100%) rename src/morca/{state.mojo => state/__init__.mojo} (100%) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bd53c0c9..f106ed09 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -903,7 +903,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: magmalake/customs@v0.3.1 + - uses: magmalake/customs@v0.4.0 # And the packages as layers: `_internal` imports no public module # that imports `_internal` back (AGENTS.md). - run: python3 scripts/check_layers.py diff --git a/examples/taxi/taxi.mojo b/examples/taxi/taxi.mojo index 8bca7a65..ed6f7373 100644 --- a/examples/taxi/taxi.mojo +++ b/examples/taxi/taxi.mojo @@ -43,7 +43,6 @@ later. from std.os import getenv, setenv from dista import Seq -from parquet import RecordBatch from morca import ( Cron, diff --git a/src/morca/_cli.mojo b/src/morca/_cli.mojo index b176960d..0ea2377c 100644 --- a/src/morca/_cli.mojo +++ b/src/morca/_cli.mojo @@ -80,7 +80,6 @@ from morca._internal.state import PgStore from morca._internal.store import ( CANCELLED, DEFERRED, - FAILED, RUNNING, SUCCEEDED, MemoryStore, diff --git a/src/morca/_internal/actions.mojo b/src/morca/_internal/actions.mojo index d5c23cfc..849f4c1e 100644 --- a/src/morca/_internal/actions.mojo +++ b/src/morca/_internal/actions.mojo @@ -20,7 +20,7 @@ from std.os import getenv import morca._internal.db.actions as actions_db import morca._internal.db.starting as starting_db -from morca._internal.db.live import live_runs, stale_seconds, stalled_sql +from morca._internal.db.live import live_runs from morca.name import parse_names from morca._internal.pause import set_paused from morca._internal.queueing import ( diff --git a/src/morca/_internal/aws_replace.mojo b/src/morca/_internal/aws_replace.mojo index 1cfc61f8..1d3b1084 100644 --- a/src/morca/_internal/aws_replace.mojo +++ b/src/morca/_internal/aws_replace.mojo @@ -49,7 +49,7 @@ one (started again), the Elastic IP moved back, and the new slot off. stay paused throughout: unpause them once it's done. """ -from std.os import getenv, remove +from std.os import getenv from std.os.path import exists from std.time import sleep diff --git a/src/morca/_internal/batches.mojo b/src/morca/_internal/batches/__init__.mojo similarity index 100% rename from src/morca/_internal/batches.mojo rename to src/morca/_internal/batches/__init__.mojo diff --git a/src/morca/_internal/config_show.mojo b/src/morca/_internal/config_show.mojo index c0728e2d..bd56af76 100644 --- a/src/morca/_internal/config_show.mojo +++ b/src/morca/_internal/config_show.mojo @@ -38,7 +38,6 @@ from morca._internal.config import ( FROM_FLAG, Setting, flag_of, - max_runs_auto, max_runs_text, parse_env, ) diff --git a/src/morca/_internal/db/starting.mojo b/src/morca/_internal/db/starting.mojo index e537697d..16edc9f8 100644 --- a/src/morca/_internal/db/starting.mojo +++ b/src/morca/_internal/db/starting.mojo @@ -6,7 +6,7 @@ for a run whose process died, with the stale limit as the parameter from postgres import Connection, Params, Transaction, is_retryable, sqlstate_of -from morca._internal.db.live import behind_sql, ordered_runs +from morca._internal.db.live import behind_sql from morca._internal.db.scheduler import RETRIED diff --git a/src/morca/_internal/fleet.mojo b/src/morca/_internal/fleet.mojo index 6aeebd74..6135d320 100644 --- a/src/morca/_internal/fleet.mojo +++ b/src/morca/_internal/fleet.mojo @@ -35,11 +35,10 @@ from std.os import getenv from json import Value, loads import morca._internal.db.fleet as fleet_db -from morca._internal.html import Html, escape, url_encode +from morca._internal.html import Html, escape from morca._internal.json import quote from morca._internal.db.live import stale_limit, start_grace from morca._internal.logs import read_location -from morca._internal.metrics import bytes_text from morca._internal.sample import metrics_location from morca._internal.state import State diff --git a/src/morca/_internal/follow.mojo b/src/morca/_internal/follow.mojo index 7f3c7d56..4ca1f592 100644 --- a/src/morca/_internal/follow.mojo +++ b/src/morca/_internal/follow.mojo @@ -21,12 +21,10 @@ from std.collections import Dict import morca._internal.db.sensing as sensing_db -from morca._internal.calendar import Cell, states_of +from morca._internal.calendar import states_of from morca.civil import Civil, now -from morca.day import Day from morca._internal.estimate import Pace, pace from morca._internal.json import quote -from morca.month import Month from morca.name import sort_texts from morca._internal.sensors import key_kind, map_keys, split_keys from morca._internal.state import State diff --git a/src/morca/_internal/handover.mojo b/src/morca/_internal/handover.mojo index 982a6711..c04f0ec7 100644 --- a/src/morca/_internal/handover.mojo +++ b/src/morca/_internal/handover.mojo @@ -49,7 +49,6 @@ from postgres import Connection from threads import AtomicCounter, Mutex import morca._internal.db.handover as handover_db -from morca._internal.db.handover import differs_sql, label_sql, outdated_sql from morca._internal.source import source_commit, source_dirty diff --git a/src/morca/_internal/http_store.mojo b/src/morca/_internal/http_store.mojo index 392bf2da..f0001210 100644 --- a/src/morca/_internal/http_store.mojo +++ b/src/morca/_internal/http_store.mojo @@ -45,12 +45,10 @@ from morca._internal.handover import set_outdated from morca._internal.store import ( FINAL, Backoff, - Recorder, RunResult, RunStore, StepRun, SUCCEEDED, - Store, TableSnapshot, ) from morca._internal.db.run_rows import RunInfo, StepInfo, Usage diff --git a/src/morca/_internal/instances.mojo b/src/morca/_internal/instances.mojo index 47b9c177..b34787f7 100644 --- a/src/morca/_internal/instances.mojo +++ b/src/morca/_internal/instances.mojo @@ -21,7 +21,6 @@ from std.os import getenv from std.time import sleep import morca._internal.db.schedulers as schedulers_db -from morca._internal.db.schedulers import live_cond from morca._internal.db.live import stale_limit from morca._internal.migrations import known_migrations, migration_floor diff --git a/src/morca/_internal/lineage.mojo b/src/morca/_internal/lineage.mojo index af75c883..d4df961b 100644 --- a/src/morca/_internal/lineage.mojo +++ b/src/morca/_internal/lineage.mojo @@ -26,7 +26,6 @@ The same edges are in the snapshots' own summaries, as `orca.reads`. import morca._internal.db.lineage as lineage_db from morca._internal.db.lineage import ( - DEPTH, Commit, Dataset, Flow, diff --git a/src/morca/_internal/live.mojo b/src/morca/_internal/live/__init__.mojo similarity index 100% rename from src/morca/_internal/live.mojo rename to src/morca/_internal/live/__init__.mojo diff --git a/src/morca/_internal/queueing.mojo b/src/morca/_internal/queueing.mojo index 8372c2ad..47fb710e 100644 --- a/src/morca/_internal/queueing.mojo +++ b/src/morca/_internal/queueing.mojo @@ -8,7 +8,6 @@ from morca._internal.db.batches import mark_batch import morca._internal.db.queueing as queueing_db import morca._internal.db.starting as starting_db from morca._internal.db.live import live_runs -from morca._internal.db.queueing import APPENDING_SQL, DONE_SQL from morca._internal.timekeys import parse_time_keys from morca.name import ( Name, diff --git a/src/morca/_internal/registering.mojo b/src/morca/_internal/registering.mojo index ec6c7f53..0fd08888 100644 --- a/src/morca/_internal/registering.mojo +++ b/src/morca/_internal/registering.mojo @@ -45,7 +45,6 @@ from morca._internal.registered import ( repeated_fill, ) from morca._internal.queueing import ( - backfill, dataset_cycle, kind_mismatch, ) diff --git a/src/morca/_internal/run_cluster.mojo b/src/morca/_internal/run_cluster.mojo index 31f741c8..9c5074d3 100644 --- a/src/morca/_internal/run_cluster.mojo +++ b/src/morca/_internal/run_cluster.mojo @@ -27,7 +27,6 @@ TLS, and is never in a log or a page. from json import Value import morca._internal.db.run_cluster as cluster_db -from morca._internal.db.run_cluster import MEMBER_GRANTS_SQL, MEMBER_MB_SQL from morca._internal.http_store import Body from morca._internal.registered import registered, run_request diff --git a/src/morca/_internal/sample.mojo b/src/morca/_internal/sample.mojo index c253ecdd..35d4676d 100644 --- a/src/morca/_internal/sample.mojo +++ b/src/morca/_internal/sample.mojo @@ -81,10 +81,8 @@ one message, and it carries on: a sampler never fails a run. """ from std.ffi import c_int, external_call -from std.memory import stack_allocation from std.os import getenv, listdir, makedirs from std.os.path import exists -from std.sys import exit from std.sys.info import CompilationTarget from std.time import perf_counter_ns, sleep diff --git a/src/morca/_internal/scheduler.mojo b/src/morca/_internal/scheduler.mojo index 01c00dbf..1213c9b7 100644 --- a/src/morca/_internal/scheduler.mojo +++ b/src/morca/_internal/scheduler.mojo @@ -246,7 +246,6 @@ from morca._internal.pressure import ( pct_text, read_psi, ) -from morca._internal.recommend import learned from morca._internal.state import State from morca._internal.watchdog import ( check as check_watchdog, diff --git a/src/morca/_internal/sqlite_store.mojo b/src/morca/_internal/sqlite_store.mojo index 6a2e723c..dd200beb 100644 --- a/src/morca/_internal/sqlite_store.mojo +++ b/src/morca/_internal/sqlite_store.mojo @@ -46,7 +46,6 @@ from morca._internal.store import ( FINAL, INTERRUPTED, RUNNING, - SKIPPED, SUCCEEDED, Backoff, RunResult, @@ -55,7 +54,7 @@ from morca._internal.store import ( StepRun, TableSnapshot, ) -from morca._internal.db.run_rows import RunInfo, StepInfo, Usage +from morca._internal.db.run_rows import RunInfo, StepInfo comptime _BUSY_MS = 1000 """How long a write waits for another writer's lock before it fails (and, diff --git a/src/morca/_internal/starting.mojo b/src/morca/_internal/starting.mojo index 3153fec8..2560fbe8 100644 --- a/src/morca/_internal/starting.mojo +++ b/src/morca/_internal/starting.mojo @@ -32,7 +32,6 @@ from morca._internal.db.concurrency import FILLS, OTHERS from morca._internal.key_wait import key_room, started from morca._internal.kube import ( RunSpec, - cpu_millis, ) from morca._internal.logs import ( is_remote, diff --git a/src/morca/_internal/state.mojo b/src/morca/_internal/state.mojo index bbafa26f..244174d9 100644 --- a/src/morca/_internal/state.mojo +++ b/src/morca/_internal/state.mojo @@ -37,28 +37,24 @@ from morca._internal.migrations import ( known_migrations, schema_ahead, ) -from morca._internal.db.live import stale_limit from morca._internal.db.pipelines import set_version from morca._internal.db.schedulers import live_older from morca._internal.handover import run_outdated, set_outdated from morca._internal.store import ( - CANCELLED, DEFERRED, FINAL, FAILED, INTERRUPTED, Backoff, RUNNING, - SKIPPED, SUCCEEDED, RunResult, RunStore, status_list, StepRun, TableSnapshot, - process_owner, ) -from morca._internal.db.run_rows import RunInfo, StepInfo, Usage +from morca._internal.db.run_rows import RunInfo, StepInfo comptime _MIGRATION_LOCK = 0x6F726361 # "orca" diff --git a/src/morca/_internal/system.mojo b/src/morca/_internal/system.mojo index 82d008dc..95b1ee48 100644 --- a/src/morca/_internal/system.mojo +++ b/src/morca/_internal/system.mojo @@ -38,7 +38,7 @@ from morca._internal.db.system import Container, Minute from morca.civil import Civil from morca._internal.fleet import Series, Summary, _chart, _fixed -from morca._internal.html import Html, escape +from morca._internal.html import Html from morca._internal.json import quote from morca._internal.logs import ( is_remote, diff --git a/src/morca/_internal/ui/data.mojo b/src/morca/_internal/ui/data.mojo index 15940228..1ac47c68 100644 --- a/src/morca/_internal/ui/data.mojo +++ b/src/morca/_internal/ui/data.mojo @@ -18,7 +18,7 @@ from json import Value, loads from morca._internal.auth import login_required from morca._internal.dataset_config import dataset_public -from morca._internal.html import Html, query_param, url_encode +from morca._internal.html import Html, query_param from morca._internal.json import quote from morca._internal.lineage import datasets as dataset_rows from morca._internal.metrics import bytes_text diff --git a/src/morca/_internal/ui/layout.mojo b/src/morca/_internal/ui/layout.mojo index 69c5063d..ebfdc71e 100644 --- a/src/morca/_internal/ui/layout.mojo +++ b/src/morca/_internal/ui/layout.mojo @@ -8,7 +8,6 @@ buttons, and the 404 and 400 pages. from std.os import getenv from morca._internal.html import Html, escape -from morca._internal.json import quote from morca._internal.ui.loading import LOADING_JS from morca._internal.ui.step_cards import LEAD_JS, STEP_CARDS_JS from morca._internal.ui.terms import header_help diff --git a/src/morca/_internal/ui/ops.mojo b/src/morca/_internal/ui/ops.mojo index b0969956..eb558fbd 100644 --- a/src/morca/_internal/ui/ops.mojo +++ b/src/morca/_internal/ui/ops.mojo @@ -6,7 +6,6 @@ refreshes from; Alerts (`/ops/alerts`, where `/ops` goes) is Workers' old paths redirect to Pools (`moved`, `to_pools`). """ -from std.os import getenv from morca._internal.admission import ( pressure_html, @@ -44,7 +43,6 @@ from morca._internal.watchdog import ( config as watchdog_config, prometheus as watchdog_prometheus, rule_rows, - trips_json, watchdog_html, watchdog_json, ) diff --git a/src/morca/_internal/ui/pipeline.mojo b/src/morca/_internal/ui/pipeline.mojo index 43c067e1..887d63e4 100644 --- a/src/morca/_internal/ui/pipeline.mojo +++ b/src/morca/_internal/ui/pipeline.mojo @@ -40,7 +40,6 @@ from morca._internal.ui.pipeline_data import pipeline_data_html from morca._internal.ui.parts import ( CPU_HELP, PEAK_HELP, - dataset_links, datasets_with_data, named_code_link, pause_button, diff --git a/src/morca/_internal/ui/runs.mojo b/src/morca/_internal/ui/runs.mojo index 4dfa96ce..84556d8d 100644 --- a/src/morca/_internal/ui/runs.mojo +++ b/src/morca/_internal/ui/runs.mojo @@ -14,7 +14,6 @@ from morca._internal.api.runs import ( runs_filters_json, ) from morca._internal.html import Html, query_param, url_encode -from morca._internal.json import quote from morca._internal.state import State from morca._internal.system import alert_html from morca._internal.ui.layout import ( @@ -30,7 +29,6 @@ from morca._internal.ui.terms import RUN_STATUSES, RUN_TRIGGERS from morca._internal.views.code import runs_code from morca._internal.views.runs import ( BULK_MAX, - RUNS_PAGE, RunsPage, RunsQuery, int_or_zero, diff --git a/src/morca/_internal/usage.mojo b/src/morca/_internal/usage.mojo index 17051b27..a5ec6ebc 100644 --- a/src/morca/_internal/usage.mojo +++ b/src/morca/_internal/usage.mojo @@ -34,7 +34,6 @@ seconds before the request, so neither clock needs to agree with the database's). """ -from std.ffi import c_int, external_call from std.time import perf_counter_ns from json import Value diff --git a/src/morca/_internal/views/data.mojo b/src/morca/_internal/views/data.mojo index 60ce5cf8..687e9994 100644 --- a/src/morca/_internal/views/data.mojo +++ b/src/morca/_internal/views/data.mojo @@ -25,11 +25,10 @@ What a read keeps on disk for the next, by snapshot, is from std.os import getenv from std.os.path import exists -from json import Value, loads +from json import loads from morca._internal.expiry import maintain_binary from morca._internal.html import query_param, query_values, url_encode -from morca._internal.json import quote from morca._internal.proc import capture comptime OPS = ["eq", "ne", "lt", "le", "gt", "ge", "in"] diff --git a/src/morca/_internal/views/pipelines.mojo b/src/morca/_internal/views/pipelines.mojo index 44c299f5..eccba7d9 100644 --- a/src/morca/_internal/views/pipelines.mojo +++ b/src/morca/_internal/views/pipelines.mojo @@ -11,7 +11,6 @@ from morca._internal.db.pipelines_view import ( PipelineRow, StepDef, UsageSummary, - comma_list, ) from morca.civil import Civil, now diff --git a/src/morca/_internal/views/recent.mojo b/src/morca/_internal/views/recent.mojo index e2bc459e..1597599e 100644 --- a/src/morca/_internal/views/recent.mojo +++ b/src/morca/_internal/views/recent.mojo @@ -4,7 +4,6 @@ what needs attention first. """ import morca._internal.db.home_view as home_db -from morca._internal.db.home_view import FAILED_LATELY from morca._internal.json import quote from morca._internal.state import State diff --git a/src/morca/_internal/views/runs.mojo b/src/morca/_internal/views/runs.mojo index 3a9fdf9a..2b82aa3e 100644 --- a/src/morca/_internal/views/runs.mojo +++ b/src/morca/_internal/views/runs.mojo @@ -16,11 +16,10 @@ from morca._internal.db.run_view import ( AuditRow, ClusterRow, InstanceRow, - StepRecord, Touch, VersionRow, ) -from morca._internal.db.runs_view import RunRecord, RunsFilter, utc_sql +from morca._internal.db.runs_view import RunRecord, RunsFilter from morca._internal.views.cluster import cluster_rows from morca._internal.handover import run_outdated diff --git a/src/morca/_internal/worker.mojo b/src/morca/_internal/worker.mojo index 1cb8e113..a0924801 100644 --- a/src/morca/_internal/worker.mojo +++ b/src/morca/_internal/worker.mojo @@ -52,7 +52,6 @@ started has its start given back. from std.ffi import c_int, external_call from std.os import getenv, makedirs, remove -from std.os.path import exists from std.sys.info import CompilationTarget, num_logical_cores from std.time import perf_counter_ns, sleep diff --git a/src/morca/_internal/workers.mojo b/src/morca/_internal/workers.mojo index f45f3d2f..fa5bff19 100644 --- a/src/morca/_internal/workers.mojo +++ b/src/morca/_internal/workers.mojo @@ -48,7 +48,7 @@ worker checks the spec again before it starts anything (`morca._internal.worker` from std.os import getenv -from json import Value, loads +from json import Value import morca._internal.db.audit as audit_db import morca._internal.db.pools as pools_db import morca._internal.db.scheduler as scheduler_db @@ -72,9 +72,8 @@ from morca._internal.admission import ( row_json, worker_host, ) -from morca._internal.control import WORKER_PREFIX, pool_of, pool_problem +from morca._internal.control import WORKER_PREFIX, pool_problem from morca._internal.http_store import ( - STORE_PATH, Body, bytes_of_hex, pins_json, diff --git a/src/morca/_lake/batch.mojo b/src/morca/_lake/batch.mojo index de6261eb..3315c9a1 100644 --- a/src/morca/_lake/batch.mojo +++ b/src/morca/_lake/batch.mojo @@ -14,7 +14,6 @@ from arrow_mlake import ( AT_FLOAT64, AT_INT16, AT_INT32, - AT_INT64, AT_INT8, AT_LARGE_BINARY, AT_LARGE_LIST, @@ -23,8 +22,6 @@ from arrow_mlake import ( AT_MAP, AT_STRUCT, AT_TIME32, - AT_TIME64, - AT_TIMESTAMP, AT_UTF8, ArrayArena, bit_get, diff --git a/src/morca/_lake/calls.mojo b/src/morca/_lake/calls.mojo index 5768b2d6..7e5a9d96 100644 --- a/src/morca/_lake/calls.mojo +++ b/src/morca/_lake/calls.mojo @@ -25,7 +25,7 @@ one over a `mut` borrow of it, and says so at compile time. from arrow_mlake.carrow_import import ImportedArray, ImportedStream from parquet import RecordBatch -from morca._lake.abi import Enc, Slots, bytes_of, get_int, put_int, text_of +from morca._lake.abi import Enc, Slots, bytes_of, put_int, text_of from morca._lake.client import Api, Exported diff --git a/src/morca/_lake/impl.mojo b/src/morca/_lake/impl.mojo index a18e88a6..fdc17a1f 100644 --- a/src/morca/_lake/impl.mojo +++ b/src/morca/_lake/impl.mojo @@ -65,8 +65,6 @@ from parquet_full import AllCodecs from morca._lake.host import Host from morca._lake.names import ( - DAY_MS, - DEFAULT_HISTORY_DAYS, _split, dataset_of, table_defaults, diff --git a/src/morca/_lake/lib.mojo b/src/morca/_lake/lib.mojo index 3b7d9095..bc66be2c 100644 --- a/src/morca/_lake/lib.mojo +++ b/src/morca/_lake/lib.mojo @@ -27,7 +27,7 @@ host block cross; each function's doc says what its failure value is. from std.memory import bitcast from std.memory.alloc import unsafe_alloc -from arrow_mlake import AT_STRUCT, ArrayArena, ArrayData, ArrowType +from arrow_mlake import AT_STRUCT, ArrayData, ArrowType from arrow_mlake.carrow import ExportedArray, export_c from arrow_mlake.carrow_import import ImportedArray from arrow_mlake.carrow_stream import export_stream_of @@ -48,9 +48,7 @@ from parquet_full import AllCodecs from morca._lake.abi import ( ABI_VERSION, MODE_APPEND, - MODE_BY_STEP, MODE_REPLACE, - SNAP_CURRENT, SNAP_NONE, RawDec, Enc, diff --git a/src/morca/cli.mojo b/src/morca/cli/__init__.mojo similarity index 100% rename from src/morca/cli.mojo rename to src/morca/cli/__init__.mojo diff --git a/src/morca/handover.mojo b/src/morca/handover/__init__.mojo similarity index 100% rename from src/morca/handover.mojo rename to src/morca/handover/__init__.mojo diff --git a/src/morca/pressure.mojo b/src/morca/pressure/__init__.mojo similarity index 100% rename from src/morca/pressure.mojo rename to src/morca/pressure/__init__.mojo diff --git a/src/morca/sqlite_store.mojo b/src/morca/sqlite_store/__init__.mojo similarity index 100% rename from src/morca/sqlite_store.mojo rename to src/morca/sqlite_store/__init__.mojo diff --git a/src/morca/state.mojo b/src/morca/state/__init__.mojo similarity index 100% rename from src/morca/state.mojo rename to src/morca/state/__init__.mojo diff --git a/src/morca/tasks.mojo b/src/morca/tasks.mojo index f9ae2843..a89e5ac4 100644 --- a/src/morca/tasks.mojo +++ b/src/morca/tasks.mojo @@ -31,7 +31,7 @@ gets a fresh entry. from std.ffi import c_int, c_uint, external_call from std.memory import stack_allocation from std.os import getenv -from std.sys.info import CompilationTarget, platform_map +from std.sys.info import platform_map from std.time import perf_counter_ns, sleep from dista import Runtime, TaskLike diff --git a/tests/compile_fail/duplicate_name.mojo b/tests/compile_fail/duplicate_name.mojo index 3287cca7..c1db2d41 100644 --- a/tests/compile_fail/duplicate_name.mojo +++ b/tests/compile_fail/duplicate_name.mojo @@ -1,6 +1,6 @@ # expect: two steps share a name from dista import Seq -from morca import Ctx, Gather, Mapped, Month, Pipeline, Step +from morca import Ctx, Mapped, Month, Pipeline, Step def key(mut ctx: Ctx, m: Month) raises -> Int: diff --git a/tests/compile_fail/edge_mismatch.mojo b/tests/compile_fail/edge_mismatch.mojo index f403a08e..79b20b6d 100644 --- a/tests/compile_fail/edge_mismatch.mojo +++ b/tests/compile_fail/edge_mismatch.mojo @@ -1,6 +1,6 @@ # expect: a mapped step takes the output of the step it follows from dista import Seq -from morca import Ctx, Gather, Mapped, Month, Pipeline, Step +from morca import Ctx, Mapped, Month, Pipeline, Step def key(mut ctx: Ctx, m: Month) raises -> Int: diff --git a/tests/compile_fail/first_gather_not_seq.mojo b/tests/compile_fail/first_gather_not_seq.mojo index 61d810d9..43a16801 100644 --- a/tests/compile_fail/first_gather_not_seq.mojo +++ b/tests/compile_fail/first_gather_not_seq.mojo @@ -1,6 +1,6 @@ # expect: a first gather step takes a Seq of the partition key from dista import Seq -from morca import Ctx, Gather, Mapped, Month, Pipeline, Step +from morca import Ctx, Gather, Month, Pipeline, Step def key(mut ctx: Ctx, m: Month) raises -> Int: diff --git a/tests/compile_fail/first_not_key.mojo b/tests/compile_fail/first_not_key.mojo index 4a65ebdf..bb9177c6 100644 --- a/tests/compile_fail/first_not_key.mojo +++ b/tests/compile_fail/first_not_key.mojo @@ -1,6 +1,6 @@ # expect: a first mapped step takes the pipeline's partition key from dista import Seq -from morca import Ctx, Gather, Mapped, Month, Pipeline, Step +from morca import Ctx, Mapped, Month, Pipeline, Step def key(mut ctx: Ctx, m: Month) raises -> Int: diff --git a/tests/compile_fail/month_under_daily.mojo b/tests/compile_fail/month_under_daily.mojo index 352b3dcb..4de46550 100644 --- a/tests/compile_fail/month_under_daily.mojo +++ b/tests/compile_fail/month_under_daily.mojo @@ -1,6 +1,6 @@ # expect: a first mapped step takes the pipeline's partition key from dista import Seq -from morca import Ctx, Daily, Gather, Mapped, Month, Pipeline, Step +from morca import Ctx, Daily, Mapped, Month, Pipeline, Step def key(mut ctx: Ctx, m: Month) raises -> Int: diff --git a/tests/compile_fail/not_in_pipeline.mojo b/tests/compile_fail/not_in_pipeline.mojo index bb06026e..4d9d4e8b 100644 --- a/tests/compile_fail/not_in_pipeline.mojo +++ b/tests/compile_fail/not_in_pipeline.mojo @@ -1,6 +1,6 @@ # expect: a step follows a step not in its pipeline from dista import Seq -from morca import Ctx, Gather, Mapped, Month, Pipeline, Step +from morca import Ctx, Mapped, Month, Pipeline, Step def key(mut ctx: Ctx, m: Month) raises -> Int: diff --git a/tests/compile_fail/out_of_order.mojo b/tests/compile_fail/out_of_order.mojo index 7a64e494..60d7824c 100644 --- a/tests/compile_fail/out_of_order.mojo +++ b/tests/compile_fail/out_of_order.mojo @@ -1,6 +1,6 @@ # expect: a step must be listed after the step it follows from dista import Seq -from morca import Ctx, Gather, Mapped, Month, Pipeline, Step +from morca import Ctx, Mapped, Month, Pipeline, Step def key(mut ctx: Ctx, m: Month) raises -> Int: diff --git a/tests/compile_fail/same_name_other_step.mojo b/tests/compile_fail/same_name_other_step.mojo index 7f581185..05754b27 100644 --- a/tests/compile_fail/same_name_other_step.mojo +++ b/tests/compile_fail/same_name_other_step.mojo @@ -1,6 +1,6 @@ # expect: a step follows another step of the same name from dista import Seq -from morca import Ctx, Gather, Mapped, Month, Pipeline, Step +from morca import Ctx, Mapped, Month, Pipeline, Step def key(mut ctx: Ctx, m: Month) raises -> Int: diff --git a/tests/sensors/other.mojo b/tests/sensors/other.mojo index f47482bc..da6a1efb 100644 --- a/tests/sensors/other.mojo +++ b/tests/sensors/other.mojo @@ -1,6 +1,6 @@ """A sensor over a dataset nothing writes: raw.other to lake.other.""" -from morca import Ctx, Mapped, Month, Monthly, Pipeline, Step, morca_main +from morca import Ctx, Mapped, Month, Pipeline, Step, morca_main from morca.tables import append, table from rows import count, dataset, rows diff --git a/tests/store_suite.mojo b/tests/store_suite.mojo index b8b63e94..e9cb8167 100644 --- a/tests/store_suite.mojo +++ b/tests/store_suite.mojo @@ -22,7 +22,6 @@ from morca import ( TableSnapshot, parse_months, ) -from morca.store import Recorder # --- a pipeline whose second step fails its first attempt --- diff --git a/tests/test_graph.mojo b/tests/test_graph.mojo index f908f117..91361017 100644 --- a/tests/test_graph.mojo +++ b/tests/test_graph.mojo @@ -1,7 +1,7 @@ """The graph drawing (`morca._internal.graph`): cycles found, and the layout top to bottom, two boxes wide at most.""" -from std.testing import TestSuite, assert_equal, assert_false, assert_true +from std.testing import TestSuite, assert_false, assert_true from morca._internal.graph import Edge, Node, back_edges, graph_svg diff --git a/tests/test_hcloud.mojo b/tests/test_hcloud.mojo index a2a4df38..e4a6c478 100644 --- a/tests/test_hcloud.mojo +++ b/tests/test_hcloud.mojo @@ -14,7 +14,6 @@ from std.testing import ( ) from morca._internal.hcloud import ( - Created, HCloud, ServerSpec, error_of, diff --git a/tests/test_store.mojo b/tests/test_store.mojo index daefb86a..d56e5413 100644 --- a/tests/test_store.mojo +++ b/tests/test_store.mojo @@ -14,7 +14,6 @@ from morca import ( ) from store_suite import ( Retrying, - Touching, check_a_store_that_lost_its_run_stops, check_claim_needs_a_stale_heartbeat, check_execute_records_attempts_and_retries, diff --git a/tests/test_tasks.mojo b/tests/test_tasks.mojo index 494c3f07..88e84379 100644 --- a/tests/test_tasks.mojo +++ b/tests/test_tasks.mojo @@ -1,6 +1,6 @@ """Dista inside steps: one runtime per run, reached through `Ctx.runtime`.""" -from std.testing import TestSuite, assert_equal, assert_raises, assert_true +from std.testing import TestSuite, assert_equal, assert_true from dista import ObjectRef, Seq, Task from morca import ( @@ -8,7 +8,6 @@ from morca import ( Gather, Mapped, Month, - NoTasks, Pipeline, Step, Tasks, diff --git a/tests/test_usage.mojo b/tests/test_usage.mojo index abf4cd83..1d64559a 100644 --- a/tests/test_usage.mojo +++ b/tests/test_usage.mojo @@ -18,7 +18,6 @@ from morca._internal.sample import parse_pid_usage, tree_usage from morca._internal.db.run_rows import Usage from morca._internal.usage import ( MAX_MARKS, - Mark, Meter, attribute, bytes_text,