Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
175 changes: 68 additions & 107 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -54,18 +54,14 @@ optional-dependencies.dev = [
"pygments==2.19.2",
"pylint[spelling]==4.0.4",
"pylint-per-file-ignores==3.2.0",
"pyproject-fmt==2.12.1",
"pyproject-fmt==2.14.0",
"pyrefly==0.51.1",
"pyright==1.1.408",
"pyroma==5.0.1",
"pytest==9.0.2",
"pytest-cov==7.0.0",
"pyyaml==6.0.3",
"ruff==0.15.0",
# We add shellcheck-py not only for shell scripts and shell code blocks,
# but also because having it installed means that ``actionlint-py`` will
# use it to lint shell commands in GitHub workflow files.
"shellcheck-py==0.11.0.1",
"shfmt-py==3.12.0.2",
"sphinx==9.1.0",
"sphinx-copybutton==0.5.2",
Expand All @@ -79,6 +75,10 @@ optional-dependencies.dev = [
"vulture==2.14",
"vws-python-mock==2025.3.10.1",
"vws-test-fixtures==2023.3.5",
# We add shellcheck-py not only for shell scripts and shell code blocks,
# but also because having it installed means that ``actionlint-py`` will
# use it to lint shell commands in GitHub workflow files.
"shellcheck-py==0.11.0.1",
"yamlfix==1.19.1",
"zizmor==1.22.0",
]
Expand All @@ -88,22 +88,17 @@ urls.Source = "https://github.com/VWS-Python/vws-python"

[tool.setuptools]
zip-safe = false

[tool.setuptools.package-data]
vws = [
package-data.vws = [
"py.typed",
]

[tool.setuptools.packages.find]
where = [
packages.find.where = [
"src",
]

[tool.distutils.bdist_wheel]
universal = true
[tool.distutils]
bdist_wheel.universal = true

[tool.setuptools_scm]

# This keeps the start of the version the same as the last release.
# This is useful for our documentation to include e.g. binary links
# to the latest released binary.
Expand All @@ -113,39 +108,34 @@ version_scheme = "post-release"

[tool.ruff]
line-length = 79

lint.select = [
"ALL",
]
lint.ignore = [
# Ruff warns that this conflicts with the formatter.
"COM812",
# Allow our chosen docstring line-style - pydocstringformatter handles formatting
# but doesn't enforce D205 (blank line after summary) or D212 (summary on first line).
"D205",
"D212",
# Ruff warns that this conflicts with the formatter.
"ISC001",
# Ignore "too-many-*" errors as they seem to get in the way more than
# Ignore 'too-many-*' errors as they seem to get in the way more than
# helping.
"PLR0913",
# Ruff warns that this conflicts with the formatter.
"COM812",
# Ruff warns that this conflicts with the formatter.
"ISC001",
"D212",
]

lint.per-file-ignores."doccmd_*.py" = [
# Allow asserts in docs.
"S101",
]

lint.per-file-ignores."docs/source/*.py" = [
# Allow asserts in docs.
"S101",
]

lint.per-file-ignores."tests/*.py" = [
# Allow asserts in 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.
Expand All @@ -155,21 +145,13 @@ lint.unfixable = [
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']

"FORMAT".single-line-if-stmt = false
# Pickle collected data for later comparisons.
persistent = true

"MASTER".persistent = true
# Use multiple processes to speed up Pylint.
jobs = 0

"MASTER".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.
Expand All @@ -179,44 +161,39 @@ jobs = 0
# - pylint.extensions.magic_value
# - pylint.extensions.while_used
# as they seemed to get in the way.
load-plugins = [
"MASTER".load-plugins = [
"pylint_per_file_ignores",
'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',
"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

[tool.pylint.'MESSAGES CONTROL']

"MASTER".unsafe-load-any-extension = false
# 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',
"MESSAGES CONTROL".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
Expand All @@ -226,57 +203,49 @@ enable = [
# --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',
"MESSAGES CONTROL".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',
"line-too-long",
# Let ruff handle unused imports
'unused-import',
"unused-import",
# Let ruff deal with sorting
'ungrouped-imports',
"ungrouped-imports",
# We don't need everything to be documented because of mypy
'missing-type-doc',
'missing-return-type-doc',
"missing-type-doc",
"missing-return-type-doc",
# Too difficult to please
'duplicate-code',
"duplicate-code",
# Let ruff handle imports
'wrong-import-order',
"wrong-import-order",
# mypy does not want untyped parameters.
'useless-type-doc',
"useless-type-doc",
]

# We ignore invalid names because:
# - We want to use generated module names, which may not be valid, but are never seen.
# - We want to use global variables in documentation, which may not be uppercase.
# - conf.py is a Sphinx configuration file which requires lowercase global variable names.
per-file-ignores = [
"MESSAGES CONTROL".per-file-ignores = [
"docs/source/conf.py:invalid-name",
"docs/source/doccmd_*.py:invalid-name",
"doccmd_README_rst_*.py:invalid-name",
]

[tool.pylint.'SPELLING']

# Spelling dictionary name. Available dictionaries: none. To make it working
# install python-enchant package.
spelling-dict = 'en_US'

"SPELLING".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'

"SPELLING".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'
"SPELLING".spelling-store-unknown-words = "no"

[tool.check-manifest]

ignore = [
".checkmake-config.ini",
".prettierrc",
Expand Down Expand Up @@ -314,22 +283,17 @@ indent = 4
keep_full_version = true
max_supported_python = "3.14"

[tool.pytest.ini_options]

xfail_strict = true
log_cli = true
[tool.pytest]
ini_options.xfail_strict = true
ini_options.log_cli = true

[tool.coverage.report]
exclude_also = [
[tool.coverage]
report.exclude_also = [
"if TYPE_CHECKING:",
]

[tool.coverage.run]

branch = true
run.branch = true

[tool.mypy]

strict = true
files = [ "." ]
exclude = [ "build" ]
Expand All @@ -339,7 +303,6 @@ plugins = [
]

[tool.pyright]

enableTypeIgnoreComments = false
reportUnnecessaryTypeIgnoreComment = true
typeCheckingMode = "strict"
Expand All @@ -359,7 +322,6 @@ omit-covered-files = true
verbose = 2

[tool.doc8]

max_line_length = 2000
ignore_path = [
"./.eggs",
Expand Down Expand Up @@ -408,7 +370,6 @@ ignore_names = [
"templates_path",
"warning_is_error",
]

# Duplicate some of .gitignore
exclude = [ ".venv" ]

Expand Down