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

Locally import slow modules #238

Closed emdoyle closed 1 month ago

emdoyle commented 1 month ago

Profiling showed that we were incurring startup latency of:

This PR moves these imports so that they are local to the codepaths which actually use them. This means for example that tach check doesn't spend time loading git-python or prompt-toolkit, and only optionally pulls in networkx for cycle detection.