Skip to content

Conversation

@czgdp1807
Copy link
Contributor

@czgdp1807 czgdp1807 commented Sep 19, 2025

Why are these changes needed?

Sixth split of #56416

Related issue number

Checks

  • I've signed off every commit(by using the -s flag, i.e., git commit -s) in this PR.
  • I've run scripts/format.sh to lint the changes in this PR.
  • I've included any doc changes needed for https://docs.ray.io/en/master/.
    • I've added any new APIs to the API Reference. For example, if I added a
      method in Tune, I've added it in doc/source/tune/api/ under the
      corresponding .rst file.
  • I've made sure the tests are passing. Note that there might be a few flaky tests, see the recent failures at https://flakey-tests.ray.io/
  • Testing Strategy
    • Unit tests
    • Release tests
    • This PR is not tested :(

Note

Updates Ruff config to target specific rllib subpaths and performs widespread import reordering/normalization across callbacks, env, offline, and tests (no functional changes).

  • Config:
    • Update pyproject.toml Ruff per-file-ignores from rllib/* to specific subpaths (e.g., rllib/{algorithms,core,examples,...}) for finer-grained linting.
  • RLlib (callbacks, env, offline, tests):
    • Reorder and consolidate imports, normalize typing/import ordering, and adjust intra-package imports (e.g., combined imports, moved TYPE_CHECKING blocks).
    • Minor all/export and import path cleanups in __init__ and wrappers.
    • Test files: move imports, tidy main blocks; no behavioral logic modified.

Written by Cursor Bugbot for commit a6af7a4. This will update automatically on new commits. Configure here.

Signed-off-by: Gagandeep Singh <gdp.1807@gmail.com>
Signed-off-by: Gagandeep Singh <gdp.1807@gmail.com>
@czgdp1807 czgdp1807 requested a review from a team as a code owner September 19, 2025 09:30
@czgdp1807 czgdp1807 changed the title LINT: Enable ruff imports for offline/, tests/, callbacks/ and env in rllib` LINT: Enable ruff imports for offline/, tests/, callbacks/ and env in rllib Sep 19, 2025
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

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 enables ruff for import sorting on offline/, tests/, callbacks/, and env/ directories within rllib. The changes consist of updating pyproject.toml to remove these directories from the isort ignore list and applying the corresponding import reordering across numerous files in these directories. The changes are purely stylistic and align with the project's linting standards. The import reordering has been applied correctly across all modified files. The PR is a good step towards standardizing the codebase.

@ray-gardener ray-gardener bot added rllib RLlib related issues devprod community-contribution Contributed by the community labels Sep 19, 2025
@kamil-kaczmarek kamil-kaczmarek changed the title LINT: Enable ruff imports for offline/, tests/, callbacks/ and env in rllib [RLlib] LINT: Enable ruff imports for offline/, tests/, callbacks/ and env in rllib Sep 24, 2025
@kamil-kaczmarek kamil-kaczmarek changed the title [RLlib] LINT: Enable ruff imports for offline/, tests/, callbacks/ and env in rllib [RLlib] LINT: Enable ruff imports for offline/, tests/, callbacks/ and env/ in rllib Sep 24, 2025
Copy link
Contributor

@kamil-kaczmarek kamil-kaczmarek left a comment

Choose a reason for hiding this comment

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

LGTM! Great work

@ArturNiederfahrenhorst ArturNiederfahrenhorst added the go add ONLY when ready to merge, run all tests label Sep 24, 2025
@pseudo-rnd-thoughts
Copy link
Member

@czgdp1807 apologies, I was trying to fix the merge conflicts through the github web ui however it doesn't include the commit sign off that DCO requires. We can merge this PR last of your linting PRs but it will require you to rebase the PR to resolve this issue

Signed-off-by: Gagandeep Singh <gdp.1807@gmail.com>
Signed-off-by: Gagandeep Singh <gdp.1807@gmail.com>
@czgdp1807 czgdp1807 force-pushed the ruff_rllib_import_5 branch from 310e76b to a6af7a4 Compare October 1, 2025 05:47
@czgdp1807
Copy link
Contributor Author

@pseudo-rnd-thoughts @kamil-kaczmarek I have merged master and resolved the conflicts. Should pass the tests now.

@pseudo-rnd-thoughts
Copy link
Member

@czgdp1807 could you resolve them sadly. I suspect that we'll need to wait to premerge to pass then merge then fix the new conflicts on another one of the PRs until they're all complete

@czgdp1807
Copy link
Contributor Author

No problems @pseudo-rnd-thoughts. This is expected to happen. Resolving them.

Signed-off-by: Gagandeep Singh <gdp.1807@gmail.com>
@czgdp1807
Copy link
Contributor Author

@pseudo-rnd-thoughts Done.

@pseudo-rnd-thoughts
Copy link
Member

pseudo-rnd-thoughts commented Oct 2, 2025

@czgdp1807 There is a problem in the CI thats unrelated to your PR that were trying to actively fix in #57067

I'll ping you when the CI problem is resolved and if there is anything we need you to do

kamil-kaczmarek and others added 2 commits October 3, 2025 11:02
@aslonnie aslonnie self-requested a review October 7, 2025 16:56
@github-actions
Copy link

This pull request has been automatically marked as stale because it has not had
any activity for 14 days. It will be closed in another 14 days if no further activity occurs.
Thank you for your contributions.

You can always ask for help on our discussion forum or Ray's public slack channel.

If you'd like to keep this open, just leave any comment, and the stale label will be removed.

@github-actions github-actions bot added the stale The issue is stale. It will be closed within 7 days unless there are further conversation label Oct 22, 2025
@kamil-kaczmarek
Copy link
Contributor

unstale

@github-actions github-actions bot added unstale A PR that has been marked unstale. It will not get marked stale again if this label is on it. and removed stale The issue is stale. It will be closed within 7 days unless there are further conversation labels Oct 22, 2025
Mark Towers added 4 commits October 31, 2025 10:25
# Conflicts:
#	pyproject.toml
#	rllib/core/learner/learner_group.py
Signed-off-by: Mark Towers <mark@anyscale.com>
# Conflicts:
#	pyproject.toml
#	rllib/env/env_runner.py
#	rllib/env/single_agent_episode.py
Signed-off-by: Mark Towers <mark@anyscale.com>
@simonsays1980 simonsays1980 merged commit 3658f76 into ray-project:master Oct 31, 2025
6 checks passed
YoussefEssDS pushed a commit to YoussefEssDS/ray that referenced this pull request Nov 8, 2025
landscapepainter pushed a commit to landscapepainter/ray that referenced this pull request Nov 17, 2025
Aydin-ab pushed a commit to Aydin-ab/ray-aydin that referenced this pull request Nov 19, 2025
…lbacks/`` and ``env/`` in ``rllib`` (ray-project#56744)

Signed-off-by: Aydin Abiar <aydin@anyscale.com>
SheldonTsen pushed a commit to SheldonTsen/ray that referenced this pull request Dec 1, 2025
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 devprod go add ONLY when ready to merge, run all tests rllib RLlib related issues unstale A PR that has been marked unstale. It will not get marked stale again if this label is on it.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants