pipeloom 0.0.2__tar.gz → 0.2.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- pipeloom-0.2.0/CHANGELOG.md +115 -0
- {pipeloom-0.0.2 → pipeloom-0.2.0}/PKG-INFO +26 -5
- pipeloom-0.2.0/README.pypi.md +19 -0
- pipeloom-0.2.0/pyproject.toml +174 -0
- pipeloom-0.2.0/src/pipeloom/api.py +147 -0
- pipeloom-0.2.0/src/pipeloom/artifacts/__init__.py +4 -0
- pipeloom-0.2.0/src/pipeloom/artifacts/finalize.py +75 -0
- pipeloom-0.2.0/src/pipeloom/artifacts/io.py +40 -0
- pipeloom-0.2.0/src/pipeloom/artifacts/layout.py +51 -0
- pipeloom-0.2.0/src/pipeloom/artifacts/results.py +183 -0
- pipeloom-0.2.0/src/pipeloom/builtins/__init__.py +1 -0
- pipeloom-0.2.0/src/pipeloom/builtins/filesystem.py +74 -0
- pipeloom-0.2.0/src/pipeloom/builtins/fs_table.py +254 -0
- pipeloom-0.2.0/src/pipeloom/builtins/naming.py +82 -0
- pipeloom-0.2.0/src/pipeloom/builtins/secrets_env.py +37 -0
- pipeloom-0.2.0/src/pipeloom/cli/__init__.py +29 -0
- pipeloom-0.2.0/src/pipeloom/cli/_events.py +197 -0
- pipeloom-0.2.0/src/pipeloom/cli/_options.py +111 -0
- pipeloom-0.2.0/src/pipeloom/cli/_select.py +60 -0
- pipeloom-0.2.0/src/pipeloom/cli/compile.py +103 -0
- pipeloom-0.2.0/src/pipeloom/cli/graph.py +91 -0
- pipeloom-0.2.0/src/pipeloom/cli/ls.py +66 -0
- pipeloom-0.2.0/src/pipeloom/cli/plugins.py +76 -0
- pipeloom-0.2.0/src/pipeloom/cli/run.py +179 -0
- pipeloom-0.2.0/src/pipeloom/cli/schema.py +61 -0
- pipeloom-0.2.0/src/pipeloom/cli/validate.py +49 -0
- pipeloom-0.2.0/src/pipeloom/config/__init__.py +1 -0
- pipeloom-0.2.0/src/pipeloom/config/bind.py +198 -0
- pipeloom-0.2.0/src/pipeloom/config/discover.py +68 -0
- pipeloom-0.2.0/src/pipeloom/config/errors.py +123 -0
- pipeloom-0.2.0/src/pipeloom/config/load.py +211 -0
- pipeloom-0.2.0/src/pipeloom/config/models.py +359 -0
- pipeloom-0.2.0/src/pipeloom/config/resolve.py +202 -0
- pipeloom-0.2.0/src/pipeloom/config/schema.py +145 -0
- pipeloom-0.2.0/src/pipeloom/config/types.py +80 -0
- pipeloom-0.2.0/src/pipeloom/config/yaml.py +274 -0
- pipeloom-0.2.0/src/pipeloom/diagnostics/__init__.py +180 -0
- pipeloom-0.2.0/src/pipeloom/diagnostics/codes.py +472 -0
- pipeloom-0.2.0/src/pipeloom/engine/__init__.py +1 -0
- pipeloom-0.2.0/src/pipeloom/engine/portable.py +107 -0
- pipeloom-0.2.0/src/pipeloom/engine/protocols.py +115 -0
- pipeloom-0.2.0/src/pipeloom/engine/types.py +100 -0
- pipeloom-0.2.0/src/pipeloom/events/__init__.py +1 -0
- pipeloom-0.2.0/src/pipeloom/events/bus.py +224 -0
- pipeloom-0.2.0/src/pipeloom/events/model.py +288 -0
- pipeloom-0.2.0/src/pipeloom/events/sinks/__init__.py +1 -0
- pipeloom-0.2.0/src/pipeloom/events/sinks/buffered.py +91 -0
- pipeloom-0.2.0/src/pipeloom/events/sinks/console.py +237 -0
- pipeloom-0.2.0/src/pipeloom/events/sinks/jsonl.py +81 -0
- pipeloom-0.2.0/src/pipeloom/events/sinks/runfile.py +56 -0
- pipeloom-0.2.0/src/pipeloom/graph/__init__.py +1 -0
- pipeloom-0.2.0/src/pipeloom/graph/dag.py +204 -0
- pipeloom-0.2.0/src/pipeloom/graph/selectors.py +223 -0
- pipeloom-0.2.0/src/pipeloom/plan/__init__.py +1 -0
- pipeloom-0.2.0/src/pipeloom/plan/compile.py +150 -0
- pipeloom-0.2.0/src/pipeloom/plan/manifest.py +122 -0
- pipeloom-0.2.0/src/pipeloom/plan/model.py +111 -0
- pipeloom-0.2.0/src/pipeloom/plan/units.py +35 -0
- pipeloom-0.2.0/src/pipeloom/platform.py +50 -0
- pipeloom-0.2.0/src/pipeloom/plugins/__init__.py +308 -0
- pipeloom-0.2.0/src/pipeloom/plugins/builtin.py +30 -0
- pipeloom-0.2.0/src/pipeloom/runtime/__init__.py +1 -0
- pipeloom-0.2.0/src/pipeloom/runtime/context.py +65 -0
- pipeloom-0.2.0/src/pipeloom/runtime/errors.py +102 -0
- pipeloom-0.2.0/src/pipeloom/runtime/executors/__init__.py +43 -0
- pipeloom-0.2.0/src/pipeloom/runtime/executors/process.py +243 -0
- pipeloom-0.2.0/src/pipeloom/runtime/executors/thread.py +40 -0
- pipeloom-0.2.0/src/pipeloom/runtime/loader.py +63 -0
- pipeloom-0.2.0/src/pipeloom/runtime/memo.py +68 -0
- pipeloom-0.2.0/src/pipeloom/runtime/run.py +598 -0
- pipeloom-0.2.0/src/pipeloom/runtime/runner.py +500 -0
- pipeloom-0.2.0/src/pipeloom/runtime/scheduler.py +261 -0
- pipeloom-0.2.0/src/pipeloom/runtime/states.py +51 -0
- pipeloom-0.2.0/src/pipeloom/secrets/__init__.py +1 -0
- pipeloom-0.2.0/src/pipeloom/secrets/interpolation.py +140 -0
- pipeloom-0.2.0/src/pipeloom/secrets/redaction.py +52 -0
- pipeloom-0.2.0/src/pipeloom/state/__init__.py +4 -0
- pipeloom-0.2.0/src/pipeloom/state/codec.py +148 -0
- pipeloom-0.2.0/src/pipeloom/state/jsondir.py +328 -0
- pipeloom-0.2.0/src/pipeloom/state/lease.py +73 -0
- pipeloom-0.2.0/src/pipeloom/state/sqlite.py +283 -0
- pipeloom-0.2.0/src/pipeloom/state/types.py +110 -0
- pipeloom-0.2.0/src/pipeloom/testing/__init__.py +6 -0
- pipeloom-0.2.0/src/pipeloom/testing/clock.py +32 -0
- pipeloom-0.2.0/src/pipeloom/testing/contract/__init__.py +1 -0
- pipeloom-0.2.0/src/pipeloom/testing/contract/engine.py +292 -0
- pipeloom-0.2.0/src/pipeloom/testing/contract/state.py +247 -0
- pipeloom-0.2.0/src/pipeloom/testing/memory.py +329 -0
- pipeloom-0.2.0/src/pipeloom/testing/recording.py +37 -0
- pipeloom-0.2.0/src/pipeloom/testing/sim.py +44 -0
- pipeloom-0.2.0/src/pipeloom/validate/__init__.py +26 -0
- pipeloom-0.2.0/src/pipeloom/validate/capabilities.py +123 -0
- pipeloom-0.2.0/src/pipeloom/validate/references.py +39 -0
- pipeloom-0.2.0/src/pipeloom/validate/semantics.py +167 -0
- pipeloom-0.2.0/src/pipeloom/validate/static.py +185 -0
- pipeloom-0.2.0/tests/__init__.py +0 -0
- pipeloom-0.2.0/tests/artifacts/__init__.py +0 -0
- pipeloom-0.2.0/tests/artifacts/test_artifacts.py +115 -0
- pipeloom-0.2.0/tests/cases/PLC501.yml +13 -0
- pipeloom-0.2.0/tests/cases/PLC502.yml +12 -0
- pipeloom-0.2.0/tests/cases/PLC503.yml +13 -0
- pipeloom-0.2.0/tests/cases/PLC504.yml +16 -0
- pipeloom-0.2.0/tests/cases/PLC505.yml +15 -0
- pipeloom-0.2.0/tests/cases/PLC506.yml +11 -0
- pipeloom-0.2.0/tests/cases/PLC507.yml +12 -0
- pipeloom-0.2.0/tests/cases/PLC508.yml +14 -0
- pipeloom-0.2.0/tests/cases/PLC509.yml +12 -0
- pipeloom-0.2.0/tests/cases/PLE401.yml +13 -0
- pipeloom-0.2.0/tests/cases/PLG301.yml +20 -0
- pipeloom-0.2.0/tests/cases/PLG302.yml +12 -0
- pipeloom-0.2.0/tests/cases/PLG303.yml +12 -0
- pipeloom-0.2.0/tests/cases/PLG304.yml +12 -0
- pipeloom-0.2.0/tests/cases/PLG305.yml +12 -0
- pipeloom-0.2.0/tests/cases/PLG306.yml +13 -0
- pipeloom-0.2.0/tests/cases/PLK601.yml +11 -0
- pipeloom-0.2.0/tests/cases/PLK602.yml +15 -0
- pipeloom-0.2.0/tests/cases/PLK603.yml +16 -0
- pipeloom-0.2.0/tests/cases/PLK604.yml +13 -0
- pipeloom-0.2.0/tests/cases/PLK605.yml +10 -0
- pipeloom-0.2.0/tests/cases/PLM201.yml +14 -0
- pipeloom-0.2.0/tests/cases/PLM204.yml +15 -0
- pipeloom-0.2.0/tests/cases/PLP401.yml +13 -0
- pipeloom-0.2.0/tests/cases/PLP402.yml +13 -0
- pipeloom-0.2.0/tests/cases/PLP403.yml +14 -0
- pipeloom-0.2.0/tests/cases/PLP404.yml +14 -0
- pipeloom-0.2.0/tests/cases/PLP405.yml +13 -0
- pipeloom-0.2.0/tests/cases/PLP406.yml +15 -0
- pipeloom-0.2.0/tests/cases/PLP407.yml +13 -0
- pipeloom-0.2.0/tests/cases/PLP408.yml +12 -0
- pipeloom-0.2.0/tests/cases/PLP409.yml +15 -0
- pipeloom-0.2.0/tests/cases/PLR201.yml +14 -0
- pipeloom-0.2.0/tests/cases/PLR202.yml +15 -0
- pipeloom-0.2.0/tests/cases/PLR203.yml +14 -0
- pipeloom-0.2.0/tests/cases/PLR204.yml +7 -0
- pipeloom-0.2.0/tests/cases/PLR205.yml +13 -0
- pipeloom-0.2.0/tests/cases/PLR206.yml +12 -0
- pipeloom-0.2.0/tests/cases/PLR207.yml +9 -0
- pipeloom-0.2.0/tests/cases/PLS101.yml +8 -0
- pipeloom-0.2.0/tests/cases/PLS102.yml +8 -0
- pipeloom-0.2.0/tests/cases/PLS103.yml +4 -0
- pipeloom-0.2.0/tests/cases/PLS104.yml +12 -0
- pipeloom-0.2.0/tests/cases/PLS105.yml +5 -0
- pipeloom-0.2.0/tests/cases/PLS106.yml +8 -0
- pipeloom-0.2.0/tests/cases/PLS107.yml +8 -0
- pipeloom-0.2.0/tests/cases/PLS108.yml +12 -0
- pipeloom-0.2.0/tests/cases/PLU001.yml +9 -0
- pipeloom-0.2.0/tests/cases/PLU002.yml +9 -0
- pipeloom-0.2.0/tests/cases/PLU003.yml +9 -0
- pipeloom-0.2.0/tests/cases/PLX101.yml +16 -0
- pipeloom-0.2.0/tests/cases/PLX103.yml +12 -0
- pipeloom-0.2.0/tests/cases/PLX105.yml +12 -0
- pipeloom-0.2.0/tests/cases/PLX106.yml +19 -0
- pipeloom-0.2.0/tests/cases/PLX107.yml +13 -0
- pipeloom-0.2.0/tests/cases/PLY001.yml +8 -0
- pipeloom-0.2.0/tests/cases/PLY002.yml +8 -0
- pipeloom-0.2.0/tests/cases/PLY003.yml +3 -0
- pipeloom-0.2.0/tests/cases/PLY004.yml +1 -0
- pipeloom-0.2.0/tests/config/__init__.py +0 -0
- pipeloom-0.2.0/tests/config/test_bind.py +250 -0
- pipeloom-0.2.0/tests/config/test_cases.py +141 -0
- pipeloom-0.2.0/tests/config/test_errors.py +74 -0
- pipeloom-0.2.0/tests/config/test_interpolation.py +88 -0
- pipeloom-0.2.0/tests/config/test_load.py +206 -0
- pipeloom-0.2.0/tests/config/test_models.py +128 -0
- pipeloom-0.2.0/tests/config/test_resolve.py +113 -0
- pipeloom-0.2.0/tests/config/test_schema.py +156 -0
- pipeloom-0.2.0/tests/config/test_yaml.py +160 -0
- pipeloom-0.2.0/tests/conftest.py +62 -0
- pipeloom-0.2.0/tests/events/__init__.py +0 -0
- pipeloom-0.2.0/tests/events/fakes.py +28 -0
- pipeloom-0.2.0/tests/events/test_bus.py +230 -0
- pipeloom-0.2.0/tests/events/test_console_run.py +119 -0
- pipeloom-0.2.0/tests/events/test_model.py +122 -0
- pipeloom-0.2.0/tests/events/test_redaction.py +56 -0
- pipeloom-0.2.0/tests/events/test_sinks.py +188 -0
- pipeloom-0.2.0/tests/fixtures/minimal/models/_defaults.yml +2 -0
- pipeloom-0.2.0/tests/fixtures/minimal/models/staging/orders.yml +7 -0
- pipeloom-0.2.0/tests/fixtures/minimal/pipeloom.yml +10 -0
- pipeloom-0.2.0/tests/fixtures/shop/models/marts/marts.yml +22 -0
- pipeloom-0.2.0/tests/fixtures/shop/models/staging/_defaults.yml +2 -0
- pipeloom-0.2.0/tests/fixtures/shop/models/staging/sources.yml +4 -0
- pipeloom-0.2.0/tests/fixtures/shop/models/staging/stg.yml +10 -0
- pipeloom-0.2.0/tests/fixtures/shop/pipeloom.yml +12 -0
- pipeloom-0.2.0/tests/fixtures/shop/src/shop/__init__.py +1 -0
- pipeloom-0.2.0/tests/fixtures/shop/src/shop/enrich.py +7 -0
- pipeloom-0.2.0/tests/fixtures/shop/src/shop/marts.py +11 -0
- pipeloom-0.2.0/tests/fixtures/smoke/models/models.yml +30 -0
- pipeloom-0.2.0/tests/fixtures/smoke/models/sources.yml +3 -0
- pipeloom-0.2.0/tests/fixtures/smoke/pipeloom.yml +11 -0
- pipeloom-0.2.0/tests/fixtures/smoke/raw/customers.csv +3 -0
- pipeloom-0.2.0/tests/fixtures/smoke/raw/orders.csv +4 -0
- pipeloom-0.2.0/tests/fixtures/smoke/src/smoke/__init__.py +1 -0
- pipeloom-0.2.0/tests/fixtures/smoke/src/smoke/models.py +18 -0
- pipeloom-0.2.0/tests/fixtures/smoke-pandas/models/models.yml +26 -0
- pipeloom-0.2.0/tests/fixtures/smoke-pandas/models/sources.yml +3 -0
- pipeloom-0.2.0/tests/fixtures/smoke-pandas/pipeloom.yml +11 -0
- pipeloom-0.2.0/tests/fixtures/smoke-pandas/raw/customers.csv +3 -0
- pipeloom-0.2.0/tests/fixtures/smoke-pandas/raw/orders.csv +4 -0
- pipeloom-0.2.0/tests/fixtures/smoke-pandas/src/smoke/__init__.py +1 -0
- pipeloom-0.2.0/tests/fixtures/smoke-pandas/src/smoke/models.py +33 -0
- pipeloom-0.2.0/tests/goldens/diagnostics/PLC501.json +18 -0
- pipeloom-0.2.0/tests/goldens/diagnostics/PLC501.txt +2 -0
- pipeloom-0.2.0/tests/goldens/diagnostics/PLC502.json +18 -0
- pipeloom-0.2.0/tests/goldens/diagnostics/PLC502.txt +2 -0
- pipeloom-0.2.0/tests/goldens/diagnostics/PLC503.json +17 -0
- pipeloom-0.2.0/tests/goldens/diagnostics/PLC503.txt +2 -0
- pipeloom-0.2.0/tests/goldens/diagnostics/PLC504.json +18 -0
- pipeloom-0.2.0/tests/goldens/diagnostics/PLC504.txt +2 -0
- pipeloom-0.2.0/tests/goldens/diagnostics/PLC505.json +18 -0
- pipeloom-0.2.0/tests/goldens/diagnostics/PLC505.txt +2 -0
- pipeloom-0.2.0/tests/goldens/diagnostics/PLC506.json +18 -0
- pipeloom-0.2.0/tests/goldens/diagnostics/PLC506.txt +2 -0
- pipeloom-0.2.0/tests/goldens/diagnostics/PLC507.json +34 -0
- pipeloom-0.2.0/tests/goldens/diagnostics/PLC507.txt +4 -0
- pipeloom-0.2.0/tests/goldens/diagnostics/PLC508.json +18 -0
- pipeloom-0.2.0/tests/goldens/diagnostics/PLC508.txt +2 -0
- pipeloom-0.2.0/tests/goldens/diagnostics/PLC509.json +18 -0
- pipeloom-0.2.0/tests/goldens/diagnostics/PLC509.txt +2 -0
- pipeloom-0.2.0/tests/goldens/diagnostics/PLE401.json +19 -0
- pipeloom-0.2.0/tests/goldens/diagnostics/PLE401.txt +1 -0
- pipeloom-0.2.0/tests/goldens/diagnostics/PLG301.json +21 -0
- pipeloom-0.2.0/tests/goldens/diagnostics/PLG301.txt +2 -0
- pipeloom-0.2.0/tests/goldens/diagnostics/PLG302.json +18 -0
- pipeloom-0.2.0/tests/goldens/diagnostics/PLG302.txt +2 -0
- pipeloom-0.2.0/tests/goldens/diagnostics/PLG303.json +12 -0
- pipeloom-0.2.0/tests/goldens/diagnostics/PLG303.txt +1 -0
- pipeloom-0.2.0/tests/goldens/diagnostics/PLG304.json +13 -0
- pipeloom-0.2.0/tests/goldens/diagnostics/PLG304.txt +2 -0
- pipeloom-0.2.0/tests/goldens/diagnostics/PLG305.json +12 -0
- pipeloom-0.2.0/tests/goldens/diagnostics/PLG305.txt +2 -0
- pipeloom-0.2.0/tests/goldens/diagnostics/PLG306.json +23 -0
- pipeloom-0.2.0/tests/goldens/diagnostics/PLG306.txt +1 -0
- pipeloom-0.2.0/tests/goldens/diagnostics/PLK601.json +18 -0
- pipeloom-0.2.0/tests/goldens/diagnostics/PLK601.txt +2 -0
- pipeloom-0.2.0/tests/goldens/diagnostics/PLK602.json +18 -0
- pipeloom-0.2.0/tests/goldens/diagnostics/PLK602.txt +2 -0
- pipeloom-0.2.0/tests/goldens/diagnostics/PLK603.json +18 -0
- pipeloom-0.2.0/tests/goldens/diagnostics/PLK603.txt +2 -0
- pipeloom-0.2.0/tests/goldens/diagnostics/PLK604.json +18 -0
- pipeloom-0.2.0/tests/goldens/diagnostics/PLK604.txt +1 -0
- pipeloom-0.2.0/tests/goldens/diagnostics/PLK605.json +17 -0
- pipeloom-0.2.0/tests/goldens/diagnostics/PLK605.txt +2 -0
- pipeloom-0.2.0/tests/goldens/diagnostics/PLM201.json +18 -0
- pipeloom-0.2.0/tests/goldens/diagnostics/PLM201.txt +2 -0
- pipeloom-0.2.0/tests/goldens/diagnostics/PLM204.json +18 -0
- pipeloom-0.2.0/tests/goldens/diagnostics/PLM204.txt +2 -0
- pipeloom-0.2.0/tests/goldens/diagnostics/PLP401.json +33 -0
- pipeloom-0.2.0/tests/goldens/diagnostics/PLP401.txt +4 -0
- pipeloom-0.2.0/tests/goldens/diagnostics/PLP402.json +33 -0
- pipeloom-0.2.0/tests/goldens/diagnostics/PLP402.txt +4 -0
- pipeloom-0.2.0/tests/goldens/diagnostics/PLP403.json +17 -0
- pipeloom-0.2.0/tests/goldens/diagnostics/PLP403.txt +2 -0
- pipeloom-0.2.0/tests/goldens/diagnostics/PLP404.json +33 -0
- pipeloom-0.2.0/tests/goldens/diagnostics/PLP404.txt +4 -0
- pipeloom-0.2.0/tests/goldens/diagnostics/PLP405.json +17 -0
- pipeloom-0.2.0/tests/goldens/diagnostics/PLP405.txt +2 -0
- pipeloom-0.2.0/tests/goldens/diagnostics/PLP406.json +18 -0
- pipeloom-0.2.0/tests/goldens/diagnostics/PLP406.txt +2 -0
- pipeloom-0.2.0/tests/goldens/diagnostics/PLP407.json +33 -0
- pipeloom-0.2.0/tests/goldens/diagnostics/PLP407.txt +4 -0
- pipeloom-0.2.0/tests/goldens/diagnostics/PLP408.json +17 -0
- pipeloom-0.2.0/tests/goldens/diagnostics/PLP408.txt +2 -0
- pipeloom-0.2.0/tests/goldens/diagnostics/PLP409.json +17 -0
- pipeloom-0.2.0/tests/goldens/diagnostics/PLP409.txt +2 -0
- pipeloom-0.2.0/tests/goldens/diagnostics/PLR201.json +19 -0
- pipeloom-0.2.0/tests/goldens/diagnostics/PLR201.txt +2 -0
- pipeloom-0.2.0/tests/goldens/diagnostics/PLR202.json +18 -0
- pipeloom-0.2.0/tests/goldens/diagnostics/PLR202.txt +2 -0
- pipeloom-0.2.0/tests/goldens/diagnostics/PLR203.json +19 -0
- pipeloom-0.2.0/tests/goldens/diagnostics/PLR203.txt +2 -0
- pipeloom-0.2.0/tests/goldens/diagnostics/PLR204.json +31 -0
- pipeloom-0.2.0/tests/goldens/diagnostics/PLR204.txt +4 -0
- pipeloom-0.2.0/tests/goldens/diagnostics/PLR205.json +18 -0
- pipeloom-0.2.0/tests/goldens/diagnostics/PLR205.txt +2 -0
- pipeloom-0.2.0/tests/goldens/diagnostics/PLR206.json +15 -0
- pipeloom-0.2.0/tests/goldens/diagnostics/PLR206.txt +2 -0
- pipeloom-0.2.0/tests/goldens/diagnostics/PLR207.json +28 -0
- pipeloom-0.2.0/tests/goldens/diagnostics/PLR207.txt +4 -0
- pipeloom-0.2.0/tests/goldens/diagnostics/PLS101.json +17 -0
- pipeloom-0.2.0/tests/goldens/diagnostics/PLS101.txt +2 -0
- pipeloom-0.2.0/tests/goldens/diagnostics/PLS102.json +17 -0
- pipeloom-0.2.0/tests/goldens/diagnostics/PLS102.txt +1 -0
- pipeloom-0.2.0/tests/goldens/diagnostics/PLS103.json +15 -0
- pipeloom-0.2.0/tests/goldens/diagnostics/PLS103.txt +2 -0
- pipeloom-0.2.0/tests/goldens/diagnostics/PLS104.json +210 -0
- pipeloom-0.2.0/tests/goldens/diagnostics/PLS104.txt +32 -0
- pipeloom-0.2.0/tests/goldens/diagnostics/PLS105.json +17 -0
- pipeloom-0.2.0/tests/goldens/diagnostics/PLS105.txt +1 -0
- pipeloom-0.2.0/tests/goldens/diagnostics/PLS106.json +31 -0
- pipeloom-0.2.0/tests/goldens/diagnostics/PLS106.txt +4 -0
- pipeloom-0.2.0/tests/goldens/diagnostics/PLS107.json +41 -0
- pipeloom-0.2.0/tests/goldens/diagnostics/PLS107.txt +6 -0
- pipeloom-0.2.0/tests/goldens/diagnostics/PLS108.json +17 -0
- pipeloom-0.2.0/tests/goldens/diagnostics/PLS108.txt +1 -0
- pipeloom-0.2.0/tests/goldens/diagnostics/PLU001.json +40 -0
- pipeloom-0.2.0/tests/goldens/diagnostics/PLU001.txt +4 -0
- pipeloom-0.2.0/tests/goldens/diagnostics/PLU002.json +31 -0
- pipeloom-0.2.0/tests/goldens/diagnostics/PLU002.txt +4 -0
- pipeloom-0.2.0/tests/goldens/diagnostics/PLU003.json +32 -0
- pipeloom-0.2.0/tests/goldens/diagnostics/PLU003.txt +3 -0
- pipeloom-0.2.0/tests/goldens/diagnostics/PLX101.json +18 -0
- pipeloom-0.2.0/tests/goldens/diagnostics/PLX101.txt +1 -0
- pipeloom-0.2.0/tests/goldens/diagnostics/PLX103.json +24 -0
- pipeloom-0.2.0/tests/goldens/diagnostics/PLX103.txt +1 -0
- pipeloom-0.2.0/tests/goldens/diagnostics/PLX105.json +14 -0
- pipeloom-0.2.0/tests/goldens/diagnostics/PLX105.txt +2 -0
- pipeloom-0.2.0/tests/goldens/diagnostics/PLX106.json +13 -0
- pipeloom-0.2.0/tests/goldens/diagnostics/PLX106.txt +2 -0
- pipeloom-0.2.0/tests/goldens/diagnostics/PLX107.json +26 -0
- pipeloom-0.2.0/tests/goldens/diagnostics/PLX107.txt +1 -0
- pipeloom-0.2.0/tests/goldens/diagnostics/PLY001.json +15 -0
- pipeloom-0.2.0/tests/goldens/diagnostics/PLY001.txt +1 -0
- pipeloom-0.2.0/tests/goldens/diagnostics/PLY002.json +15 -0
- pipeloom-0.2.0/tests/goldens/diagnostics/PLY002.txt +2 -0
- pipeloom-0.2.0/tests/goldens/diagnostics/PLY003.json +15 -0
- pipeloom-0.2.0/tests/goldens/diagnostics/PLY003.txt +2 -0
- pipeloom-0.2.0/tests/goldens/diagnostics/PLY004.json +15 -0
- pipeloom-0.2.0/tests/goldens/diagnostics/PLY004.txt +2 -0
- pipeloom-0.2.0/tests/goldens/events/console.txt +7 -0
- pipeloom-0.2.0/tests/goldens/events/console_run.txt +10 -0
- pipeloom-0.2.0/tests/goldens/events/console_unit.txt +4 -0
- pipeloom-0.2.0/tests/goldens/graph/small.dot +10 -0
- pipeloom-0.2.0/tests/goldens/graph/small.mmd +8 -0
- pipeloom-0.2.0/tests/goldens/manifest/shop-ci.json +576 -0
- pipeloom-0.2.0/tests/goldens/run_results/shop.json +363 -0
- pipeloom-0.2.0/tests/goldens/schema/defaults.json +788 -0
- pipeloom-0.2.0/tests/goldens/schema/models.json +981 -0
- pipeloom-0.2.0/tests/goldens/schema/project.json +1767 -0
- pipeloom-0.2.0/tests/goldens/schema/project.plugins.json +1323 -0
- pipeloom-0.2.0/tests/graph/__init__.py +0 -0
- pipeloom-0.2.0/tests/graph/test_dag.py +98 -0
- pipeloom-0.2.0/tests/graph/test_selectors.py +118 -0
- pipeloom-0.2.0/tests/graph/test_unit_selector.py +87 -0
- pipeloom-0.2.0/tests/plan/__init__.py +0 -0
- pipeloom-0.2.0/tests/plan/test_plan.py +206 -0
- pipeloom-0.2.0/tests/plugins/__init__.py +0 -0
- pipeloom-0.2.0/tests/plugins/fakes.py +91 -0
- pipeloom-0.2.0/tests/plugins/test_builtins.py +66 -0
- pipeloom-0.2.0/tests/plugins/test_memory.py +179 -0
- pipeloom-0.2.0/tests/plugins/test_registry.py +180 -0
- pipeloom-0.2.0/tests/runtime/__init__.py +0 -0
- pipeloom-0.2.0/tests/runtime/fakes.py +28 -0
- pipeloom-0.2.0/tests/runtime/test_frame_api.py +95 -0
- pipeloom-0.2.0/tests/runtime/test_process.py +268 -0
- pipeloom-0.2.0/tests/runtime/test_run_control.py +133 -0
- pipeloom-0.2.0/tests/runtime/test_runner.py +332 -0
- pipeloom-0.2.0/tests/runtime/test_scheduler.py +340 -0
- pipeloom-0.2.0/tests/runtime/test_support.py +118 -0
- pipeloom-0.2.0/tests/state/__init__.py +0 -0
- pipeloom-0.2.0/tests/state/test_stores.py +130 -0
- pipeloom-0.2.0/tests/test_catalog.py +62 -0
- pipeloom-0.2.0/tests/test_cli_compile.py +174 -0
- pipeloom-0.2.0/tests/test_cli_events.py +195 -0
- pipeloom-0.2.0/tests/test_cli_plugins.py +196 -0
- pipeloom-0.2.0/tests/test_cli_run.py +408 -0
- pipeloom-0.2.0/tests/test_cli_select.py +200 -0
- pipeloom-0.2.0/tests/test_cli_validate.py +128 -0
- pipeloom-0.2.0/tests/test_diagnostics.py +52 -0
- pipeloom-0.2.0/tests/test_docs_hooks.py +55 -0
- pipeloom-0.2.0/tests/test_engine_contract.py +53 -0
- pipeloom-0.2.0/tests/test_fs_table.py +222 -0
- pipeloom-0.2.0/tests/test_platform.py +14 -0
- pipeloom-0.2.0/tests/test_portable.py +123 -0
- pipeloom-0.2.0/tests/test_versions.py +87 -0
- pipeloom-0.2.0/tests/validate/__init__.py +0 -0
- pipeloom-0.2.0/tests/validate/test_sql_check.py +38 -0
- pipeloom-0.2.0/tests/validate/test_validate.py +119 -0
- pipeloom-0.0.2/CHANGELOG.md +0 -18
- pipeloom-0.0.2/README.pypi.md +0 -8
- pipeloom-0.0.2/pyproject.toml +0 -60
- pipeloom-0.0.2/src/pipeloom/cli.py +0 -9
- {pipeloom-0.0.2 → pipeloom-0.2.0}/.gitignore +0 -0
- {pipeloom-0.0.2 → pipeloom-0.2.0}/LICENSE +0 -0
- {pipeloom-0.0.2 → pipeloom-0.2.0}/NOTICE +0 -0
- {pipeloom-0.0.2 → pipeloom-0.2.0}/src/pipeloom/__init__.py +0 -0
- {pipeloom-0.0.2 → pipeloom-0.2.0}/src/pipeloom/__main__.py +0 -0
- {pipeloom-0.0.2 → pipeloom-0.2.0}/src/pipeloom/py.typed +0 -0
- {pipeloom-0.0.2 → pipeloom-0.2.0}/tests/test_cli.py +0 -0
- {pipeloom-0.0.2 → pipeloom-0.2.0}/tests/test_version.py +0 -0
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project are documented here. The format follows
|
|
4
|
+
[Keep a Changelog](https://keepachangelog.com/en/1.1.0/) and the project uses
|
|
5
|
+
[Semantic Versioning](https://semver.org/).
|
|
6
|
+
|
|
7
|
+
## [Unreleased]
|
|
8
|
+
|
|
9
|
+
## [0.2.0] - 2026-11-04
|
|
10
|
+
|
|
11
|
+
pipeloom 0.2 runs plans: a scheduler, thread and process executors, polars and pandas engines, a filesystem catalog, state stores and run artifacts.
|
|
12
|
+
|
|
13
|
+
### Added
|
|
14
|
+
|
|
15
|
+
- PLK603 (SQL reads a table that is not an input alias or a CTE) and PLK605 (SQL not parseable), both warnings. They run only when sqlglot is installed (extra `pipeloom[sqlglot]`); without it nothing is imported or reported.
|
|
16
|
+
- Docs: the guide `Running a pipeline`, the reference `Run artifacts`, a quickstart that runs on polars, and the 0.2 edits of the architecture document and the state machine diagram.
|
|
17
|
+
- `pipeloom-polars`, the first plugin distribution (`plugins/pipeloom-polars/`, install with `pipeloom[polars]`): the polars engine on lazy frames, SQL and views through `pl.SQLContext`, tables on the filesystem catalog with exact token replay. It passes `EngineContract`; see `docs/plugins/polars.md`.
|
|
18
|
+
- `pipeloom-pandas` (`plugins/pipeloom-pandas/`, install with `pipeloom[pandas]`): the pandas engine on eager DataFrames with Arrow-backed reads, tables on the filesystem catalog with exact token replay. No SQL models and no views in 0.2 (PLC502, PLC507). It passes `EngineContract`; see `docs/plugins/pandas.md`.
|
|
19
|
+
- `tests/fixtures/smoke-pandas`: the smoke project on the pandas target (Python models only); CI runs it from the built wheels.
|
|
20
|
+
- uv workspace (`members = ["plugins/*"]`) with one lockfile; the `polars` extra of `pipeloom` pins `pipeloom-polars` to the same version.
|
|
21
|
+
- `frame_api: narwhals` is wired in the runner: models receive Narwhals frames and a Narwhals result is converted back. PLC508 still rejects it on a non-portable engine.
|
|
22
|
+
- `tools/versions.py` (`check [--tag vX.Y.Z]` and `bump X.Y.Z`) keeps every distribution on one version.
|
|
23
|
+
- `tests/fixtures/smoke`: a small project on the polars engine that CI runs from the built wheels.
|
|
24
|
+
- CI builds every distribution, smoke tests the core wheel alone and all wheels together, and covers the plugin in typecheck and coverage. The release workflow builds each distribution into `dist/<name>/` and publishes each with its own step. ADR-0023.
|
|
25
|
+
- `pipeloom run`: runs the selected models with `-s/--select`, `--exclude`, `--manifest`, `--expect-plan-hash`, `--run-id`, `--full-refresh [true|false]`, `--fail-fast`, `--no-lock`, `--workers` (`PIPELOOM_WORKERS`), `--boundary` and `--warn-error`. Exit codes: 0, 1, 2 and 130.
|
|
26
|
+
- Process executor for `boundary: task`: each unit runs as `python -m pipeloom run --select unit:<id>`, its events are relayed to the parent with their original invocation id and sequence, and its logs go to `runs/<run_id>/logs/`.
|
|
27
|
+
- Unit mode (`--select unit:<id>`): no lock, no `run.*` events and no results file. The `unit:` selector method and `apply_to_plan` select over a manifest.
|
|
28
|
+
- Run console output with one line per unit, a summary, the failure block and the artifacts line.
|
|
29
|
+
- Diagnostics PLX103 (plan hash mismatch), PLX105 (run lock held), PLX106 (unit process died without a result), PLX107 (manifest invalid) and PLG306 (unknown unit).
|
|
30
|
+
- `pipeloom.testing.contract.engine`: `EngineHarness`, `requires` and `EngineContract`, gated by the capabilities an engine declares. `EventBus.forward` relays events from another process, and a per-invocation run file sink writes `runs/<run_id>/events/<invocation_id>.jsonl`.
|
|
31
|
+
- Filesystem table format (`pipeloom.builtins.fs_table`): part files plus an atomically replaced `_pipeloom/commit.json` with a format version, an idempotency token log (last 100), overwrite garbage collection and view definitions. ADR-0022.
|
|
32
|
+
- The `filesystem` catalog is implemented, with options `root` and `format` (`parquet`, `csv` or `ndjson`); it works with the polars and pandas engines.
|
|
33
|
+
- `pipeloom.engine.portable`: Narwhals helpers (`to_frame_api`, `from_frame_api`, `schema`, `count`, `max_value`, `filter_since`, `logical_dtype`). `narwhals>=2.0` is a core dependency, and an import-linter contract keeps it confined to that module.
|
|
34
|
+
- State stores in `pipeloom.state`: `StateKey`, `Watermark`, `RunRecord`, `UnitRecord`, `LockInfo`, `LockHeld` and the `StateStore` protocol, with a JSON codec and a run lock that is a 60 s lease renewed by a heartbeat thread every 20 s.
|
|
35
|
+
- Built-in `sqlite` state store (WAL, one connection per call, schema version 1) and `json` directory state store (atomic file replace, `O_EXCL` lock files, stale lock takeover). `sqlite` is local to one machine; `json` is shared.
|
|
36
|
+
- The `state` block of a target is bound and validated; without one, `sqlite` at `.pipeloom/state.db` is used. Relative state paths resolve against the project directory.
|
|
37
|
+
- PLC503: `boundary: task` with a state store that is not shared.
|
|
38
|
+
- `pipeloom.testing.contract.state.StateStoreContract`, a pytest suite state store plugins subclass.
|
|
39
|
+
- Import contracts (layers, `pipeloom.testing` isolation, no dataframe or SQL parsing library in the core) checked by `uv run lint-imports` in the `lint` CI job and `make lint`.
|
|
40
|
+
- Unit state machine with a checked transition table, and a ready-queue scheduler with skip-downstream, `--fail-fast` and stop requests.
|
|
41
|
+
- Thread executor and a simulated executor for tests; `unit.queued`, `unit.skipped` and `unit.cancelled` event payloads.
|
|
42
|
+
- ADR-0020, the execution model for 0.2.
|
|
43
|
+
- Model runner: `pipeloom.runtime.runner.ModelRunner` runs one unit (reads inputs, runs a SQL or Python body, writes a table or creates a view, records the attempt). `ModelContext`, `CallableLoader` (puts `python_paths` on `sys.path` for the run only), `EphemeralMemo` (an ephemeral model shared by several units is computed once) and `ErrorInfo` with a trace excerpt and a transient or permanent category.
|
|
44
|
+
- `Project.run(RunOptions, bus)` and `pipeloom.runtime.run.execute_run` run the selected units on the thread executor, take the run lock, record the run in the state store and finalize. Reusing a run id continues the run.
|
|
45
|
+
- Run artifacts in `pipeloom.artifacts`: `RunPaths`, `write_json_atomic`, `run_results.json` (`pipeloom.run_results/1`, one row per persisted model) and finalize, which copies `manifest.json` and `run_results.json` to the artifacts root (`target` by default).
|
|
46
|
+
- Events `run.started`, `run.compiled`, `run.completed`, `unit.started`, `unit.succeeded`, `unit.failed`, `model.input_read`, `model.written` and `model.log`.
|
|
47
|
+
- Codes PLX101 (model raised), PLM201 (write failed), PLM204 (input read failed), PLC509 (materialization unsupported by the engine) and PLP409 (a view must be plain SQL).
|
|
48
|
+
- `MemoryCatalog(root=...)` and the memory engine option `root` keep tables as JSON files, so tests can share them between processes. The memory engine supports views.
|
|
49
|
+
- ADR-0021, the plugin API (0, 2).
|
|
50
|
+
|
|
51
|
+
### Changed
|
|
52
|
+
|
|
53
|
+
- Plugin API version is (0, 2): `Engine.version`, `Engine.session(ctx, *, catalog)`, and `EngineSession.relation`, `persist` and `create_view`. Plugins built for (0, 1) fail with PLU001.
|
|
54
|
+
- A model with a materialization the engine does not declare (`incremental`, `intermediate`) is rejected with PLC509.
|
|
55
|
+
- The import-linter layers include `pipeloom.artifacts` next to `pipeloom.state`, and imports under `TYPE_CHECKING` are ignored.
|
|
56
|
+
|
|
57
|
+
## [0.1.0] - 2026-11-04
|
|
58
|
+
|
|
59
|
+
First functional release: configuration, layered validation, the dependency graph, selectors,
|
|
60
|
+
the plan and manifest, the event bus and the CLI. Running plans comes in 0.2.
|
|
61
|
+
|
|
62
|
+
### Added
|
|
63
|
+
|
|
64
|
+
- Diagnostics package with the full error-code catalog (active and reserved codes), text and JSON rendering.
|
|
65
|
+
- YAML loader with YAML 1.2 core scalars, source marks, duplicate-key detection, merge keys and an alias expansion limit (ADR-0019).
|
|
66
|
+
- `${env:...}` and `${var:...}` interpolation, and a secret-like field check (PLS104).
|
|
67
|
+
- Pydantic configuration models for `pipeloom.yml`, model files and `_defaults.yml`, with schema errors mapped to file locations and did-you-mean hints.
|
|
68
|
+
- `pipeloom validate` with `--project-dir` (`PIPELOOM_PROJECT_DIR`), `--vars` and `--warn-error`; exit codes 0, 1, 2 and 130.
|
|
69
|
+
- Python API: `pipeloom.api.Project` and `ProjectOptions`; `pipeloom.platform` clock and identity seams.
|
|
70
|
+
- Plugin system: `pipeloom.plugins` with `PluginSpec`, `PluginRegistry`, `API_VERSION` and `check_api`; entry-point discovery that reads metadata only, `--plugin module:attr`, `PIPELOOM_DISABLE_PLUGIN_AUTOLOAD`, and codes PLU001 to PLU003 (ADR-0017).
|
|
71
|
+
- Built-in plugins from a lazy in-code table: `memory` engine and catalog, `none`, `prefix` and `per_user` naming, `env` secret provider, and the `filesystem` catalog spec (implementation in 0.2).
|
|
72
|
+
- Engine contracts: `pipeloom.engine` types and protocols, `RuntimeContext`, and `pipeloom.testing.memory` (MemoryEngine and MemoryCatalog on sqlite3).
|
|
73
|
+
- Target binding: `--target` (`PIPELOOM_TARGET`), `default_target`, runtime merge and plugin option validation, with codes PLR204 and PLR207. `Project.bind()` in the API.
|
|
74
|
+
- `pipeloom schema export` writes JSON Schemas for `pipeloom.yml`, model files and `_defaults.yml`, with plugin options as `oneOf` branches.
|
|
75
|
+
- `pipeloom plugins list` with `--group`, `--output`, `--check` and `--plugin`.
|
|
76
|
+
- Model settings resolution: `_defaults.yml` cascades from the model's folder up to its model_paths root, then `defaults.models`; mappings merge deeply, lists replace and `tags` is a deduplicated union. Unique ids `model.<project>.<name>` and `source.<project>.<name>`.
|
|
77
|
+
- L2 reference checks (PLR201, PLR202, PLR203, PLR205) with did-you-mean hints.
|
|
78
|
+
- Dependency graph with deterministic topological order, depth-limited ancestors and descendants, and cycle detection (PLG301, PLG302).
|
|
79
|
+
- Selector engine: space union, comma intersection, `N+` and `+N` graph operators, and the `name`, `tag`, `path` and `materialized` methods (PLG303 to PLG305).
|
|
80
|
+
- `Project.resolve()` in the API runs load, bind, resolve, L2 and graph.
|
|
81
|
+
- `pipeloom ls` (`--output text|json`) and `pipeloom graph` (`--output text|dot|mermaid|json`), both with repeatable `-s/--select` and `--exclude`. A malformed selector (PLG304, PLG305) exits 2; a selector that matches nothing (PLG303) is a warning.
|
|
82
|
+
- Typed events (`pipeloom.event/1`) and a synchronous event bus with failure budgets, redaction and context-manager close; `console`, `jsonl` and buffered sinks; code PLE401 (ADR-0018).
|
|
83
|
+
- `--log-format text|json` (`PIPELOOM_LOG_FORMAT`) on every command; `console` and `jsonl` sinks configurable under `events.sinks`.
|
|
84
|
+
- `pipeloom.testing.RecordingSink` and `FakeClock`.
|
|
85
|
+
- Plan model (`pipeloom.plan`): frozen `Plan`, `PlanNode`, `ExecutionUnit`; one unit per non-ephemeral model with its inlined ephemeral ancestors, identical for both boundaries; target relations from the bound naming strategy.
|
|
86
|
+
- Manifest `pipeloom.manifest/1` with `plan_hash` and per-node checksums (CRLF read as LF), `write_manifest`, `read_manifest` and `compute_plan_hash`.
|
|
87
|
+
- L4 plan semantics (PLP401 to PLP408), L5 capability checks read from the engine spec without importing it (PLC501, PLC502, PLC504 to PLC508) and L6 static checks of Python callables (PLK601, PLK602, PLK604).
|
|
88
|
+
- `Project.validate()` and `Project.compile(selection, boundary)` in the API; `pipeloom validate` now runs L0 to L6.
|
|
89
|
+
- `pipeloom compile` with the selection options, `--boundary`, `--out` and `--warn-error`; it emits `plan.compiled` and `artifact.written`.
|
|
90
|
+
- Generated docs: error codes, JSON Schemas under `schema/v1/`, the command-line reference, a quickstart and the schema guide.
|
|
91
|
+
|
|
92
|
+
### Changed
|
|
93
|
+
|
|
94
|
+
- `pipeloom validate` binds the selected target and checks plugin options, and accepts `--target` and `--plugin`.
|
|
95
|
+
- Diagnostics and the run summary go to stderr through the event bus; the summary line now reads `<command> finished in N ms | exit C | E error(s), W warning(s)`. `rich>=13.7` is a new dependency.
|
|
96
|
+
- PLS104 matches secret words in key segments (`max_tokens` is no longer flagged) and ignores booleans.
|
|
97
|
+
- The CLI needs `click>=8.2`; runtime dependencies now include pydantic and PyYAML.
|
|
98
|
+
- CI tests Python 3.11 to 3.14 on Ubuntu, Windows and macOS now that the repository is public.
|
|
99
|
+
- PLE401 names the exception type and the sink's configured path instead of the OS error text.
|
|
100
|
+
|
|
101
|
+
## [0.0.2] - 2026-10-29
|
|
102
|
+
|
|
103
|
+
0.0.1 was never published: PyPI rejects that file name because an unrelated, deleted project
|
|
104
|
+
once used it.
|
|
105
|
+
|
|
106
|
+
### Added
|
|
107
|
+
|
|
108
|
+
- Package skeleton with `pipeloom --version` and `__version__`.
|
|
109
|
+
- CI, release and docs workflows.
|
|
110
|
+
- Apache-2.0 license, contributing guide, code of conduct, security policy and governance.
|
|
111
|
+
|
|
112
|
+
[Unreleased]: https://github.com/emanuel-luis/pipeloom/compare/v0.2.0...HEAD
|
|
113
|
+
[0.2.0]: https://github.com/emanuel-luis/pipeloom/compare/v0.1.0...v0.2.0
|
|
114
|
+
[0.1.0]: https://github.com/emanuel-luis/pipeloom/compare/v0.0.2...v0.1.0
|
|
115
|
+
[0.0.2]: https://github.com/emanuel-luis/pipeloom/releases/tag/v0.0.2
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: pipeloom
|
|
3
|
-
Version: 0.0
|
|
3
|
+
Version: 0.2.0
|
|
4
4
|
Summary: Declarative, engine-agnostic data pipelines in YAML.
|
|
5
5
|
Project-URL: Repository, https://github.com/emanuel-luis/pipeloom
|
|
6
6
|
Project-URL: Documentation, https://emanuel-luis.github.io/pipeloom/
|
|
@@ -10,7 +10,7 @@ License-Expression: Apache-2.0
|
|
|
10
10
|
License-File: LICENSE
|
|
11
11
|
License-File: NOTICE
|
|
12
12
|
Keywords: data-engineering,declarative,etl,orchestration,pipelines,yaml
|
|
13
|
-
Classifier: Development Status ::
|
|
13
|
+
Classifier: Development Status :: 3 - Alpha
|
|
14
14
|
Classifier: Intended Audience :: Developers
|
|
15
15
|
Classifier: Programming Language :: Python :: 3
|
|
16
16
|
Classifier: Programming Language :: Python :: 3 :: Only
|
|
@@ -20,14 +20,35 @@ Classifier: Programming Language :: Python :: 3.13
|
|
|
20
20
|
Classifier: Programming Language :: Python :: 3.14
|
|
21
21
|
Classifier: Typing :: Typed
|
|
22
22
|
Requires-Python: >=3.11
|
|
23
|
-
Requires-Dist: click>=8.
|
|
23
|
+
Requires-Dist: click>=8.2
|
|
24
|
+
Requires-Dist: narwhals>=2.0
|
|
25
|
+
Requires-Dist: pydantic>=2.12
|
|
26
|
+
Requires-Dist: pyyaml>=6.0.2
|
|
27
|
+
Requires-Dist: rich>=13.7
|
|
28
|
+
Provides-Extra: pandas
|
|
29
|
+
Requires-Dist: pipeloom-pandas==0.2.0; extra == 'pandas'
|
|
30
|
+
Provides-Extra: polars
|
|
31
|
+
Requires-Dist: pipeloom-polars==0.2.0; extra == 'polars'
|
|
32
|
+
Provides-Extra: sqlglot
|
|
33
|
+
Requires-Dist: sqlglot>=26; extra == 'sqlglot'
|
|
24
34
|
Description-Content-Type: text/markdown
|
|
25
35
|
|
|
26
36
|
# pipeloom
|
|
27
37
|
|
|
28
38
|
Declarative, engine-agnostic data pipelines in YAML.
|
|
29
39
|
|
|
30
|
-
|
|
31
|
-
|
|
40
|
+
pipeloom 0.2 reads a YAML project, validates it in layers, builds the dependency graph, compiles
|
|
41
|
+
the execution plan into a manifest and runs it on polars or pandas. Every run writes
|
|
42
|
+
`run_results.json` with one row per model.
|
|
43
|
+
|
|
44
|
+
```console
|
|
45
|
+
$ pip install "pipeloom[polars]" # or pipeloom[pandas]
|
|
46
|
+
$ pipeloom validate
|
|
47
|
+
$ pipeloom run
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
Documentation: https://emanuel-luis.github.io/pipeloom/latest/
|
|
51
|
+
|
|
52
|
+
Source: https://github.com/emanuel-luis/pipeloom
|
|
32
53
|
|
|
33
54
|
License: Apache-2.0.
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# pipeloom
|
|
2
|
+
|
|
3
|
+
Declarative, engine-agnostic data pipelines in YAML.
|
|
4
|
+
|
|
5
|
+
pipeloom 0.2 reads a YAML project, validates it in layers, builds the dependency graph, compiles
|
|
6
|
+
the execution plan into a manifest and runs it on polars or pandas. Every run writes
|
|
7
|
+
`run_results.json` with one row per model.
|
|
8
|
+
|
|
9
|
+
```console
|
|
10
|
+
$ pip install "pipeloom[polars]" # or pipeloom[pandas]
|
|
11
|
+
$ pipeloom validate
|
|
12
|
+
$ pipeloom run
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
Documentation: https://emanuel-luis.github.io/pipeloom/latest/
|
|
16
|
+
|
|
17
|
+
Source: https://github.com/emanuel-luis/pipeloom
|
|
18
|
+
|
|
19
|
+
License: Apache-2.0.
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["hatchling"]
|
|
3
|
+
build-backend = "hatchling.build"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "pipeloom"
|
|
7
|
+
version = "0.2.0"
|
|
8
|
+
description = "Declarative, engine-agnostic data pipelines in YAML."
|
|
9
|
+
readme = "README.pypi.md"
|
|
10
|
+
requires-python = ">=3.11"
|
|
11
|
+
license = "Apache-2.0"
|
|
12
|
+
license-files = ["LICENSE", "NOTICE"]
|
|
13
|
+
authors = [{ name = "Emanuel Luis", email = "emanuel.filho08@gmail.com" }]
|
|
14
|
+
keywords = ["data-engineering", "pipelines", "yaml", "declarative", "etl", "orchestration"]
|
|
15
|
+
classifiers = [
|
|
16
|
+
"Development Status :: 3 - Alpha",
|
|
17
|
+
"Intended Audience :: Developers",
|
|
18
|
+
"Programming Language :: Python :: 3",
|
|
19
|
+
"Programming Language :: Python :: 3 :: Only",
|
|
20
|
+
"Programming Language :: Python :: 3.11",
|
|
21
|
+
"Programming Language :: Python :: 3.12",
|
|
22
|
+
"Programming Language :: Python :: 3.13",
|
|
23
|
+
"Programming Language :: Python :: 3.14",
|
|
24
|
+
"Typing :: Typed",
|
|
25
|
+
]
|
|
26
|
+
dependencies = [
|
|
27
|
+
"click>=8.2",
|
|
28
|
+
"narwhals>=2.0",
|
|
29
|
+
"pydantic>=2.12",
|
|
30
|
+
"pyyaml>=6.0.2",
|
|
31
|
+
"rich>=13.7",
|
|
32
|
+
]
|
|
33
|
+
|
|
34
|
+
[project.optional-dependencies]
|
|
35
|
+
polars = ["pipeloom-polars==0.2.0"]
|
|
36
|
+
pandas = ["pipeloom-pandas==0.2.0"]
|
|
37
|
+
sqlglot = ["sqlglot>=26"]
|
|
38
|
+
|
|
39
|
+
[project.urls]
|
|
40
|
+
Repository = "https://github.com/emanuel-luis/pipeloom"
|
|
41
|
+
Documentation = "https://emanuel-luis.github.io/pipeloom/"
|
|
42
|
+
Changelog = "https://github.com/emanuel-luis/pipeloom/blob/main/CHANGELOG.md"
|
|
43
|
+
|
|
44
|
+
[project.scripts]
|
|
45
|
+
pipeloom = "pipeloom.cli:main"
|
|
46
|
+
|
|
47
|
+
[dependency-groups]
|
|
48
|
+
dev = [
|
|
49
|
+
"pytest",
|
|
50
|
+
"pytest-cov",
|
|
51
|
+
"mypy",
|
|
52
|
+
"ruff",
|
|
53
|
+
"pre-commit",
|
|
54
|
+
"hypothesis>=6.170.14",
|
|
55
|
+
"pytest-timeout>=2.4.0",
|
|
56
|
+
"types-pyyaml>=6.0.12.20261103",
|
|
57
|
+
"jsonschema>=4.26.0",
|
|
58
|
+
"import-linter>=2.15",
|
|
59
|
+
"polars>=2.1.0",
|
|
60
|
+
"pandas>=3.1.0",
|
|
61
|
+
"pyarrow>=26.0.1",
|
|
62
|
+
"sqlglot>=26",
|
|
63
|
+
]
|
|
64
|
+
docs = ["mkdocs-material", "mkdocstrings[python]", "mkdocs-click", "mike"]
|
|
65
|
+
|
|
66
|
+
[tool.uv.workspace]
|
|
67
|
+
members = ["plugins/*"]
|
|
68
|
+
|
|
69
|
+
[tool.uv.sources]
|
|
70
|
+
pipeloom-polars = { workspace = true }
|
|
71
|
+
pipeloom-pandas = { workspace = true }
|
|
72
|
+
|
|
73
|
+
[tool.hatch.build.targets.wheel]
|
|
74
|
+
packages = ["src/pipeloom"]
|
|
75
|
+
|
|
76
|
+
[tool.hatch.build.targets.sdist]
|
|
77
|
+
only-include = ["src", "tests", "CHANGELOG.md"]
|
|
78
|
+
|
|
79
|
+
[tool.ruff]
|
|
80
|
+
extend-exclude = ["docs"]
|
|
81
|
+
line-length = 100
|
|
82
|
+
src = ["src", "tests", "plugins/pipeloom-polars/src", "plugins/pipeloom-pandas/src"]
|
|
83
|
+
|
|
84
|
+
[tool.ruff.lint]
|
|
85
|
+
extend-select = ["BLE", "I", "UP", "B"]
|
|
86
|
+
|
|
87
|
+
[tool.mypy]
|
|
88
|
+
strict = true
|
|
89
|
+
files = [
|
|
90
|
+
"src",
|
|
91
|
+
"tests",
|
|
92
|
+
"plugins/pipeloom-polars/src",
|
|
93
|
+
"plugins/pipeloom-polars/tests",
|
|
94
|
+
"plugins/pipeloom-pandas/src",
|
|
95
|
+
"plugins/pipeloom-pandas/tests",
|
|
96
|
+
]
|
|
97
|
+
|
|
98
|
+
[[tool.mypy.overrides]]
|
|
99
|
+
module = ["pandas", "pandas.*", "pyarrow", "pyarrow.*"]
|
|
100
|
+
ignore_missing_imports = true
|
|
101
|
+
|
|
102
|
+
[tool.pytest.ini_options]
|
|
103
|
+
addopts = "-ra --strict-markers --strict-config --import-mode=importlib"
|
|
104
|
+
timeout = 60
|
|
105
|
+
testpaths = ["tests", "plugins/pipeloom-polars/tests", "plugins/pipeloom-pandas/tests"]
|
|
106
|
+
pythonpath = ["."]
|
|
107
|
+
|
|
108
|
+
[tool.importlinter]
|
|
109
|
+
root_package = "pipeloom"
|
|
110
|
+
include_external_packages = true
|
|
111
|
+
exclude_type_checking_imports = true
|
|
112
|
+
|
|
113
|
+
# Top to bottom. A layer may import the ones below it. `:` marks siblings that import each other
|
|
114
|
+
# today (config, secrets and events form a cycle in 0.1). `pipeloom.runtime` is listed before the
|
|
115
|
+
# scheduler lands; `pipeloom.artifacts` joins the `state` layer with the PR that creates it
|
|
116
|
+
# (import-linter rejects a layer whose module does not exist). Imports under TYPE_CHECKING are
|
|
117
|
+
# ignored, so protocols may name runtime types in signatures. `pipeloom.testing` is outside the
|
|
118
|
+
# layers: it may import anything, and the second contract keeps the rest from importing it.
|
|
119
|
+
[[tool.importlinter.contracts]]
|
|
120
|
+
name = "Layers"
|
|
121
|
+
type = "layers"
|
|
122
|
+
layers = [
|
|
123
|
+
"pipeloom.cli",
|
|
124
|
+
"pipeloom.api",
|
|
125
|
+
"pipeloom.runtime",
|
|
126
|
+
"pipeloom.artifacts | pipeloom.state | pipeloom.builtins",
|
|
127
|
+
"pipeloom.plan",
|
|
128
|
+
"pipeloom.validate",
|
|
129
|
+
"pipeloom.graph",
|
|
130
|
+
"pipeloom.config : pipeloom.secrets : pipeloom.events",
|
|
131
|
+
"pipeloom.plugins",
|
|
132
|
+
"pipeloom.engine",
|
|
133
|
+
"pipeloom.diagnostics | pipeloom.platform",
|
|
134
|
+
]
|
|
135
|
+
exhaustive = false
|
|
136
|
+
|
|
137
|
+
[[tool.importlinter.contracts]]
|
|
138
|
+
name = "Only pipeloom.testing imports pipeloom.testing"
|
|
139
|
+
type = "forbidden"
|
|
140
|
+
# Every top-level module except testing: with `pipeloom` as the source, testing would be one too.
|
|
141
|
+
source_modules = [
|
|
142
|
+
"pipeloom.__main__",
|
|
143
|
+
"pipeloom.api",
|
|
144
|
+
"pipeloom.artifacts",
|
|
145
|
+
"pipeloom.builtins",
|
|
146
|
+
"pipeloom.cli",
|
|
147
|
+
"pipeloom.config",
|
|
148
|
+
"pipeloom.diagnostics",
|
|
149
|
+
"pipeloom.engine",
|
|
150
|
+
"pipeloom.events",
|
|
151
|
+
"pipeloom.graph",
|
|
152
|
+
"pipeloom.plan",
|
|
153
|
+
"pipeloom.platform",
|
|
154
|
+
"pipeloom.plugins",
|
|
155
|
+
"pipeloom.runtime",
|
|
156
|
+
"pipeloom.secrets",
|
|
157
|
+
"pipeloom.state",
|
|
158
|
+
"pipeloom.validate",
|
|
159
|
+
]
|
|
160
|
+
forbidden_modules = ["pipeloom.testing"]
|
|
161
|
+
|
|
162
|
+
[[tool.importlinter.contracts]]
|
|
163
|
+
name = "No dataframe or SQL parsing library in the core"
|
|
164
|
+
type = "forbidden"
|
|
165
|
+
source_modules = ["pipeloom"]
|
|
166
|
+
forbidden_modules = ["polars", "pandas", "pyarrow", "sqlglot"]
|
|
167
|
+
ignore_imports = ["pipeloom.validate.static -> sqlglot"]
|
|
168
|
+
|
|
169
|
+
[[tool.importlinter.contracts]]
|
|
170
|
+
name = "Only pipeloom.engine.portable imports narwhals"
|
|
171
|
+
type = "forbidden"
|
|
172
|
+
source_modules = ["pipeloom"]
|
|
173
|
+
forbidden_modules = ["narwhals"]
|
|
174
|
+
ignore_imports = ["pipeloom.engine.portable -> narwhals"]
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
"""The public API: the same calls the CLI makes."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
import uuid
|
|
6
|
+
from typing import Literal
|
|
7
|
+
|
|
8
|
+
from pipeloom.config.bind import BoundProject, bind_project
|
|
9
|
+
from pipeloom.config.load import LoadedProject, ProjectOptions, load_project
|
|
10
|
+
from pipeloom.config.resolve import resolve_project
|
|
11
|
+
from pipeloom.diagnostics import Diagnostic, Outcome, Report
|
|
12
|
+
from pipeloom.events.bus import EventBus
|
|
13
|
+
from pipeloom.graph.dag import ProjectGraph, build_graph
|
|
14
|
+
from pipeloom.graph.selectors import Selection
|
|
15
|
+
from pipeloom.plan.compile import compile_plan
|
|
16
|
+
from pipeloom.plan.model import Plan
|
|
17
|
+
from pipeloom.platform import Clock, Identity, IdentityProvider, LocalIdentity, SystemClock
|
|
18
|
+
from pipeloom.plugins import PluginRegistry
|
|
19
|
+
from pipeloom.runtime.run import RunOptions, RunOutcome, execute_run
|
|
20
|
+
from pipeloom.validate import validate_project
|
|
21
|
+
from pipeloom.validate.references import check_references
|
|
22
|
+
|
|
23
|
+
__all__ = ["Project", "ProjectOptions"]
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
class Project:
|
|
27
|
+
"""A project on disk. Each step runs once and is remembered."""
|
|
28
|
+
|
|
29
|
+
def __init__(
|
|
30
|
+
self,
|
|
31
|
+
options: ProjectOptions,
|
|
32
|
+
*,
|
|
33
|
+
registry: PluginRegistry | None = None,
|
|
34
|
+
clock: Clock | None = None,
|
|
35
|
+
identity: IdentityProvider | None = None,
|
|
36
|
+
invocation_id: str | None = None,
|
|
37
|
+
) -> None:
|
|
38
|
+
self.options = options
|
|
39
|
+
self._registry = registry
|
|
40
|
+
self._registry_problems: tuple[Diagnostic, ...] = ()
|
|
41
|
+
self.clock: Clock = clock or SystemClock()
|
|
42
|
+
self._identity = identity or LocalIdentity(options.env)
|
|
43
|
+
self._loaded: Outcome[LoadedProject] | None = None
|
|
44
|
+
self._bound: Outcome[BoundProject] | None = None
|
|
45
|
+
self._resolved: Outcome[ProjectGraph] | None = None
|
|
46
|
+
self._validated: Outcome[ProjectGraph] | None = None
|
|
47
|
+
self._plans: dict[tuple[Selection, str | None], Outcome[Plan]] = {}
|
|
48
|
+
self.invocation_id = invocation_id or uuid.uuid4().hex
|
|
49
|
+
|
|
50
|
+
@property
|
|
51
|
+
def identity(self) -> Identity:
|
|
52
|
+
return self._identity.identity()
|
|
53
|
+
|
|
54
|
+
@property
|
|
55
|
+
def registry(self) -> PluginRegistry:
|
|
56
|
+
"""Discovered on first use from the options' `--plugin` specs and the environment."""
|
|
57
|
+
if self._registry is None:
|
|
58
|
+
report = Report()
|
|
59
|
+
self._registry = PluginRegistry.discover(
|
|
60
|
+
cli_plugins=self.options.plugins, env=self.options.env, report=report
|
|
61
|
+
)
|
|
62
|
+
self._registry_problems = report.sorted()
|
|
63
|
+
return self._registry
|
|
64
|
+
|
|
65
|
+
def load(self) -> Outcome[LoadedProject]:
|
|
66
|
+
"""Read and check pipeloom.yml, model files and defaults (layers L0 and L1)."""
|
|
67
|
+
if self._loaded is None:
|
|
68
|
+
report = Report()
|
|
69
|
+
value = load_project(self.options, report)
|
|
70
|
+
self._loaded = Outcome(value, report.sorted())
|
|
71
|
+
return self._loaded
|
|
72
|
+
|
|
73
|
+
def bind(self) -> Outcome[BoundProject]:
|
|
74
|
+
"""Load, then pick the target and bind its plugins."""
|
|
75
|
+
if self._bound is None:
|
|
76
|
+
loaded = self.load()
|
|
77
|
+
if loaded.value is None:
|
|
78
|
+
self._bound = Outcome(None, loaded.diagnostics)
|
|
79
|
+
else:
|
|
80
|
+
registry = self.registry
|
|
81
|
+
report = Report()
|
|
82
|
+
report.extend(loaded.diagnostics)
|
|
83
|
+
report.extend(self._registry_problems)
|
|
84
|
+
value = bind_project(loaded.value, self.options, registry, report)
|
|
85
|
+
self._bound = Outcome(value, report.sorted())
|
|
86
|
+
return self._bound
|
|
87
|
+
|
|
88
|
+
def resolve(self) -> Outcome[ProjectGraph]:
|
|
89
|
+
"""Bind, apply defaults, check references (L2) and build the graph (L3)."""
|
|
90
|
+
if self._resolved is None:
|
|
91
|
+
bound = self.bind()
|
|
92
|
+
if bound.value is None:
|
|
93
|
+
self._resolved = Outcome(None, bound.diagnostics)
|
|
94
|
+
else:
|
|
95
|
+
report = Report()
|
|
96
|
+
report.extend(bound.diagnostics)
|
|
97
|
+
project = resolve_project(bound.value)
|
|
98
|
+
check_references(project, report)
|
|
99
|
+
graph = None if report.has_errors else build_graph(project, report)
|
|
100
|
+
value = None if graph is None else ProjectGraph(project, graph)
|
|
101
|
+
self._resolved = Outcome(value, report.sorted())
|
|
102
|
+
return self._resolved
|
|
103
|
+
|
|
104
|
+
def validate(self) -> Outcome[ProjectGraph]:
|
|
105
|
+
"""Resolve, then run the plan checks (L4 to L6). None when any layer found an error."""
|
|
106
|
+
if self._validated is None:
|
|
107
|
+
self._validated = validate_project(self.resolve())
|
|
108
|
+
return self._validated
|
|
109
|
+
|
|
110
|
+
def compile(
|
|
111
|
+
self,
|
|
112
|
+
selection: Selection | None = None,
|
|
113
|
+
boundary: Literal["process", "task"] | None = None,
|
|
114
|
+
) -> Outcome[Plan]:
|
|
115
|
+
"""Validate, then build the plan. Units always cover the whole project; the selection
|
|
116
|
+
only marks which models are selected. `boundary` defaults to the target's."""
|
|
117
|
+
sel = selection or Selection()
|
|
118
|
+
key = (sel, boundary)
|
|
119
|
+
if key not in self._plans:
|
|
120
|
+
validated = self.validate()
|
|
121
|
+
if validated.value is None:
|
|
122
|
+
self._plans[key] = Outcome(None, validated.diagnostics)
|
|
123
|
+
else:
|
|
124
|
+
report = Report()
|
|
125
|
+
report.extend(validated.diagnostics)
|
|
126
|
+
plan = compile_plan(
|
|
127
|
+
validated.value,
|
|
128
|
+
selection=sel,
|
|
129
|
+
boundary=boundary,
|
|
130
|
+
registry=self.registry,
|
|
131
|
+
identity=self.identity,
|
|
132
|
+
clock=self.clock,
|
|
133
|
+
invocation_id=self.invocation_id,
|
|
134
|
+
report=report,
|
|
135
|
+
)
|
|
136
|
+
self._plans[key] = Outcome(plan, report.sorted())
|
|
137
|
+
return self._plans[key]
|
|
138
|
+
|
|
139
|
+
def run(self, opts: RunOptions | None = None, bus: EventBus | None = None) -> RunOutcome:
|
|
140
|
+
"""Validate, plan and run the selected units. Events go to `bus`; without one they are dropped."""
|
|
141
|
+
own = bus is None
|
|
142
|
+
events = bus or EventBus([], clock=self.clock, invocation_id=self.invocation_id)
|
|
143
|
+
try:
|
|
144
|
+
return execute_run(self, opts or RunOptions(), events)
|
|
145
|
+
finally:
|
|
146
|
+
if own:
|
|
147
|
+
events.close()
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
"""Merge the unit attempts of a run into `run_results.json` and publish the run's files."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
import json
|
|
6
|
+
import shutil
|
|
7
|
+
from collections.abc import Collection, Mapping
|
|
8
|
+
from dataclasses import dataclass
|
|
9
|
+
from pathlib import Path
|
|
10
|
+
from typing import Any
|
|
11
|
+
|
|
12
|
+
from pipeloom.artifacts.io import write_json_atomic
|
|
13
|
+
from pipeloom.artifacts.layout import RunPaths
|
|
14
|
+
from pipeloom.artifacts.results import RunHeader, build_run_results, result_row
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
@dataclass(frozen=True)
|
|
18
|
+
class Finalized:
|
|
19
|
+
run_results: dict[str, Any]
|
|
20
|
+
written: tuple[Path, ...]
|
|
21
|
+
"""The run's `run_results.json` and the copies under the artifacts root."""
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
def latest_attempts(paths: RunPaths) -> dict[str, dict[str, Any]]:
|
|
25
|
+
"""The newest attempt file of every unit in the run folder."""
|
|
26
|
+
out: dict[str, dict[str, Any]] = {}
|
|
27
|
+
if not paths.units_dir.is_dir():
|
|
28
|
+
return out
|
|
29
|
+
for folder in sorted(paths.units_dir.iterdir(), key=lambda p: p.name):
|
|
30
|
+
numbers = paths.attempt_numbers(folder.name)
|
|
31
|
+
if numbers:
|
|
32
|
+
raw = paths.attempt(folder.name, numbers[-1]).read_bytes().decode("utf-8")
|
|
33
|
+
out[folder.name] = json.loads(raw)
|
|
34
|
+
return out
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
def finalize(
|
|
38
|
+
paths: RunPaths,
|
|
39
|
+
header: RunHeader,
|
|
40
|
+
*,
|
|
41
|
+
unit_nodes: Mapping[str, str],
|
|
42
|
+
skipped: Mapping[str, tuple[str, str | None]],
|
|
43
|
+
cancelled: Collection[str],
|
|
44
|
+
unfinished: Collection[str] = (),
|
|
45
|
+
crashed: Mapping[str, dict[str, Any]] | None = None,
|
|
46
|
+
) -> Finalized:
|
|
47
|
+
"""Write `run_results.json` into the run folder and copy it, with the manifest, to the root.
|
|
48
|
+
|
|
49
|
+
`unit_nodes` maps unit id to the unique id of its persisted model. A skipped or cancelled
|
|
50
|
+
verdict of this invocation wins over an attempt file; every other unit uses its newest
|
|
51
|
+
attempt, including units of earlier invocations that reused the run id. `unfinished` units
|
|
52
|
+
(an internal error stopped the run) are reported as cancelled. `crashed` rows replace the
|
|
53
|
+
attempt of a unit whose runner failed before it could write one.
|
|
54
|
+
"""
|
|
55
|
+
rows = latest_attempts(paths)
|
|
56
|
+
for unit_id, (reason, _upstream) in skipped.items():
|
|
57
|
+
rows[unit_id] = result_row(
|
|
58
|
+
unique_id=unit_nodes[unit_id], unit_id=unit_id, status="skipped", skip_reason=reason
|
|
59
|
+
)
|
|
60
|
+
for unit_id in (*cancelled, *unfinished):
|
|
61
|
+
rows[unit_id] = result_row(
|
|
62
|
+
unique_id=unit_nodes[unit_id], unit_id=unit_id, status="cancelled"
|
|
63
|
+
)
|
|
64
|
+
rows.update(crashed or {})
|
|
65
|
+
results = build_run_results(header, list(rows.values()))
|
|
66
|
+
write_json_atomic(paths.run_results, results)
|
|
67
|
+
written = [paths.run_results]
|
|
68
|
+
if paths.manifest.is_file():
|
|
69
|
+
for src in (paths.manifest, paths.run_results):
|
|
70
|
+
dest = paths.root / src.name
|
|
71
|
+
tmp = dest.with_name(f"{dest.name}.copy.tmp")
|
|
72
|
+
shutil.copyfile(src, tmp)
|
|
73
|
+
tmp.replace(dest)
|
|
74
|
+
written.append(dest)
|
|
75
|
+
return Finalized(results, tuple(written))
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"""Atomic JSON files."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
import json
|
|
6
|
+
import os
|
|
7
|
+
import sys
|
|
8
|
+
import time
|
|
9
|
+
import uuid
|
|
10
|
+
from pathlib import Path
|
|
11
|
+
from typing import Any
|
|
12
|
+
|
|
13
|
+
REPLACE_RETRIES = 10
|
|
14
|
+
REPLACE_BACKOFF = 0.05
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
def json_bytes(data: Any) -> bytes:
|
|
18
|
+
"""Indented by 2, UTF-8, LF, with a trailing newline."""
|
|
19
|
+
return (json.dumps(data, indent=2, allow_nan=False, ensure_ascii=False) + "\n").encode("utf-8")
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
def write_json_atomic(path: Path, data: Any) -> int:
|
|
23
|
+
"""Write `data` next to `path`, then replace it. Returns the bytes written."""
|
|
24
|
+
content = json_bytes(data)
|
|
25
|
+
path.parent.mkdir(parents=True, exist_ok=True)
|
|
26
|
+
tmp = path.with_name(f"{path.name}.{uuid.uuid4().hex}.tmp")
|
|
27
|
+
tmp.write_bytes(content)
|
|
28
|
+
try:
|
|
29
|
+
for attempt in range(REPLACE_RETRIES):
|
|
30
|
+
try:
|
|
31
|
+
os.replace(tmp, path)
|
|
32
|
+
break
|
|
33
|
+
except PermissionError: # Windows: a reader holds the file
|
|
34
|
+
if sys.platform != "win32" or attempt == REPLACE_RETRIES - 1:
|
|
35
|
+
raise
|
|
36
|
+
time.sleep(REPLACE_BACKOFF)
|
|
37
|
+
except BaseException:
|
|
38
|
+
tmp.unlink(missing_ok=True)
|
|
39
|
+
raise
|
|
40
|
+
return len(content)
|