Skip to content

Conversation

@liorsve
Copy link
Contributor

@liorsve liorsve commented Oct 28, 2025

This PR fixes and reverts most changes made in PR #4714.
PR #4714 attempted to add description to pypi by dynamically reading README.md from the parent directory (./python) at module-level in setup.py since no README exists directly in the glide-sync package directory. However, this approach fails when building from the sdist because:

  1. Local wheel builds: When running python3 dev.py build --client sync --wheel, the isolated build extracts the sdist to a temp directory where ROOT.parent no longer points to ./python
  2. PyPI source builds: When PyPI attempts to build wheels from the source distribution (when no compatible wheel exists), the same path resolution issue occurs

This PR fixes it by -

  1. Declare readme statically in pyproject.toml: Changed from dynamic = ["version", "readme"] to readme = "README.md", allowing setuptools to handle README loading at the correct build phase
  2. Copy README.md into package directory: Updated dev.py to copy python/README.mdpython/glide-sync/README.md before building, ensuring the file exists at the expected location (this was added to the pypi-cd workflow already in the previous PR)
  3. Remove dynamic README handling from setup.py: Removed module-level long_description read since metadata is now properly declared in pyproject.toml

As can be seen in the pypi-cd run below, the tarball artifact produced includes README.md at the package root, and the generated PKG-INFO metadata file contains the full README content with Description-Content-Type: text/markdown, confirming it will be properly displayed as the package description on PyPI.

Issue link

This Pull Request is linked to issue: #4932

Checklist

Before submitting the PR make sure the following are checked:

  • This Pull Request is related to one issue.
  • Commit message has a detailed description of what changed and why.
  • Tests are added or updated.
  • CHANGELOG.md and documentation files are updated.
  • Destination branch is correct - main or release
  • Create merge commit if merging release branch into main, squash otherwise.

Signed-off-by: Lior Sventitzky <liorsve@amazon.com>
@liorsve liorsve marked this pull request as ready for review October 28, 2025 14:17
@liorsve liorsve requested a review from a team as a code owner October 28, 2025 14:17
@liorsve liorsve changed the title reverted prev changes, fixed pyproject.toml Python sync: fix packaging missing README.md file Oct 28, 2025
@liorsve liorsve changed the title Python sync: fix packaging missing README.md file Python sync: Fix wheel build failure due to missing README.md Oct 28, 2025
Signed-off-by: Lior Sventitzky <liorsve@amazon.com>
@liorsve liorsve merged commit 641f3f2 into main Oct 30, 2025
34 checks passed
@liorsve liorsve deleted the fix-build-readme-error branch November 4, 2025 09:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants