Skip to content

Commit

Permalink
Temporary cap for pyproject-fmt (#104)
Browse files Browse the repository at this point in the history
  • Loading branch information
abravalheri authored May 13, 2024
2 parents 9658565 + 4afbfde commit e7983e5
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
Changelog
=========

Version 0.15
============

* Due to the change in API for ``pyproject-fmt`` introduce a dependency cap.

Version 0.14
============

Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand Down
4 changes: 3 additions & 1 deletion src/ini2toml/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
Expand All @@ -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)
Expand Down

0 comments on commit e7983e5

Please sign in to comment.