Skip to content

Fix installing from sdist (setup.py imports the package, pulling typing_extensions at build time)#216

Open
sethc555 wants to merge 1 commit into
resend:mainfrom
sethc555:fix/sdist-source-build
Open

Fix installing from sdist (setup.py imports the package, pulling typing_extensions at build time)#216
sethc555 wants to merge 1 commit into
resend:mainfrom
sethc555:fix/sdist-source-build

Conversation

@sethc555

@sethc555 sethc555 commented Jun 11, 2026

Copy link
Copy Markdown

Installing resend from source currently fails in any isolated build:

$ docker run --rm python:3.12 pip install --no-binary :all: resend
...
ModuleNotFoundError: No module named 'typing_extensions'

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 (stdlib re over 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 resend by avoiding build-time package import and guarding a missing requirements.txt. Isolated source builds now succeed without needing typing_extensions preinstalled.

  • Bug Fixes
    • Parse version from resend/version.py using stdlib re instead of importing the package.
    • Read requirements.txt only if present; otherwise use ["requests>=2.31.0", "typing_extensions>=4.4.0"].
    • Verified python -m build sdist→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.

Review in cubic

…_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>

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@github-actions github-actions Bot added the linear-synced PR has been synced to Linear label Jun 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

linear-synced PR has been synced to Linear

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant