tasktree 0.0.22__py3-none-any.whl → 0.0.23__py3-none-any.whl

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.
tasktree/substitution.py CHANGED
@@ -256,7 +256,7 @@ def substitute_dependency_args(
256
256
  Example:
257
257
  >>> substitute_dependency_args("{{ arg.mode }}", "build", {"mode": "debug"})
258
258
  'debug'
259
- @athena: 3d07a1b4e6bc
259
+ @athena: 4ffd5664e3ec
260
260
  """
261
261
  # Check for disallowed placeholder types in dependency args
262
262
  # Only {{ arg.* }} is allowed, not {{ var.* }}, {{ env.* }}, or {{ tt.* }}
@@ -361,7 +361,7 @@ def substitute_dependency_outputs(
361
361
  ... {"build": build_task}
362
362
  ... )
363
363
  'Deploy dist/app.js'
364
- @athena: 1e537c8d579c
364
+ @athena: 3fbf79c15ee9
365
365
  """
366
366
 
367
367
  def replacer(match: re.Match) -> str:
tasktree/types.py CHANGED
@@ -122,7 +122,7 @@ class IPv6Type(click.ParamType):
122
122
  class DateTimeType(click.ParamType):
123
123
  """
124
124
  Validates datetime in format YYYY-MM-DDTHH:MM:SS.
125
- @athena: c3bafa3e22e3
125
+ @athena: 0b935a25fb23
126
126
  """
127
127
 
128
128
  name = "datetime"
@@ -131,7 +131,7 @@ class DateTimeType(click.ParamType):
131
131
  self, value: Any, param: Optional[click.Parameter], ctx: Optional[click.Context]
132
132
  ) -> str:
133
133
  """
134
- @athena: 13fa66adfe94
134
+ @athena: 9c7bb2d672cc
135
135
  """
136
136
  if isinstance(value, str):
137
137
  try:
