Skip to content

uv with pytest and filterwarnings triggers a host of SyntaxWarnings as errors; pip-tools does not #1559

@dycw

Description

@dycw

I've made a repo to demonstrate this, as it tests a few setups.

From the README:

This repo demonstrates some difference with `pip-tools` and `uv` with respect to
`pytest`, `SyntaxWarning`s and/or docstrings containing _invalid escape strings_. 
Here we run 4 tests:

- (`pip-tools` or `uv`) and (no `filterwarnings` or with `filterwarnings`)

In the last case, `uv` with `filterwarnings`, we trigger a `SyntaxError` upon
reading the module docstring in https://github.com/Zulko/moviepy/blob/v1.0.3/moviepy/config_defaults.py#L47
with the text
`IMAGEMAGICK_BINARY = r"C:\Program Files\ImageMagick-6.8.8-Q16\magick.exe"`.
Needlesstosay, this blocks testing.

Unfortunately, right after writing this up, I can no longer trigger the bug!

I'll continue to do so but I felt I've done enough testing to warrant writing an issue. Maybe the Astral team can already see what's going on.

uv version 0.1.2.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions