banesullivan / scooby

🐶 🕵️ Great Dane turned Python environment detective
MIT License
47 stars 12 forks source link

Add package resources version fallback #101

Closed banesullivan closed 1 year ago

banesullivan commented 1 year ago

Fixes an issue where our typical methods of uncovering a version fail for some packages by falling back to package-resoources if available to get the distribution version.

There may be justification for making this the default, but for now, I have tagged it on as a final fallback.

One particular package that needs this is pythreejs.

Main:

$ scooby pythreejs

--------------------------------------------------------------------------------

...

  Python 3.9.13 (main, Aug 25 2022, 18:24:45)  [Clang 12.0.0 ]

         pythreejs : Version unknown

This branch

$ scooby pythreejs

--------------------------------------------------------------------------------

...

  Python 3.9.13 (main, Aug 25 2022, 18:24:45)  [Clang 12.0.0 ]

         pythreejs : 2.4.1
codecov-commenter commented 1 year ago

Codecov Report

Merging #101 (bfe4560) into main (5150815) will decrease coverage by 0.03%. The diff coverage is 84.61%.

@@            Coverage Diff             @@
##             main     #101      +/-   ##
==========================================
- Coverage   85.61%   85.58%   -0.03%     
==========================================
  Files           5        5              
  Lines         424      437      +13     
==========================================
+ Hits          363      374      +11     
- Misses         61       63       +2     
banesullivan commented 1 year ago

Pre-commit runs fine for me locally. I really need (want) this change, so I'm merging and releasing.

These changes render much of the knowledge.py module useless as we don't need version attributes or version setting methods and can just rely on pkg_resources. I'm going to PATCH release to get these changes in then, if I make time, will have a MINOR release to remove unneeded features