Skip to content

PEP 639 compliance #1256

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

Merged
merged 1 commit into from
Aug 11, 2025
Merged

PEP 639 compliance #1256

merged 1 commit into from
Aug 11, 2025

Conversation

DimitriPapadopoulos
Copy link
Contributor

@DimitriPapadopoulos DimitriPapadopoulos commented Jul 31, 2025

The CI error seems unrelated.

CI error
=================================== FAILURES ===================================
_________________________ test_fails_rst_syntax_error __________________________

tmp_path = PosixPath('/tmp/pytest-of-runner/pytest-0/test_fails_rst_syntax_error0')
capsys = <_pytest.capture.CaptureFixture object at 0x7f23f321df10>
caplog = <_pytest.logging.LogCaptureFixture object at 0x7f23f321d040>

    def test_fails_rst_syntax_error(tmp_path, capsys, caplog):
        sdist = build_sdist_with_metadata(
            tmp_path,
            """\
            Metadata-Version: 2.1
            Name: test-package
            Version: 1.2.3
            Description-Content-Type: text/x-rst
    
    
            ============
    
            """,
        )
    
        assert check.check([sdist])
    
        assert capsys.readouterr().out == f"Checking {sdist}: FAILED\n"
    
>       assert caplog.record_tuples == [
            (
                "twine.commands.check",
                logging.ERROR,
                "`long_description` has syntax errors in markup "
                "and would not be rendered on PyPI.\n"
                "line 2: Error: Document or section may not begin with a transition.",
            ),
        ]
E       AssertionError: assert [('twine.comm...transition.')] == [('twine.comm...transition.')]
E         
E         At index 0 diff: ('twine.commands.check', 40, '`long_description` has syntax errors in markup and would not be rendered on PyPI.\nline 2: Warning: Document or section may not begin with a transition.') != ('twine.commands.check', 40, '`long_description` has syntax errors in markup and would not be rendered on PyPI...
E         
E         ...Full output truncated (2 lines hidden), use '-vv' to show

tests/test_check.py:116: AssertionError
----------------------------- Captured stderr call -----------------------------
`long_description` has syntax errors in markup and would not be rendered on PyPI.
line 2: Warning: Document or section may not begin with a transition.
------------------------------ Captured log call -------------------------------
ERROR    twine.commands.check:check.py:147 `long_description` has syntax errors in markup and would not be rendered on PyPI.
line 2: Warning: Document or section may not begin with a transition.
=========================== short test summary info ============================
FAILED tests/test_check.py::test_fails_rst_syntax_error - AssertionError: assert [('twine.comm...transition.')] == [('twine.comm...tr...
======================== 1 failed, 229 passed in 2.15s =========================
py: exit 1 (3.21 seconds) /home/runner/work/twine/twine> python -m coverage run -m pytest pid=2657
  py: FAIL code 1 (13.22=setup[10.01]+cmd[3.21] seconds)
  evaluation failed :( (13.33 seconds)
Error: Process completed with exit code 1.

Maybe caused by the release of packaging 25.0 a few months ago, or even an earlier release?

@DimitriPapadopoulos DimitriPapadopoulos marked this pull request as draft July 31, 2025 08:54
@DimitriPapadopoulos DimitriPapadopoulos force-pushed the PEP639 branch 2 times, most recently from b214e16 to 6e8faab Compare August 5, 2025 09:28
@DimitriPapadopoulos DimitriPapadopoulos marked this pull request as ready for review August 5, 2025 09:31
@sigmavirus24
Copy link
Member

Yes, we had this fail in our scheduled test on main recently as well.

I still want that fixed before merging this as we're not getting feedback for most of our supported language versions.

@sigmavirus24 sigmavirus24 merged commit 6a696ed into pypa:main Aug 11, 2025
24 checks passed
@DimitriPapadopoulos DimitriPapadopoulos deleted the PEP639 branch August 11, 2025 08:49
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.

2 participants