Skip to content

Split SCons.Util even more, discourage implicit imports#4830

Open
Repiteo wants to merge 1 commit intoSCons:masterfrom
Repiteo:util-no-implicit
Open

Split SCons.Util even more, discourage implicit imports#4830
Repiteo wants to merge 1 commit intoSCons:masterfrom
Repiteo:util-no-implicit

Conversation

@Repiteo
Copy link
Contributor

@Repiteo Repiteo commented Feb 17, 2026

Makes SCons.Util more package-y with a couple of changes:

  • Disable type hints for SCons.Util's implicit imports. This keeps the functionality working as-is, but now intellisense and IDEs will discourage not using the correct package explicitly.
  • Split tests across the different packages, instead of having everything consolidated in UtilTests.py.

Contributor Checklist:

  • I have created a new test or updated the unit tests to cover the new/changed functionality.
  • I have updated CHANGES.txt and RELEASE.txt (and read the README.rst).
  • I have updated the appropriate documentation

Comment on lines -455 to +461
StringTypes=StringTypes,
SequenceTypes=SequenceTypes,
StringTypes=StringTypes, # type: ignore
SequenceTypes=SequenceTypes, # type: ignore
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Trying to use SCons.Util.sctypes.* here causes circular imports. Could maybe be circumvented with local import syntax, but it's simpler to just use the legacy values and silence the warnings.

@mwichmann
Copy link
Collaborator

I don't have a problem with this in concept. Away from big screens for a while, so is kind of hard to review. The new Tests.py files are all moved content, right? (UtilsTests has such a big diff it's collapsing it and not showing, means that'll be hard to tell visually).

@Repiteo
Copy link
Contributor Author

Repiteo commented Feb 18, 2026

It's all moved content, correct

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: In review

Development

Successfully merging this pull request may close these issues.

2 participants