Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix building wheels with py.typed files #113

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 6 additions & 7 deletions stub_uploader/build_wheel.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,13 +142,12 @@ def find_stub_files(top: str) -> list[str]:
name.isidentifier()
), "All file names must be valid Python modules"
result.append(os.path.relpath(os.path.join(root, file), top))
elif not file.endswith((".md", ".rst")):
# Allow having README docs, as some stubs have these (e.g. click).
if (
subprocess.run(["git", "check-ignore", file], cwd=top).returncode
!= 0
):
raise ValueError(f"Only stub files are allowed, not {file!r}")
elif file == "py.typed" or file.endswith((".md", ".rst")):
pass # Allow having README docs, as some stubs have these.
elif subprocess.run(["git", "check-ignore", file], cwd=top).returncode == 0:
pass # Allow gitignored files.
else:
raise ValueError(f"Only stub files are allowed, not {file!r}")
return sorted(result)


Expand Down