Fix installing from sdist (setup.py imports the package, pulling typing_extensions at build time)#216
Open
sethc555 wants to merge 1 commit into
Open
Fix installing from sdist (setup.py imports the package, pulling typing_extensions at build time)#216sethc555 wants to merge 1 commit into
sethc555 wants to merge 1 commit into
Conversation
…_extensions) and read a missing requirements.txt; now reads the version statically and guards the file read. Verified: with this change, python -m build (sdist -> wheel from that sdist) succeeds in a clean python:3.12 container; without it, it fails. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
No issues found across 1 file
Confidence score: 5/5
- Automated review surfaced no issues in the provided summaries.
- No files require special attention.
Auto-approved: This is a low-risk build fix that replaces a package import with static version parsing and guards against a missing requirements file, with no impact on runtime logic or data integrity.
Re-trigger cubic
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Installing resend from source currently fails in any isolated build:
setup.py imports the package to get
__version__, which pulls typing_extensions into the build environment, and reads a requirements file not shipped in the sdist. This change reads the version statically (stdlibreover resend/version.py) and guards the file read with the pinned fallback.Verified: with this change,
python -m build(sdist → wheel built from that sdist) succeeds in a clean python:3.12 container; without it, it fails. Found while build-checking popular PyPI packages for source-install breakage (wheelproof).Also verified: a wheel built from the patched 2.30.1 sdist is payload-identical to the published 2.30.1 wheel.
Summary by cubic
Fix sdist installs for
resendby avoiding build-time package import and guarding a missingrequirements.txt. Isolated source builds now succeed without needingtyping_extensionspreinstalled.resend/version.pyusing stdlibreinstead of importing the package.requirements.txtonly if present; otherwise use["requests>=2.31.0", "typing_extensions>=4.4.0"].python -m buildsdist→wheel works in a clean Python 3.12 container; wheel from patched 2.30.1 sdist matches the published wheel payload.Written for commit 6a5ef9d. Summary will update on new commits.