timmahrt / praatIO

A python library for working with praat, textgrids, time aligned audio transcripts, and audio files. It is primarily used for extracting features from and making manipulations on audio files given hierarchical time-aligned transcriptions (utterance > word > syllable > phone, etc).
MIT License
299 stars 32 forks source link

fix: replace deprecated pkg_resources with importlib #59

Closed timmahrt closed 8 months ago

timmahrt commented 8 months ago

Fix for: https://github.com/timmahrt/praatIO/issues/58

pkg_resources is deprecated. One possibility is to use importlib.pkg_resources.path, but this was also deprecated in 3.11. importlib.pkg_resources.files was added in 3.9.

So we'll use a combination of both to ensure users from 3.7~3.12 can use the code.

This PR does the following:

codecov[bot] commented 8 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Comparison is base (89bb335) 77.29% compared to head (53b712c) 77.31%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## praatio_v6.1 #59 +/- ## ================================================ + Coverage 77.29% 77.31% +0.02% ================================================ Files 21 21 Lines 2660 2663 +3 ================================================ + Hits 2056 2059 +3 Misses 604 604 ``` | [Files](https://app.codecov.io/gh/timmahrt/praatIO/pull/59?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Tim) | Coverage Δ | | |---|---|---| | [praatio/utilities/utils.py](https://app.codecov.io/gh/timmahrt/praatIO/pull/59?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Tim#diff-cHJhYXRpby91dGlsaXRpZXMvdXRpbHMucHk=) | `94.03% <100.00%> (+0.08%)` | :arrow_up: |

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.