@@ -180,7 +180,7 @@ def get_click_type(
180
180
 
181
181
  Raises:
182
182
  ValueError: If type_name is not recognized
183
- @athena: d0912868676f
183
+ @athena: 523ff9c66303
184
184
  """
185
185
  if type_name not in TYPE_MAPPING:
186
186
  raise ValueError(f"Unknown type: {type_name}")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: tasktree
3
- Version: 0.0.22
3
+ Version: 0.0.23
4
4
  Summary: A task automation tool with incremental execution
5
5
  Requires-Python: >=3.11
6
6
  Requires-Dist: click>=8.1.0
@@ -251,6 +251,7 @@ tasks:
251
251
  working_dir: subproject/ # Execution directory (default: project root)
252
252
  env: bash-strict # Execution environment (optional)
253
253
  private: false # Hide from --list output (default: false)
254
+ task_output: all # Control task output: all, out, err, on-err, none (default: all)
254
255
  args: # Task parameters
255
256
  - param1 # Simple argument
256
257
  - param2: { type: path, default: "." } # With type and default
@@ -877,7 +878,8 @@ tasks:
877
878
  inputs: [src/app-{{ var.version }}.c]
878
879
  outputs: [build/app-{{ var.version }}.o]
879
880
  cmd: gcc src/app-{{ var.version }}.c -o build/app-{{ var.version }}.o
880
-
881
+ ```
882
+ ```yaml
881
883
  # With self-references - DRY
882
884
  tasks:
883
885
  build:
@@ -1619,6 +1621,14 @@ tt -o deploy
1619
1621
  # Override environment for all tasks
1620
1622
  tt --env python analyze
1621
1623
  tt -e powershell build
1624
+
1625
+ # Control task subprocess output display
1626
+ tt --task-output all build # Show both stdout and stderr (default)
1627
+ tt --task-output out test # Show only stdout
1628
+ tt --task-output err deploy # Show only stderr
1629
+ tt --task-output on-err ci # Show stderr only if task fails
1630
+ tt --task-output none build # Suppress all task output
1631
+ tt -O none build # Short form
1622
1632
  ```
1623
1633
 
1624
1634
  ### Information Commands
@@ -1647,8 +1657,6 @@ tt --init
1647
1657
  ```bash
1648
1658
  # Remove state file (reset task cache)
1649
1659
  tt --clean
1650
- tt --clean-state
1651
- tt --reset
1652
1660
  ```
1653
1661
 
1654
1662
  ### Common Workflows
@@ -1667,6 +1675,194 @@ tt --env python test
1667
1675
  tt --force deploy production
1668
1676
  ```
1669
1677
 
1678
+ ### Logging Control
1679
+
1680
+ Task Tree provides fine-grained control over diagnostic logging verbosity through the `--log-level` flag. This allows you to adjust the amount of information displayed about task execution, from minimal error-only output to detailed trace logging.
1681
+
1682
+ **Log Levels:**
1683
+
1684
+ ```bash
1685
+ # Show only fatal errors (malformed task files, missing dependencies)
1686
+ tt --log-level fatal build
1687
+
1688
+ # Show fatal errors and task execution failures
1689
+ tt --log-level error build
1690
+
1691
+ # Show errors and warnings (deprecated features, configuration issues)
1692
+ tt --log-level warn build
1693
+
1694
+ # Show normal execution progress (default)
1695
+ tt --log-level info build
1696
+ tt build # Same as above
1697
+
1698
+ # Show detailed diagnostics (variable values, resolved paths, environment details)
1699
+ tt --log-level debug build
1700
+
1701
+ # Show fine-grained execution tracing
1702
+ tt --log-level trace build
1703
+ ```
1704
+
1705
+ **Short Form:**
1706
+
1707
+ ```bash
1708
+ tt -L debug build
1709
+ tt -L trace test
1710
+ ```
1711
+
1712
+ **Case Insensitive:**
1713
+
1714
+ ```bash
1715
+ tt --log-level INFO build # Works
1716
+ tt --log-level Debug test # Works
1717
+ tt --log-level TRACE deploy # Works
1718
+ ```
1719
+
1720
+ **Common Use Cases:**
1721
+
1722
+ **Debugging Workflows:**
1723
+ ```bash
1724
+ # See variable substitution and resolved paths
1725
+ tt --log-level debug deploy production
1726
+
1727
+ # See detailed execution steps and internal state
1728
+ tt --log-level trace build
1729
+ ```
1730
+
1731
+ **CI/CD Environments:**
1732
+ ```bash
1733
+ # Suppress progress messages, show only errors
1734
+ tt --log-level error build test package
1735
+
1736
+ # Minimal output for clean build logs
1737
+ tt --log-level warn ci
1738
+ ```
1739
+
1740
+ **Normal Development:**
1741
+ ```bash
1742
+ # Default level shows normal execution progress
1743
+ tt build test
1744
+ ```
1745
+
1746
+ **Understanding Log Levels:**
1747
+
1748
+ - **FATAL** (least verbose): Only unrecoverable errors that prevent execution
1749
+ - **ERROR**: Fatal errors plus individual task failures
1750
+ - **WARN**: Errors plus warnings about deprecated features or configuration issues
1751
+ - **INFO** (default): Normal execution progress messages
1752
+ - **DEBUG**: Info plus variable values, resolved paths, environment configuration
1753
+ - **TRACE** (most verbose): Debug plus fine-grained execution tracing
1754
+
1755
+ Log levels are hierarchical - setting a higher verbosity level (e.g., DEBUG) includes all messages from lower levels (FATAL, ERROR, WARN, INFO).
1756
+
1757
+ **Note:** The `--log-level` flag controls Task Tree's own diagnostic messages. It does not affect the output of task commands themselves - use `--task-output` to control task subprocess output (see below).
1758
+
1759
+ ### Task Output Control
1760
+
1761
+ Task Tree provides fine-grained control over task subprocess output through the `--task-output` flag. This allows you to control whether tasks display their stdout, stderr, both, or neither, independent of Task Tree's own diagnostic logging.
1762
+
1763
+ **Output Modes:**
1764
+
1765
+ ```bash
1766
+ # Show both stdout and stderr (default)
1767
+ tt --task-output all build
1768
+ tt -O all build
1769
+ tt build # Same as above
1770
+
1771
+ # Show only stdout, suppress stderr
1772
+ tt --task-output out build
1773
+ tt -O out test
1774
+
1775
+ # Show only stderr, suppress stdout
1776
+ tt --task-output err build
1777
+ tt -O err deploy
1778
+
1779
+ # Show stderr only if the task fails (stdout always suppressed)
1780
+ tt --task-output on-err build
1781
+ tt -O on-err ci
1782
+
1783
+ # Suppress all task output
1784
+ tt --task-output none build
1785
+ tt -O none build
1786
+ ```
1787
+
1788
+ **Case Insensitive:**
1789
+
1790
+ ```bash
1791
+ tt --task-output ALL build # Works
1792
+ tt --task-output Out test # Works
1793
+ tt --task-output ON-ERR ci # Works
1794
+ ```
1795
+
1796
+ **Common Use Cases:**
1797
+
1798
+ **CI/CD Environments:**
1799
+ ```bash
1800
+ # Suppress task output, show only tasktree diagnostics
1801
+ tt --log-level info --task-output none build test
1802
+
1803
+ # Show errors only if they occur
1804
+ tt --log-level error --task-output on-err ci
1805
+ ```
1806
+
1807
+ **Debugging:**
1808
+ ```bash
1809
+ # Show only stderr to focus on warnings/errors
1810
+ tt --task-output err build
1811
+
1812
+ # Show everything for full visibility
1813
+ tt --log-level debug --task-output all build
1814
+ ```
1815
+
1816
+ **Clean Build Logs:**
1817
+ ```bash
1818
+ # Suppress noisy build output, show only tasktree progress
1819
+ tt --task-output none build package deploy
1820
+ ```
1821
+
1822
+ **Task-Level Configuration:**
1823
+
1824
+ Tasks can specify their own default output behavior in the recipe file:
1825
+
1826
+ ```yaml
1827
+ tasks:
1828
+ # Noisy task - suppress output by default
1829
+ install-deps:
1830
+ task_output: none
1831
+ cmd: npm install
1832
+
1833
+ # Let pytest manage its own output - it's already good at that
1834
+ test:
1835
+ cmd: pytest tests/
1836
+
1837
+ # Don't clutter CI logs with loads of output, unless something goes wrong
1838
+ build:
1839
+ task_output: on-err
1840
+ cmd: cargo build --release
1841
+ ```
1842
+
1843
+ **Understanding Output Modes:**
1844
+
1845
+ | Mode | Stdout | Stderr | Notes |
1846
+ |------|--------|--------|-------|
1847
+ | `all` | ✓ | ✓ | Default behavior, shows everything |
1848
+ | `out` | ✓ | ✗ | Good for capturing command results |
1849
+ | `err` | ✗ | ✓ | Focus on warnings and errors |
1850
+ | `on-err` | ✗ | ✓ (on failure) | Stderr buffered, shown only if task fails |
1851
+ | `none` | ✗ | ✗ | Silent execution, useful for noisy tasks |
1852
+
1853
+ **Override Behavior:**
1854
+
1855
+ - Command-line `--task-output` overrides task-level `task_output` settings for all tasks
1856
+ - Task-level `task_output` applies only if no command-line flag is provided
1857
+ - Default behavior is `all` if neither is specified
1858
+
1859
+ **Important Notes:**
1860
+
1861
+ - Task output control is independent of `--log-level` - you can suppress task output while still seeing tasktree diagnostics
1862
+ - The `on-err` mode buffers stderr in memory and only displays it if the task fails
1863
+ - Output suppression does not affect the task's execution - files are still created, commands still run
1864
+ - Task exit codes are always checked regardless of output mode
1865
+
1670
1866
  ## Example: Full Build Pipeline
1671
1867
 
1672
1868
  ```yaml
@@ -1678,6 +1874,7 @@ tasks:
1678
1874
  compile:
1679
1875
  desc: Build application binaries
1680
1876
  outputs: [target/release/app]
1877
+ task_output: "on-err" # We only care about seeing this if it fails.
1681
1878
  cmd: cargo build --release
1682
1879
 
1683
1880
  test-unit:
@@ -0,0 +1,17 @@
1
+ tasktree/__init__.py,sha256=I5ICzU0vQn0Nal-P9IMdtOzKr_henQRlCBf-66j6yak,1251
2
+ tasktree/cli.py,sha256=_jfaGLTLoFIl_LsjYgaHhIStd4JkC4UzFf0gDTUTGbA,24694
3
+ tasktree/console_logger.py,sha256=k8A23zfX0Jp3rjs0VIDIOCmksVehtnhC8HKH0o8ybFQ,2175
4
+ tasktree/docker.py,sha256=r9rejuxpYdHcXbLPLEwUJ1_KTyTRr29wIMnk6dtF1Ko,15363
5
+ tasktree/executor.py,sha256=dDOTKB0VCcgNcZVOyeQlnA-XvqDbeBhs7qr_1mfLq7E,51488
6
+ tasktree/graph.py,sha256=EQUEwJ3WW6tNH0_DSGM3OCwobwWJ73ok_Ih6KiraZEo,23637
7
+ tasktree/hasher.py,sha256=Tq16Hh8lnIDkLHkQr-COz-BRqAOzZ_cEA8YQTYHP5bc,6722
8
+ tasktree/logging.py,sha256=CQi7MMCgWxgnVW0xW_qw4zZF3LzNyobkzVCOyXVxqKw,3154
9
+ tasktree/parser.py,sha256=8gx3TbtcLLMnMELoz6plgq8TNgvvYrmONbTpM3sX5eM,101232
10
+ tasktree/process_runner.py,sha256=lDaU2rWUDcmF--QTV1GmNKe7cdT8Hi1uT4fziUUU3iM,13358
11
+ tasktree/state.py,sha256=R4ZXgfs_rwrOH9nEb4mOjuHa7gAVqi7QPVCi0CouNQA,3961
12
+ tasktree/substitution.py,sha256=W1aOYSGDtpd3R4j5Mhgh69vxPSYG6BijPeyPqMSQY7I,18663
13
+ tasktree/types.py,sha256=34-Y2Jn6c6FHem94PCqkNPzqthn-1-QX55smvjWRE_o,5015
14
+ tasktree-0.0.23.dist-info/METADATA,sha256=LSIKyFHsx1hvHRSr7kfppfiYHEvWmt9ybce2s-Dp5V8,60438
15
+ tasktree-0.0.23.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
16
+ tasktree-0.0.23.dist-info/entry_points.txt,sha256=lQINlvRYnimvteBbnhH84A9clTg8NnpEjCWqWkqg8KE,40
17
+ tasktree-0.0.23.dist-info/RECORD,,
@@ -1,14 +0,0 @@
1
- tasktree/__init__.py,sha256=ZfI6vy-TxinN7eK0_XjfHUFq83pFV1XiHFrai_SHNqw,1251
2
- tasktree/cli.py,sha256=588ngMB27T6FqUp5LIJ_x_UNoPRlMv39b1_U0a88tfE,23577
3
- tasktree/docker.py,sha256=DAvdr6kZqkhx8J9fhsz26Z41hFPreANC60vdunvPX00,15050
4
- tasktree/executor.py,sha256=UF2H-qCgkJ5E2QoYt3To3a-ypwTIYJT9oyWRcBw2CzQ,46800
5
- tasktree/graph.py,sha256=Ya4ATQidj0rlHxvvbWF0Xx2J18MTpz2XPAHTcJXFcBg,23637
6
- tasktree/hasher.py,sha256=fvs7vNBrHdAA6pX-ZLhNnWLtd5qdxjAVFJC8SDF-DhQ,6730
7
- tasktree/parser.py,sha256=OUuME_ZqITAMQEL90w-yJFLKoEquF_IIa-By8MifMvI,101074
8
- tasktree/state.py,sha256=R4ZXgfs_rwrOH9nEb4mOjuHa7gAVqi7QPVCi0CouNQA,3961
9
- tasktree/substitution.py,sha256=hwox1m9r8p5b0Fcln12C63GexJHc5ZMUoqOrpqQLuPk,18663
10
- tasktree/types.py,sha256=nCiPrxg3r3ZX4CoZ6L5FrkJO9mgz_lFsZ-98X8tYgns,5015
11
- tasktree-0.0.22.dist-info/METADATA,sha256=fuvZWDbtlwfbQNOP_TMCDRSDGKdZYUTeROo3eqVcJ6o,54519
12
- tasktree-0.0.22.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
13
- tasktree-0.0.22.dist-info/entry_points.txt,sha256=lQINlvRYnimvteBbnhH84A9clTg8NnpEjCWqWkqg8KE,40
14
- tasktree-0.0.22.dist-info/RECORD,,