Skip to content

refactor(setup): modernize string formatting and ensure explicit file encoding - #65439

Closed
ardozcnn wants to merge 9 commits into
ray-project:masterfrom
ardozcnn:master
Closed

refactor(setup): modernize string formatting and ensure explicit file encoding#65439
ardozcnn wants to merge 9 commits into
ray-project:masterfrom
ardozcnn:master

Conversation

@ardozcnn

Copy link
Copy Markdown

Description

This PR modernizes the setup.py build configuration script by refactoring legacy .format() string formatting to modern Python f-strings. Additionally, it explicitly enforces encoding="utf-8" in find_version() to ensure cross-platform consistency and prevent encoding errors on non-UTF-8 default environments (e.g., Windows).

Related issues

Related to code cleanup and build script maintenance.

Additional information

  • Refactored .format() calls to f-strings across setup.py.
  • Added explicit encoding="utf-8" when reading version files.
  • Replaced slice-based extension checking ([-3:] == ".py") with .endswith(".py").
  • No functional or breaking changes introduced to the build pipeline.

Signed-off-by: Arda ÖZCAN <76063457+ardozcnn@users.noreply.github.com>
@ardozcnn
ardozcnn requested review from a team, edoakes and richardliaw as code owners August 12, 2026 21:12

@gemini-code-assist gemini-code-assist 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.

Code Review

This pull request refactors python/setup.py by converting string concatenations to f-strings and removing numerous comments and docstrings. The review feedback focuses on restoring these removed comments and docstrings, as they provide critical context regarding platform-specific workarounds (such as Windows symlink/junction behavior and WSL exclusion), design decisions (like excluding the LLM extra from the main bundle), and developer synchronization instructions. Additionally, one comment was flagged for containing git history details rather than code-specific documentation.

Comment thread python/setup.py Outdated
Comment thread python/setup.py
Comment thread python/setup.py
Comment thread python/setup.py
Comment thread python/setup.py
Comment thread python/setup.py
Comment thread python/setup.py
Comment thread python/setup.py
@ray-gardener ray-gardener Bot added core Issues that should be addressed in Ray Core community-contribution Contributed by the community labels Aug 13, 2026
ardozcnn and others added 3 commits August 13, 2026 23:45
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Signed-off-by: Arda ÖZCAN <76063457+ardozcnn@users.noreply.github.com>
Signed-off-by: Arda ÖZCAN <76063457+ardozcnn@users.noreply.github.com>
@ardozcnn

Copy link
Copy Markdown
Author

Thanks for the review! I have restored all the removed docstrings and architectural/platform comments across setup.py while keeping the f-string refactoring and encoding="utf-8" fix intact.

@ardozcnn

Copy link
Copy Markdown
Author

Can you review please.

@martinlhw martinlhw added the go add ONLY when ready to merge, run all tests label Aug 20, 2026
@ardozcnn ardozcnn closed this Aug 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

community-contribution Contributed by the community core Issues that should be addressed in Ray Core go add ONLY when ready to merge, run all tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants