Repository navigation
fix(quantization): use raw docstrings for '\*' escapes - #143
Conversation
|
@dengqiaoyu friendly ping when you have a moment. This removes the Python 3.12+ SyntaxWarnings and adds a test so they can't come back. |
Thanks for the reminder, will do. I was not added as a reviewer so I didn't get any notification for it. |
dengqiaoyu
left a comment
There was a problem hiding this comment.
LGTM, please remove the change log then I will approve it.
There was a problem hiding this comment.
There is no need to add a changelog for the small fix.
There was a problem hiding this comment.
Thanks for adding the tests.
2b238e5 to
eb18ca3
Compare
|
@alphasafal Can you also configure your GitHub account with signing key so that your commits are signed and we can merge it? Thanks!
|
eb18ca3 to
d82df9e
Compare
|
Thanks @dengqiaoyu! I’ve set up my signing key, and all 4 commits now show as Verified. I’ve also removed the changelog fragment and rebased onto the latest main. Ready for another look. |


The
OpQuantizerConfigandModuleQuantizerConfigdocstrings escape*as\*so Sphinx doesn't treat it as emphasis. In a normal string literal that's an invalid escape sequence, so on Python 3.12+ compilingquantization_config.pyprintsand with
python -W error(or a pytest config that turns warnings into errors) the module doesn't compile at all. I ran into it right after installing on 3.13.Changes
rprefix on four regex literals intest_annotation_pattern_registry.pythat had\./\*.W605somake checkcatches new ones. On main it flags exactly these 20 spots.tests/test_source_compiles.py, which compiles every module undercoreai_optwith warnings as errors. It fails on main and passes with this change.Fixed.Testing
pre-commit run --all-filespasses.pytest -m "not slow"on Python 3.13 / Linux: everything passes apart from export and nox tests that need coremltools, pyreporoot and model downloads I couldn't install in my environment. None of those touch the files changed here.