Skip to content

Read the Unreal toolset as UTF-8 in its install test - #18344

Merged
danielhanchen merged 1 commit into
mainfrom
ci/unreal-tools-test-utf8
Nov 18, 2026
Merged

danielhanchen merged 1 commit into
mainfrom
ci/unreal-tools-test-utf8

Conversation

@danielhanchen

Copy link
Copy Markdown
Member

Read the Unreal toolset as UTF-8 in its install test

tests/test_source_read_encoding.py::test_checked_in_file_reads_name_an_encoding fails on main since #18331. It shows up in Repo tests (CPU, rest-2):

E   AssertionError: 1 file reads in the test trees touch a checked-in file with the platform default encoding ...
E     Left contains one more item: 'studio/backend/tests/test_unreal_level_tools.py:31: read_text()'

Cause

test_install_writes_the_toolset_and_hooks_it_once compares the installed unsloth_level_tools.py against the checked-in source, unreal_tools._SOURCE, using bare .read_text() on both sides.

The checked-in file is then decoded with the platform default, which is the ANSI codepage on Windows. That is exactly what this lint rejects.

integrations/unreal/__init__.py itself already reads _SOURCE and writes the installed copy with encoding = "utf-8". Only the test reads them without an encoding.

Fix

Both sides of that comparison now read with encoding = "utf-8", matching how install() reads and writes them. The assertion is unchanged.

Verification

  • tests/test_source_read_encoding.py: fails on main on this line and passes with this change (16 passed).
  • studio/backend/tests/test_unreal_level_tools.py: 14 passed.
  • ruff is clean.

@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-18T15:58:29.345411Z 4dc24c5 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 👍

Reviewed commit: 4dc24c5b83

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@danielhanchen
danielhanchen merged commit 8034892 into main Nov 18, 2026
@danielhanchen
danielhanchen deleted the ci/unreal-tools-test-utf8 branch November 18, 2026 15:59
danielhanchen added a commit that referenced this pull request Nov 18, 2026
…th_zoo is absent (#18338)

## Summary

A test fix for a check that fails on every PR against current main.

### 1. Trainer-backed num_proc veto tests without unsloth_zoo

These tests, added in #17701, import `core.training.trainer`, which
imports unsloth and so needs `unsloth_zoo`:
- `test_the_batched_packing_pool_asks_the_same_veto` (through
`_pack_num_proc`'s lazy import of the trainer);
- the five `test_block_swap_counts_for_the_veto_only_when_it_offloads`
cases.

Some CPU CI buckets (Repo tests, Python 3.13 a-f) do not install the
zoo, so these fail there with `ImportError: Unsloth: Please install
unsloth_zoo`.

Both tests now call a small `_trainer_or_skip()` helper. It skips the
same way `test_dataset_preview_role_aliases.py` already does when the
zoo cannot be imported.

`studio/backend/tests/test_dataset_map_num_proc.py`:
- with `unsloth_zoo`: 40 passed, nothing skipped;
- without it: 32 passed, 8 skipped (6 failed before).

The Unreal level tools encoding fix and the model picker contract update
this PR also carried landed separately on main (#18344, #18372), so this
branch now takes main's versions of those files.
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.

1 participant