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
1.15k stars 36 forks source link

Fix report external #372

Closed emdoyle closed 1 month ago

emdoyle commented 1 month ago

Fixing #370

This sorts the report-external raw output for deterministic behavior, and fixes the generation of the 'module mapping' on lower versions of Python. This is how Tach determines that a package called GitPython provides the git external module for example.

This mapping was constructed incorrectly in two ways:

  1. Parsing of distribution metadata was broken, pulling in incorrect names from RECORD files in some cases among other issues
  2. The final mapping was inverted, mapping package names to their provided modules, even though lookups need to be done based on the provided modules themselves.

Both these issues are addressed by this PR.