Skip to content

Tests Fail Depending on tomlkit Version #628

Description

@adam-grant-hendry

Description

PR #626 changed

tests/commands/test_bump_command.py
tests/commands/test_init_command.py
tests/test_conf.py

to accomodate changes to tomlkit from 0.11.5 to 0.11.6. However, the pyproject.toml still has the version set as

tomlkit = ">=0.5.3,<1.0.0"

Hence, tests fail for tomlkit<=0.11.5.

Steps to reproduce

Run pytest on commitizen repo with tomlkit<=0.11.5.

Current behavior

The following 6 tests fail:

pytest_report.zip

when tomlkit is <= 0.11.5, but pass when tomlkit >= 0.11.6.

Desired behavior

Either of the following, depending on what should be supported:

  1. Update pyproject.toml to specify

    tomlkit = ">=0.11.6,<1.0.0"
    

or

  1. Add test cases for tomlkit <=0.11.5 separate from test cases for tomlkit > 0.11.5.

Screenshots

No response

Environment

  • commitizen version: 2.37.1
  • python version: 3.8.10
  • operating system: Windows 10

Activity

  1. changed the title [-]PR #626 Breaks Tests[/-] [+]Update `pyproject.toml` dependency version for `tomlkit`[/+] on Dec 3, 2022
  2. changed the title [-]Update `pyproject.toml` dependency version for `tomlkit`[/-] [+]Update version for `tomlkit` in `pyproject.toml`[/+] on Dec 3, 2022
  3. changed the title [-]Update version for `tomlkit` in `pyproject.toml`[/-] [+]Tests Fail Depending on `tomlkit` Version[/+] on Dec 3, 2022
  4. adam-grant-hendry commented on Dec 3, 2022

    @adam-grant-hendry
    ContributorAuthor

    @woile @Lee-W Which of Desired behavior should be implemented in a PR? 1 or 2?

  5. Lee-W commented on Dec 3, 2022

    @Lee-W
    Member

    I prefer the second one.

  6. Kurt-von-Laven commented on Apr 8, 2023

    @Kurt-von-Laven
    Contributor

    In case this issue remains open until support for Python 3.10 is dropped, tomlib was added to the standard library in Python 3.11, so the dependency on tomlkit can eventually be dropped.

  7. woile commented on Apr 28, 2023

    @woile
    Member

    Any update on this? Is it still happening on v3?
    Thanks

  8. bearomorphism commented on May 9, 2026

    @bearomorphism
    Collaborator

    Triage from #1964: This is stale — pyproject.toml currently pins tomlkit (>=0.8.0,<1.0.0), and CI passes on master across Python 3.10-3.14 / Linux / macOS / Windows. The original 0.11.5 vs 0.11.6 discrepancy should no longer be relevant. Suggesting we close unless someone is actively running into it.

  9. bearomorphism commented on May 9, 2026

    @bearomorphism
    Collaborator

    Verification update (re #1964)

    Verified against current master (4.15.1):

    • pyproject.toml pin: tomlkit (>=0.8.0,<1.0.0)
    • Resolved tomlkit in commitizen's lockfile: 0.14.0
    • Test files mentioned in this issue (test_bump_command.py, test_init_command.py, test_conf.py) all pass on current master with resolved tomlkit.

    The original 0.11.5 vs 0.11.6 distinction (December 2022) is no longer exercised by the test suite. CI matrix passes across Python 3.10–3.14 / Linux / macOS / Windows.

    Verdict: STALE. Closing-eligible.

    (Tangentially related: #1500 reopens the "broad tomlkit pin" concern from a different angle — old tomlkit can still mishandle PEP-735 [dependency-groups] includes. Bumping the lower bound to >=0.13.0 would address both #628 and #1500 cleanly.)

  10. bearomorphism commented on May 9, 2026

    @bearomorphism
    Collaborator

    Closing as stale: tomlkit 0.11.5 vs 0.11.6 distinction is no longer exercised by the test suite. CI passes across the matrix with current resolved tomlkit (0.14.0). See verification comment above.

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions