Skip to content

Regression with typing-extensions 4.13: test_cli_metavar_format_type_alias_312 #591

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
musicinmybrain opened this issue Apr 15, 2025 · 3 comments
Assignees

Comments

@musicinmybrain
Copy link
Contributor

$ git clone https://github.com/pydantic/pydantic-settings.git
$ cd pydantic-settings
$ git checkout v2.8.1
$ uv venv
$ . .venv/bin/activate
(pydantic-settings) $ uv pip install -r requirements/all.txt
(pydantic-settings) $ uv pip install -e .
(pydantic-settings) $ pytest
[…]
Results (1.96s):
       395 passed
         4 skipped
(pydantic-settings) $ uv pip install --upgrade typing-extensions
[…]
 - typing-extensions==4.12.2
 + typing-extensions==4.13.2
(pydantic-settings) $ pytest
[…]
============================================== FAILURES ==============================================
_______________________________ test_cli_metavar_format_type_alias_312 _______________________________

    @pytest.mark.skipif(sys.version_info < (3, 12), reason='requires python 3.12 or higher')
    def test_cli_metavar_format_type_alias_312():
>       exec(
            """
    type TypeAliasInt = int
    assert CliSettingsSource(SimpleSettings)._metavar_format(TypeAliasInt) == 'TypeAliasInt'
    """
        )

tests/test_source_cli.py:2068: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

>   ???
E   AssertionError

<string>:3: AssertionError
                                         Summary of Failures                                          
┏━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━┓
┃  File                  ┃  Function             ┃  Function Line  ┃  Error Line  ┃  Error           ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━┩
│  tests/test_source_c…  │  test_cli_metavar_f…  │  2066           │  2068        │  AssertionError  │
└────────────────────────┴───────────────────────┴─────────────────┴──────────────┴──────────────────┘
Results (1.49s):
         1 failed
       394 passed
         4 skipped
@hramezani
Copy link
Member

Thanks @musicinmybrain for reporting this.

I created #593 to resolve it.

@hramezani
Copy link
Member

Fixed in f3e5ac3

@musicinmybrain
Copy link
Contributor Author

Thank you!

Since backporting f3e5ac3 did not fix this in v2.8.1, I tried bisecting. It appears that the fix for this was actually e5fb741.

I’m about to update Pydantic to 2.11 in Fedora Rawhide, the development version of the distribution. Since e5fb741 seems like a bit more than I would like to backport as a patch, I’ll plan to just ignore this test failure for the time being. I expect there will be a new pydantic-settings release containing the fix before the Fedora 43 final freeze in October.

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

No branches or pull requests

3 participants