diff --git a/CHANGELOG.rst b/CHANGELOG.rst index f2f5c0a..f0436c5 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -2,6 +2,11 @@ Changelog ========= +Version 0.15 +============ + +* Due to the change in API for ``pyproject-fmt`` introduce a dependency cap. + Version 0.14 ============ diff --git a/setup.cfg b/setup.cfg index b270dd9..eb0bdd4 100644 --- a/setup.cfg +++ b/setup.cfg @@ -74,7 +74,7 @@ all = # atoml @ git+https://github.com/abravalheri/atoml@table-common-ancestor#egg=atoml tomli-w>=0.4.0,<2 experimental = - pyproject-fmt>=0.4.0; python_version>="3.7" + pyproject-fmt>=0.4.0,<2; python_version>="3.7" # Add here test requirements (semicolon/line-separated) testing = diff --git a/src/ini2toml/cli.py b/src/ini2toml/cli.py index c2ca2d5..696ede1 100644 --- a/src/ini2toml/cli.py +++ b/src/ini2toml/cli.py @@ -84,7 +84,7 @@ def critical_logging(): } try: - from pyproject_fmt import Config, format_pyproject + import pyproject_fmt # noqa META["auto_format"] = dict( flags=("-F", "--auto-format"), @@ -95,6 +95,8 @@ def critical_logging(): def apply_auto_formatting(text: str) -> str: try: + from pyproject_fmt import Config, format_pyproject + return format_pyproject(Config(Path("pyproject.toml"), text)) except Exception as ex: # pragma: no cover _logger.debug(f"pyproject-fmt failed: {ex}", exc_info=True)