Now that testpaths includes the package dir, CI collects and runs the
MajorSystem doctest in hm/phonemes.py. That doctest is not hermetic: the
first attribute access downloads the full CMU Pronouncing Dictionary
(cmudict-0.7b, ~3.6 MB) over plain HTTP from the SourceForge SVN web view.
The chain is:
MajorSystem.term_to_phones -> Phone.tp -> _get_cmu_raw_data_text -> pyckup.grab(url_term_and_phones)
pyckup.grab does no caching, so every test job in the matrix (3.10, 3.12,
Windows) re-downloads it. It works today — three green jobs, ~2.2s each — but
it means:
- CI turns red whenever SourceForge is down, slow, rate-limits GitHub runners,
or the SVN path changes.
- The dependency is over
http://, not https://.
- Nothing can be tested offline.
Suggested fixes, roughly in order of effort:
- Cache the fetch locally (e.g. a
dol-backed cache under the user data dir,
or functools.lru_cache plus an on-disk store) so repeated runs and repeated
jobs hit the network at most once.
- Ship a small fixture slice of the dictionary in the package and point the
doctest at it, keeping the live URL as the default for real use.
- Failing both, mark the network-dependent doctest examples so they are skipped
when the fetch fails, rather than failing the build.
Option 1 is the most valuable regardless of CI — it also makes the library
pleasant to use interactively.
Surfaced while widening testpaths in the repo-polish pass.
Now that
testpathsincludes the package dir, CI collects and runs theMajorSystemdoctest inhm/phonemes.py. That doctest is not hermetic: thefirst attribute access downloads the full CMU Pronouncing Dictionary
(
cmudict-0.7b, ~3.6 MB) over plain HTTP from the SourceForge SVN web view.The chain is:
pyckup.grabdoes no caching, so every test job in the matrix (3.10, 3.12,Windows) re-downloads it. It works today — three green jobs, ~2.2s each — but
it means:
or the SVN path changes.
http://, nothttps://.Suggested fixes, roughly in order of effort:
dol-backed cache under the user data dir,or
functools.lru_cacheplus an on-disk store) so repeated runs and repeatedjobs hit the network at most once.
doctest at it, keeping the live URL as the default for real use.
when the fetch fails, rather than failing the build.
Option 1 is the most valuable regardless of CI — it also makes the library
pleasant to use interactively.
Surfaced while widening
testpathsin the repo-polish pass.