I have the following pyproject.toml file.
As of pyproject-fmt2.0.0 (and now with 2.0.2), the pyproject-fmt changes are inconsistent.
This means that I cannot pyproject-fmt pyproject.toml and then pyproject-fmt --check pyproject.toml and expect it to pass.
pyproject.toml
```toml
[build-system]
build-backend = "setuptools.build_meta"
requires = [
"pip",
"setuptools",
"setuptools-scm[toml]>=8.0.1",
"wheel",
]
[project]
name = "vws-cli"
description = "A CLI for the Vuforia Web Services (VWS) API."
readme = { file = "README.rst", content-type = "text/x-rst" }
keywords = [
"cli",
"vuforia",
"vws",
]
license = { file = "LICENSE" }
authors = [
{ name = "Adam Dangoor", email = "adamdangoor@gmail.com" },
]
requires-python = ">=3.12"
classifiers = [
"Development Status :: 5 - Production/Stable",
"Environment :: Web Environment",
"License :: OSI Approved :: MIT License",
"Operating System :: POSIX",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.12",
]
dynamic = [
"version",
]
dependencies = [
"click==8.1.7",
"pyyaml==6.0.1",
"vws-python==2024.2.19",
]
optional-dependencies.dev = [
"actionlint-py==1.6.27.13",
"check-manifest==0.49",
"check-wheel-contents==0.6.0",
"deptry==0.16.1",
"doc8==1.1.1",
"docker==7.0.0",
"freezegun==1.5.0",
"furo==2024.5.6",
"homebrew-pypi-poet==0.10",
"mypy==1.10.0",
"pylint==3.1.0",
"pyproject-fmt==2.0.0",
"pyright==1.1.362",
"pyroma==4.2",
"pytest==8.2.0",
"pytest-cov==5.0.0",
"pytest-regressions==2.5.0",
"ruff==0.4.4",
"setuptools-scm==8.1.0",
"sphinx==7.3.7",
"sphinx-click==5.1.0",
"sphinx-inline-tabs==2023.4.21",
"sphinx-prompt==1.8",
"sphinx-substitution-extensions==2024.2.25",
"sphinxcontrib-spelling==8",
"types-docker==7.0.0.20240507",
"types-pyyaml==6.0.12.20240311",
"vulture==2.11",
"vws-python-mock==2024.2.16",
"vws-test-fixtures==2023.3.5",
]
optional-dependencies.packaging = [
"pyinstaller==6.6.0",
]
urls.Source = "https://github.com/VWS-Python/vws-cli"
scripts.vuforia-cloud-reco = "vws_cli.query:vuforia_cloud_reco"
scripts.vws = "vws_cli:vws_group"
[tool.setuptools]
zip-safe = false
[tool.setuptools.packages.find]
where = [
"src",
]
[tool.setuptools.package-data]
vws_cli = [
"py.typed",
]
[tool.setuptools_scm]
# We write the version to a file so that we can import it.
# We choose a ``.py`` file so that we can read it without
# worrying about including the file in MANIFEST.in.
write_to = "src/vws_cli/_setuptools_scm_version.py"
[tool.ruff]
line-length = 79
[tool.ruff.lint]
select = [
"ALL",
]
ignore = [
# We are happy to manage our own "complexity".
"C901",
# Ruff warns that this conflicts with the formatter.
"COM812",
# Allow our chosen docstring line-style - no one-line summary.
"D200",
"D205",
"D212",
"D415",
# Allow backslashes in a docstring.
# See https://click.palletsprojects.com/en/8.0.x/documentation/#preventing-rewrapping.
"D301",
# Let the formatter handle line lengths, and ignore the errors.
"E501",
# Ruff warns that this conflicts with the formatter.
"ISC001",
# Ignore "too-many-*" errors as they seem to get in the way more than
# helping.
"PLR0912",
"PLR0913",
# Allow 'assert' as we use it for tests.
"S101",
]
# Do not automatically remove commented out code.
# We comment out code during development, and with VSCode auto-save, this code
# is sometimes annoyingly removed.
unfixable = [
"ERA001",
]
[tool.ruff.lint.per-file-ignores]
"tests/test_*.py" = [
# Do not require tests to have a one-line summary.
"D205",
]
[tool.ruff.lint.pydocstyle]
convention = "google"
[tool.pylint]
[tool.pylint.'FORMAT']
# Allow the body of an if to be on the same line as the test if there is no
# else.
single-line-if-stmt = false
[tool.pylint.'MASTER']
# Pickle collected data for later comparisons.
persistent = true
# Use multiple processes to speed up Pylint.
jobs = 0
# List of plugins (as comma separated values of python modules names) to load,
# usually to register additional checkers.
# See https://chezsoi.org/lucas/blog/pylint-strict-base-configuration.html.
# We do not use the plugins:
# - pylint.extensions.code_style
# - pylint.extensions.magic_value
# - pylint.extensions.while_used
# as they seemed to get in the way.
load-plugins = [
'pylint.extensions.bad_builtin',
'pylint.extensions.comparison_placement',
'pylint.extensions.consider_refactoring_into_while_condition',
'pylint.extensions.docparams',
'pylint.extensions.dunder',
'pylint.extensions.eq_without_hash',
'pylint.extensions.for_any_all',
'pylint.extensions.mccabe',
'pylint.extensions.no_self_use',
'pylint.extensions.overlapping_exceptions',
'pylint.extensions.private_import',
'pylint.extensions.redefined_loop_name',
'pylint.extensions.redefined_variable_type',
'pylint.extensions.set_membership',
'pylint.extensions.typing',
]
# Allow loading of arbitrary C extensions. Extensions are imported into the
# active Python interpreter and may run arbitrary code.
unsafe-load-any-extension = false
ignore = [
'_setuptools_scm_version.py',
]
[tool.pylint.'MESSAGES CONTROL']
# Enable the message, report, category or checker with the given id(s). You can
# either give multiple identifier separated by comma (,) or put this option
# multiple time (only on the command line, not in the configuration file where
# it should appear only once). See also the "--disable" option for examples.
enable = [
'bad-inline-option',
'deprecated-pragma',
'file-ignored',
'spelling',
'use-symbolic-message-instead',
'useless-suppression',
]
# Disable the message, report, category or checker with the given id(s). You
# can either give multiple identifiers separated by comma (,) or put this
# option multiple times (only on the command line, not in the configuration
# file where it should appear only once).You can also use "--disable=all" to
# disable everything first and then reenable specific checks. For example, if
# you want to run only the similarities checker, you can use "--disable=all
# --enable=similarities". If you want to run only the classes checker, but have
# no Warning level messages displayed, use"--disable=all --enable=classes
# --disable=W"
disable = [
'too-few-public-methods',
'too-many-locals',
'too-many-arguments',
'too-many-instance-attributes',
'too-many-return-statements',
'too-many-lines',
'locally-disabled',
# Let ruff handle long lines
'line-too-long',
# Let ruff handle unused imports
'unused-import',
# Let ruff deal with sorting
'ungrouped-imports',
# We don't need everything to be documented because of mypy
'missing-type-doc',
'missing-return-type-doc',
# Too difficult to please
'duplicate-code',
# Let ruff handle imports
'wrong-import-order',
]
[tool.pylint.'SPELLING']
# Spelling dictionary name. Available dictionaries: none. To make it working
# install python-enchant package.
spelling-dict = 'en_US'
# A path to a file that contains private dictionary; one word per line.
spelling-private-dict-file = 'spelling_private_dict.txt'
# Tells whether to store unknown words to indicated private dictionary in
# --spelling-private-dict-file option instead of raising a message.
spelling-store-unknown-words = 'no'
[tool.check-manifest]
ignore = [
"*.enc",
"readthedocs.yaml",
"admin",
"admin/**",
"CHANGELOG.rst",
"CODE_OF_CONDUCT.rst",
"CONTRIBUTING.rst",
"LICENSE",
"Makefile",
"ci",
"ci/**",
"codecov.yaml",
"docs",
"docs/**",
".git_archival.txt",
"spelling_private_dict.txt",
"tests",
"tests-pylintrc",
"tests/**",
"vuforia_secrets.env.example",
"lint.mk",
"bin",
"bin/*",
"src/*/_setuptools_scm_version.py",
]
[tool.deptry]
pep621_dev_dependency_groups = [
"dev",
"packaging",
]
[tool.pyproject-fmt]
indent = 4
keep_full_version = true
[tool.pytest.ini_options]
xfail_strict = true
log_cli = true
[tool.coverage.report]
exclude_also = [
"if TYPE_CHECKING:",
]
[tool.coverage.run]
branch = true
omit = [
'src/vws_cli/_setuptools_scm_version.py',
]
[tool.mypy]
strict = true
[tool.pyright]
reportUnnecessaryTypeIgnoreComment = true
typeCheckingMode = "strict"
[tool.doc8]
max_line_length = 2000
ignore_path = [
"./.eggs",
"./docs/build",
"./docs/build/spelling/output.txt",
"./node_modules",
"./src/*.egg-info/",
"./src/*/_setuptools_scm_version.txt",
]
```
I have the following
pyproject.toml
file. As ofpyproject-fmt
2.0.0
(and now with2.0.2
), thepyproject-fmt
changes are inconsistent. This means that I cannotpyproject-fmt pyproject.toml
and thenpyproject-fmt --check pyproject.toml
and expect it to pass.pyproject.toml
```toml [build-system] build-backend = "setuptools.build_meta" requires = [ "pip", "setuptools", "setuptools-scm[toml]>=8.0.1", "wheel", ] [project] name = "vws-cli" description = "A CLI for the Vuforia Web Services (VWS) API." readme = { file = "README.rst", content-type = "text/x-rst" } keywords = [ "cli", "vuforia", "vws", ] license = { file = "LICENSE" } authors = [ { name = "Adam Dangoor", email = "adamdangoor@gmail.com" }, ] requires-python = ">=3.12" classifiers = [ "Development Status :: 5 - Production/Stable", "Environment :: Web Environment", "License :: OSI Approved :: MIT License", "Operating System :: POSIX", "Programming Language :: Python :: 3 :: Only", "Programming Language :: Python :: 3.12", ] dynamic = [ "version", ] dependencies = [ "click==8.1.7", "pyyaml==6.0.1", "vws-python==2024.2.19", ] optional-dependencies.dev = [ "actionlint-py==1.6.27.13", "check-manifest==0.49", "check-wheel-contents==0.6.0", "deptry==0.16.1", "doc8==1.1.1", "docker==7.0.0", "freezegun==1.5.0", "furo==2024.5.6", "homebrew-pypi-poet==0.10", "mypy==1.10.0", "pylint==3.1.0", "pyproject-fmt==2.0.0", "pyright==1.1.362", "pyroma==4.2", "pytest==8.2.0", "pytest-cov==5.0.0", "pytest-regressions==2.5.0", "ruff==0.4.4", "setuptools-scm==8.1.0", "sphinx==7.3.7", "sphinx-click==5.1.0", "sphinx-inline-tabs==2023.4.21", "sphinx-prompt==1.8", "sphinx-substitution-extensions==2024.2.25", "sphinxcontrib-spelling==8", "types-docker==7.0.0.20240507", "types-pyyaml==6.0.12.20240311", "vulture==2.11", "vws-python-mock==2024.2.16", "vws-test-fixtures==2023.3.5", ] optional-dependencies.packaging = [ "pyinstaller==6.6.0", ] urls.Source = "https://github.com/VWS-Python/vws-cli" scripts.vuforia-cloud-reco = "vws_cli.query:vuforia_cloud_reco" scripts.vws = "vws_cli:vws_group" [tool.setuptools] zip-safe = false [tool.setuptools.packages.find] where = [ "src", ] [tool.setuptools.package-data] vws_cli = [ "py.typed", ] [tool.setuptools_scm] # We write the version to a file so that we can import it. # We choose a ``.py`` file so that we can read it without # worrying about including the file in MANIFEST.in. write_to = "src/vws_cli/_setuptools_scm_version.py" [tool.ruff] line-length = 79 [tool.ruff.lint] select = [ "ALL", ] ignore = [ # We are happy to manage our own "complexity". "C901", # Ruff warns that this conflicts with the formatter. "COM812", # Allow our chosen docstring line-style - no one-line summary. "D200", "D205", "D212", "D415", # Allow backslashes in a docstring. # See https://click.palletsprojects.com/en/8.0.x/documentation/#preventing-rewrapping. "D301", # Let the formatter handle line lengths, and ignore the errors. "E501", # Ruff warns that this conflicts with the formatter. "ISC001", # Ignore "too-many-*" errors as they seem to get in the way more than # helping. "PLR0912", "PLR0913", # Allow 'assert' as we use it for tests. "S101", ] # Do not automatically remove commented out code. # We comment out code during development, and with VSCode auto-save, this code # is sometimes annoyingly removed. unfixable = [ "ERA001", ] [tool.ruff.lint.per-file-ignores] "tests/test_*.py" = [ # Do not require tests to have a one-line summary. "D205", ] [tool.ruff.lint.pydocstyle] convention = "google" [tool.pylint] [tool.pylint.'FORMAT'] # Allow the body of an if to be on the same line as the test if there is no # else. single-line-if-stmt = false [tool.pylint.'MASTER'] # Pickle collected data for later comparisons. persistent = true # Use multiple processes to speed up Pylint. jobs = 0 # List of plugins (as comma separated values of python modules names) to load, # usually to register additional checkers. # See https://chezsoi.org/lucas/blog/pylint-strict-base-configuration.html. # We do not use the plugins: # - pylint.extensions.code_style # - pylint.extensions.magic_value # - pylint.extensions.while_used # as they seemed to get in the way. load-plugins = [ 'pylint.extensions.bad_builtin', 'pylint.extensions.comparison_placement', 'pylint.extensions.consider_refactoring_into_while_condition', 'pylint.extensions.docparams', 'pylint.extensions.dunder', 'pylint.extensions.eq_without_hash', 'pylint.extensions.for_any_all', 'pylint.extensions.mccabe', 'pylint.extensions.no_self_use', 'pylint.extensions.overlapping_exceptions', 'pylint.extensions.private_import', 'pylint.extensions.redefined_loop_name', 'pylint.extensions.redefined_variable_type', 'pylint.extensions.set_membership', 'pylint.extensions.typing', ] # Allow loading of arbitrary C extensions. Extensions are imported into the # active Python interpreter and may run arbitrary code. unsafe-load-any-extension = false ignore = [ '_setuptools_scm_version.py', ] [tool.pylint.'MESSAGES CONTROL'] # Enable the message, report, category or checker with the given id(s). You can # either give multiple identifier separated by comma (,) or put this option # multiple time (only on the command line, not in the configuration file where # it should appear only once). See also the "--disable" option for examples. enable = [ 'bad-inline-option', 'deprecated-pragma', 'file-ignored', 'spelling', 'use-symbolic-message-instead', 'useless-suppression', ] # Disable the message, report, category or checker with the given id(s). You # can either give multiple identifiers separated by comma (,) or put this # option multiple times (only on the command line, not in the configuration # file where it should appear only once).You can also use "--disable=all" to # disable everything first and then reenable specific checks. For example, if # you want to run only the similarities checker, you can use "--disable=all # --enable=similarities". If you want to run only the classes checker, but have # no Warning level messages displayed, use"--disable=all --enable=classes # --disable=W" disable = [ 'too-few-public-methods', 'too-many-locals', 'too-many-arguments', 'too-many-instance-attributes', 'too-many-return-statements', 'too-many-lines', 'locally-disabled', # Let ruff handle long lines 'line-too-long', # Let ruff handle unused imports 'unused-import', # Let ruff deal with sorting 'ungrouped-imports', # We don't need everything to be documented because of mypy 'missing-type-doc', 'missing-return-type-doc', # Too difficult to please 'duplicate-code', # Let ruff handle imports 'wrong-import-order', ] [tool.pylint.'SPELLING'] # Spelling dictionary name. Available dictionaries: none. To make it working # install python-enchant package. spelling-dict = 'en_US' # A path to a file that contains private dictionary; one word per line. spelling-private-dict-file = 'spelling_private_dict.txt' # Tells whether to store unknown words to indicated private dictionary in # --spelling-private-dict-file option instead of raising a message. spelling-store-unknown-words = 'no' [tool.check-manifest] ignore = [ "*.enc", "readthedocs.yaml", "admin", "admin/**", "CHANGELOG.rst", "CODE_OF_CONDUCT.rst", "CONTRIBUTING.rst", "LICENSE", "Makefile", "ci", "ci/**", "codecov.yaml", "docs", "docs/**", ".git_archival.txt", "spelling_private_dict.txt", "tests", "tests-pylintrc", "tests/**", "vuforia_secrets.env.example", "lint.mk", "bin", "bin/*", "src/*/_setuptools_scm_version.py", ] [tool.deptry] pep621_dev_dependency_groups = [ "dev", "packaging", ] [tool.pyproject-fmt] indent = 4 keep_full_version = true [tool.pytest.ini_options] xfail_strict = true log_cli = true [tool.coverage.report] exclude_also = [ "if TYPE_CHECKING:", ] [tool.coverage.run] branch = true omit = [ 'src/vws_cli/_setuptools_scm_version.py', ] [tool.mypy] strict = true [tool.pyright] reportUnnecessaryTypeIgnoreComment = true typeCheckingMode = "strict" [tool.doc8] max_line_length = 2000 ignore_path = [ "./.eggs", "./docs/build", "./docs/build/spelling/output.txt", "./node_modules", "./src/*.egg-info/", "./src/*/_setuptools_scm_version.txt", ] ```