commitizen icon indicating copy to clipboard operation
commitizen copied to clipboard

Tests Fail Depending on `tomlkit` Version

Open adam-grant-hendry opened this issue 3 years ago • 4 comments

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

adam-grant-hendry avatar Dec 03 '22 02:12 adam-grant-hendry

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

adam-grant-hendry avatar Dec 03 '22 02:12 adam-grant-hendry

I prefer the second one.

Lee-W avatar Dec 03 '22 06:12 Lee-W

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.

Kurt-von-Laven avatar Apr 08 '23 20:04 Kurt-von-Laven

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

woile avatar Apr 28 '23 12:04 woile