Bug 2235499

Summary: hatch FTBFS with the latest version of tomlkit (0.12.1)
Product: [Fedora] Fedora Reporter: Charalampos Stratakis <cstratak>
Component: hatchAssignee: Ben Beasley <code>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: rawhideCC: code
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: hatch-1.7.0-8.fc40 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-09-01 14:07:44 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 2130400    

Description Charalampos Stratakis 2023-08-28 21:36:15 UTC
During the impact check of the latest version of tomlkit, some hatch tests started failing:

=================================== FAILURES ===================================
________________ test_project_location_basic_set_first_project _________________

hatch = <tests.conftest.CliRunner object at 0x7fd39b696720>
config_file = <hatch.config.user.ConfigFile object at 0x7fd39a6a4f20>
helpers = <module 'tests.helpers.helpers' from '/builddir/build/BUILD/hatch-hatch-v1.7.0/tests/helpers/helpers.py'>
temp_dir = Path('/tmp/tmptu9j9no_')

    def test_project_location_basic_set_first_project(hatch, config_file, helpers, temp_dir):
        with temp_dir.as_cwd():
            result = hatch('config', 'set', 'projects.foo', '.')
    
        path = str(temp_dir).replace('\\', '\\\\')
    
        assert result.exit_code == 0, result.output
>       assert result.output == helpers.dedent(
            f"""
            New setting:
            project = "foo"
    
            [projects]
            foo = "{path}"
            """
        )
E       assert 'New setting:\nproject = "foo"\n[projects]\nfoo = "/tmp/tmptu9j9no_"\n' == 'New setting:\nproject = "foo"\n\n[projects]\nfoo = "/tmp/tmptu9j9no_"\n'
E           New setting:
E           project = "foo"
E         - 
E           [projects]
E           foo = "/tmp/tmptu9j9no_"

/builddir/build/BUILD/hatch-hatch-v1.7.0/tests/cli/config/test_set.py:183: AssertionError
_______________ test_project_location_complex_set_first_project ________________

hatch = <tests.conftest.CliRunner object at 0x7fd39b696720>
config_file = <hatch.config.user.ConfigFile object at 0x7fd39a7e35f0>
helpers = <module 'tests.helpers.helpers' from '/builddir/build/BUILD/hatch-hatch-v1.7.0/tests/helpers/helpers.py'>
temp_dir = Path('/tmp/tmpj544wwms')

    def test_project_location_complex_set_first_project(hatch, config_file, helpers, temp_dir):
        with temp_dir.as_cwd():
            result = hatch('config', 'set', 'projects.foo.location', '.')
    
        path = str(temp_dir).replace('\\', '\\\\')
    
        assert result.exit_code == 0, result.output
>       assert result.output == helpers.dedent(
            f"""
            New setting:
            project = "foo"
    
            [projects.foo]
            location = "{path}"
            """
        )
E       assert 'New setting:\nproject = "foo"\n[projects.foo]\nlocation = "/tmp/tmpj544wwms"\n' == 'New setting:\nproject = "foo"\n\n[projects.foo]\nlocation = "/tmp/tmpj544wwms"\n'
E           New setting:
E           project = "foo"
E         - 
E           [projects.foo]
E           location = "/tmp/tmpj544wwms"

/builddir/build/BUILD/hatch-hatch-v1.7.0/tests/cli/config/test_set.py:205: AssertionError

Build log: https://copr.fedorainfracloud.org/coprs/cstratak/tomlkit-0.12.1/build/6349433/

Reproducible: Always

Comment 1 Ben Beasley 2023-08-29 12:38:03 UTC
I backported an unreleased commit to change the expected whitespace in the two failing tests[1]. This built successfully in COPR[2].

Please merge the PR when you complete the python-tomlkit update. The installed package doesn’t change with this PR, so it doesn’t matter if you build hatch after merging it or not.

Thank you for doing an impact check and reporting this in time for me to fix it before the update landed.

[1] https://src.fedoraproject.org/rpms/hatch/pull-request/13
[2] https://copr.fedorainfracloud.org/coprs/cstratak/tomlkit-0.12.1/build/6352788/

Comment 2 Fedora Update System 2023-09-01 14:06:51 UTC
FEDORA-2023-6217093b21 has been submitted as an update to Fedora 40. https://bodhi.fedoraproject.org/updates/FEDORA-2023-6217093b21

Comment 3 Fedora Update System 2023-09-01 14:07:44 UTC
FEDORA-2023-6217093b21 has been pushed to the Fedora 40 stable repository.
If problem still persists, please make note of it in this bug report.