typeshed-internal / stub_uploader

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

Fix building wheels with py.typed files #113

Closed srittau closed 10 months ago

srittau commented 10 months ago

Currently, the integration tests fail, since py.typed is not recognized. I'm not sure, why the tests didn't flag this in #109. Cc @Avasam

srittau commented 10 months ago

I think the tests fail locally, because previous runs create py.typed, which subsequent runs then pick up. I'll investigate more.

Avasam commented 10 months ago

I think we check for file extensions to only accept .pyi and .md found in typeshed. But after running once, a py.typed is added, which is then seen on a second run because the run is not cleaned up locally (on CI it doesn't matter since it's a temporary clone of typeshed iirc)

Ironically I was manually cleaning up the extra folders and files locally between runs because I was testing the file/folder generation.

I see some potential solutions:

  1. We could allow py.typed in our check. But that will allow py.typed files to slip in typeshed's source. We may not want that?
  2. Add clean-up code. (probably a good idea to avoid further similar issues of polluting a local typeshed repo)
  3. Change how/where the physical py.typed file is generated
srittau commented 10 months ago

The main problem here is that the integration tests modify files outside the stub uploader directory and don't clean up. I'll open a separate issue.