typeshed-internal / stub_uploader

Scripts and actions to auto-upload typeshed stubs to PyPI
Apache License 2.0
21 stars 16 forks source link

Ignored gitignored files when collecting entries #25

Closed nipunn1313 closed 3 years ago

nipunn1313 commented 3 years ago

I found that while I was testing this script, it would crash if I had a typeshed file open in my editor. This fixes that, and adds some missing tests for the file collection method (which will be handy later as well).

nipunn1313 commented 3 years ago

For example this unit test might be useful for #24

nipunn1313 commented 3 years ago

I used a couple of real-life test cases (toml and aio). I considered contriving the test cases, but figured it'll be more likely to catch regressions w/ real-life test cases.

JelleZijlstra commented 3 years ago

I feel like the test files are a bit too much, it will make people think they need to update these stubs or otherwise get confused by them. What do you think of using mostly empty example files instead? It doesn't seem like the stub uploader would care what is in the files.

nipunn1313 commented 3 years ago

sure - I can make the test cases slimmer and contrived. One sec. Didn't think about the subsequent developer confusion.

nipunn1313 commented 3 years ago

There it is - much simpler diff

nipunn1313 commented 3 years ago

Have to add some sorting to the unit tests so it runs consistently on different platforms.

nipunn1313 commented 3 years ago

(oops - sorry, stepped on your feet while you were running the workflow - sorry)

Realized while writing the unit test that I had only covered singlefile pkgs - so I added coverage and unit test for a multifile pkg with gitignore.

JelleZijlstra commented 3 years ago

Don't worry about it, happy to keep pushing the button to allow the workflow to run.

nipunn1313 commented 3 years ago

All complete now!