gauge-sh / tach

A Python tool to enforce dependencies, using modular architecture 🌎 Open source 🐍 Installable via pip 🔧 Able to be adopted incrementally - ⚡ Implemented with no runtime impact ♾️ Interoperable with your existing systems 🦀 Written in rust
https://gauge.sh
MIT License
1k stars 35 forks source link

Support `deprecated` dependencies #207

Closed caelean closed 1 month ago

caelean commented 1 month ago

Add support for specifying a dependency is deprecated. This involves a breaking change to the tach.yml spec: From:

modules:
  - path: domain_one
    depends_on:
      - domain_two
      - domain_three

to

modules:
  - path: domain_one
    depends_on:
      - path: domain_two
        deprecated: true
      - path: domain_two

(if marking domain_two as a deprecated dependency)

Here's what it looks like in action! image

This is necessary to support per-dependency configuration, which we'll likely expand in the future. Included is a migration handler which will auto-update every project config to the new format when it's run. Note that for now we'll still lose comments from the file when this happens.

deprecated spits out a warning, but still returns the exit code 0. I debated adding a flag to fail on deprecations, but for now you can achieve the same thing by just removing the dependency from depends_on.

This is also a breaking change for tach show --web - I'll set up changes on the web server to go out alongside the release of this feature. Fixes #184!

Bonus - expanded the test suite a little bit and added caching for deps! Takes it from about 3 min -> 1 min