JelleZijlstra / typeshed_client

Retrieve information from typeshed and other typing stubs
MIT License
20 stars 2 forks source link

Ensure `get_all_stub_files()` yields modules in a deterministic order #69

Closed AlexWaygood closed 1 year ago

AlexWaygood commented 1 year ago

While working on https://github.com/JelleZijlstra/stubdefaulter/pull/16, I was comparing the terminal output of stubdefaulter with and without the change in order to test my PR. This was made slightly harder by the fact that stubdefaulter wasn't processing typeshed's stdlib in a completely deterministic order, which surprised me.

The root cause is that typeshed_client.finder.get_all_stub_files() does not yield stub files in a deterministic order. This PR is an attempt to fix that.

I'm not overly attached to this PR -- the problem it's solving isn't a particularly serious one -- so I won't be particularly upset if you don't like it :) I think this patch makes the output deterministic (I've done manual testing), but I've failed to come up with a way to test this in CI.

JelleZijlstra commented 1 year ago

Also seems like I need to drop support for 3.6 :)