pyproject: format using pyproject-fmt (#9053)

I haven't added pyproject-fmt to pre-commit hook because of two reasons:
1. There is a bug that keeps adding empty lines after `[[tool.mypy.overrides]]`.
2. The list gets exploded to multiple lines. However, this is a minor issue.
This commit is contained in:
skshetry
2023-02-18 23:07:57 +05:45
committed by GitHub
parent 30337bf0ba
commit fd8a8c2729
+179 -198
View File
@@ -1,65 +1,25 @@
[build-system]
requires = ["setuptools>=61", "setuptools_scm[toml]>=7"]
build-backend = "setuptools.build_meta"
requires = ["setuptools>=61", "setuptools_scm[toml]>=7"]
[project]
name = "dvc"
description = "Git for data scientists - manage your code and data together"
readme = "README.rst"
keywords = [
"ai",
"collaboration",
"data-science",
"data-version-control",
"machine-learning",
"git",
"developer-tools",
"git",
"machine-learning",
"reproducibility",
"collaboration",
"ai",
]
license = { text = "Apache License 2.0" }
authors = [{ name = "Dmitry Petrov", email = "[email protected]" }]
maintainers = [{ name = "Iterative", email = "[email protected]" }]
authors = [{ name = "Dmitry Petrov", email = "[email protected]" }]
requires-python = ">=3.8"
dependencies = [
"colorama>=0.3.9",
"configobj>=5.0.6",
"voluptuous>=0.11.7",
"requests>=2.22.0",
"grandalf>=0.7,<1",
"distro>=1.3.0",
"appdirs>=1.4.3",
"ruamel.yaml>=0.17.11",
"tomlkit>=0.11.1",
"funcy>=1.14",
"pathspec>=0.10.3",
"shortuuid>=0.5.0",
"tqdm>=4.63.1,<5",
"packaging>=19.0",
"zc.lockfile>=1.2.1",
"flufl.lock>=5",
"networkx>=2.5",
"psutil>=5.8.0",
"pydot>=1.2.4",
"importlib-resources>=5.2.2; python_version < '3.9'",
"flatten_dict>=0.4.1,<1",
"tabulate>=0.8.7",
"pygtrie>=2.3.2",
"dpath>=2.0.2,<3",
"shtab>=1.3.4,<2",
"rich>=12.0.0",
"pyparsing>=2.4.7",
"typing-extensions>=3.7.4",
"scmrepo==0.1.11",
"dvc-render>=0.1.2",
"dvc-task==0.1.11",
"dvclive>=1.2.2",
"dvc-data==0.40.4",
"dvc-http",
"hydra-core>=1.1.0",
"iterative-telemetry==0.0.7",
"dvc-studio-client>=0.1.1"
]
dynamic = ["version"]
classifiers = [
"Development Status :: 4 - Beta",
"Programming Language :: Python :: 3",
@@ -68,36 +28,53 @@ classifiers = [
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
]
dynamic = ["version"]
dependencies = [
"appdirs>=1.4.3",
"colorama>=0.3.9",
"configobj>=5.0.6",
"distro>=1.3",
"dpath<3,>=2.0.2",
"dvc-data==0.40.4",
"dvc-http",
"dvc-render>=0.1.2",
"dvc-studio-client>=0.1.1",
"dvc-task==0.1.11",
"dvclive>=1.2.2",
"flatten_dict<1,>=0.4.1",
"flufl.lock>=5",
"funcy>=1.14",
"grandalf<1,>=0.7",
"hydra-core>=1.1",
'importlib-resources>=5.2.2; python_version < "3.9"',
"iterative-telemetry==0.0.7",
"networkx>=2.5",
"packaging>=19",
"pathspec>=0.10.3",
"psutil>=5.8",
"pydot>=1.2.4",
"pygtrie>=2.3.2",
"pyparsing>=2.4.7",
"requests>=2.22",
"rich>=12",
"ruamel.yaml>=0.17.11",
"scmrepo==0.1.11",
"shortuuid>=0.5",
"shtab<2,>=1.3.4",
"tabulate>=0.8.7",
"tomlkit>=0.11.1",
"tqdm<5,>=4.63.1",
"typing-extensions>=3.7.4",
"voluptuous>=0.11.7",
"zc.lockfile>=1.2.1",
]
[project.optional-dependencies]
all = ["dvc[azure,gdrive,gs,hdfs,oss,s3,ssh,webdav,webhdfs]"]
azure = ["dvc-azure==2.21.1"]
dev = ["dvc[azure,gdrive,gs,hdfs,lint,oss,s3,ssh,terraform,tests,webdav,webhdfs]"]
gdrive = ["dvc-gdrive==2.19.1"]
gs = ["dvc-gs==2.21.1"]
hdfs = ["dvc-hdfs==2.19.0"]
oss = ["dvc-oss==2.19.0"]
s3 = ["dvc-s3==2.21.0"]
ssh = ["dvc-ssh==2.21.0"]
ssh_gssapi = ["dvc-ssh[gssapi]==2.21.0"]
webdav = ["dvc-webdav==2.19.1"]
webhdfs = ["dvc-webhdfs==2.19.0"]
webhdfs_kerberos = ["dvc-webhdfs[kerberos]==2.19.0"]
terraform = ["tpi[ssh]>=2.1.0"]
testing = ["pytest-test-utils"]
tests = [
"beautifulsoup4>=4.4",
"dvc-ssh",
"filelock",
"flaky",
"pytest>=7,<8",
"pytest-cov",
"pytest-docker==0.13.0",
"pytest-lazy-fixture",
"pytest-mock",
"pytest-test-utils",
"pytest-xdist>=3.1",
"pytest-timeout>=2",
"pywin32>=225; sys_platform == 'win32'", # optional test dependency
]
hdfs = ["dvc-hdfs==2.19"]
lint = [
"mypy==1.0.1",
"pylint==2.16.2",
@@ -109,57 +86,157 @@ lint = [
"types-toml",
"types-tqdm",
]
all = ["dvc[azure,gdrive,gs,hdfs,oss,s3,ssh,webdav,webhdfs]"]
dev = ["dvc[azure,gdrive,gs,hdfs,oss,s3,ssh,webdav,webhdfs,tests,lint,terraform]"]
oss = ["dvc-oss==2.19"]
s3 = ["dvc-s3==2.21"]
ssh = ["dvc-ssh==2.21"]
ssh_gssapi = ["dvc-ssh[gssapi]==2.21"]
terraform = ["tpi[ssh]>=2.1"]
testing = ["pytest-test-utils"]
tests = [
"beautifulsoup4>=4.4",
"dvc-ssh",
"filelock",
"flaky",
"pytest<8,>=7",
"pytest-cov",
"pytest-docker==0.13",
"pytest-lazy-fixture",
"pytest-mock",
"pytest-test-utils",
"pytest-timeout>=2",
"pytest-xdist>=3.1",
'pywin32>=225; sys_platform == "win32"', # optional test dependency
]
webdav = ["dvc-webdav==2.19.1"]
webhdfs = ["dvc-webhdfs==2.19"]
webhdfs_kerberos = ["dvc-webhdfs[kerberos]==2.19"]
[project.urls]
Documentation = "https://dvc.org/doc"
Issues = "https://github.com/iterative/dvc/issues"
Source = "https://github.com/iterative/dvc"
[project.scripts]
dvc = "dvc.cli:main"
[project.entry-points."fsspec.specs"]
dvc = "dvc.api:DVCFileSystem"
[tool.setuptools]
license-files = ["LICENSE"]
[tool.setuptools.packages]
find = {namespaces = false, exclude=["tests", "tests.*"]}
[tool.setuptools.packages.find]
exclude = ["tests", "tests.*"]
namespaces = false
[tool.setuptools_scm]
write_to = "dvc/_dvc_version.py"
[tool.black]
include = '\.pyi?$'
exclude = '''
/(
\.eggs
| \.git
| \.hg
| \.mypy_cache
| \.tox
| \.venv
| _build
| buck-out
| build
| dist
)/
'''
[tool.isort]
profile = "black"
known_first_party = ["dvc", "dvc_data", "dvc_objects", "dvc_render", "dvc_task", "tests"]
profile = "black"
[tool.pytest.ini_options]
addopts = "-ra --cov-config pyproject.toml"
filterwarnings = ["error::pytest_mock.PytestMockWarning"]
log_level = "debug"
markers = [
"needs_internet: Might need network access for the tests",
"studio: Tests verifying contract between DVC and Studio",
"vscode: Tests verifying contract between DVC and VSCode plugin",
]
testpaths = ["tests"]
xfail_strict = true
[tool.coverage.run]
branch = true
source = ["dvc", "tests"]
[tool.coverage.paths]
source = ["dvc"]
[tool.coverage.report]
exclude_lines = [
"if __name__ == .__main__.:",
"if TYPE_CHECKING:",
"if typing.TYPE_CHECKING:",
"@overload",
"pragma: no cover",
"raise AssertionError",
"raise NotImplementedError",
]
show_missing = true
[tool.mypy]
check_untyped_defs = true
files = ["dvc"]
no_implicit_optional = true
pretty = true
show_column_numbers = true
show_error_codes = true
show_error_context = true
show_traceback = true
strict_equality = true
strict_concatenate = true
warn_no_return = true
warn_redundant_casts = true
warn_unreachable = true
warn_unused_configs = true
[[tool.mypy.overrides]]
ignore_missing_imports = true
module = [
"celery.*",
"configobj.*",
"dpath.*",
"dvc_http",
"dvc_render.*",
"dvc_ssh",
"dvc_studio_client.*",
"flatten_dict",
"fsspec.*",
"funcy.*", # https://github.com/Suor/funcy/issues/106,
"grandalf.*",
"ipdb",
"iterative_telemetry",
"kombu.*",
"networkx.*", # https://github.com/networkx/networkx/issues/3988
"pygtrie.*",
"pyinstrument",
"pytest_docker.plugin",
"ruamel.*",
"ruamel.yaml.*",
"tpi.*",
"viztracer",
"voluptuous",
"yappi",
"zc.*",
]
[tool.codespell]
ignore-words-list = "ba,datas,fo,uptodate,cachable,falsy"
[tool.pylint.message_control]
disable = [
"cyclic-import", "design", "duplicate-code", "fixme", "format", "import-outside-toplevel", "invalid-name",
"missing-class-docstring", "missing-function-docstring", "missing-module-docstring", "multiple-imports",
"raise-missing-from", "refactoring", "spelling",
"ungrouped-imports", "unused-wildcard-import", "wrong-import-order", "wrong-import-position",
]
enable = ["c-extension-no-member", "no-else-return"]
[tool.pylint.typecheck]
generated-members = ["argparse.Namespace", "logger.trace", "logging.TRACE", "pytest.lazy_fixture", "sys.getwindowsversion"]
signature-mutators = ["funcy.decorators.decorator"]
[tool.pylint.variables]
dummy-variables-rgx = "_+$|(_[a-zA-Z0-9_]*[a-zA-Z0-9]+?$)"
ignored-argument-names = "_.*|args|kwargs"
[tool.ruff]
target-version = "py38"
show-source = true
ignore = ["N818", "S101", "PT004", "PT007", "PT019", "SIM105", "SIM108", "SIM110", "SIM111", "SIM117", "TRY003", "TRY200", "TRY300", "TRY301", "PLR2004", "RUF005"]
select = ["F", "E", "W", "C90", "N", "UP", "YTT", "S", "BLE", "B", "A", "C4", "T10", "ISC", "ICN", "G", "INP", "PIE", "T20", "PT", "Q", "RET501", "RET504", "SIM", "TID", "TCH", "ARG", "PGH", "PLC", "PLE", "PLR", "PLW", "TRY", "RUF"]
# external flake8 codes that should be preserved
external = ["B301", "C901", "E302", "W601"]
ignore = ["N818", "S101", "PT004", "PT007", "PT019", "SIM105", "SIM108", "SIM110", "SIM111", "SIM117", "TRY003", "TRY200", "TRY300", "TRY301", "PLR2004", "RUF005"]
select = ["F", "E", "W", "C90", "N", "UP", "YTT", "S", "BLE", "B", "A", "C4", "T10", "ISC", "ICN", "G", "INP", "PIE", "T20", "PT", "Q", "RET501", "RET504", "SIM", "TID", "TCH", "ARG", "PGH", "PLC", "PLE", "PLR", "PLW", "TRY", "RUF"]
show-source = true
target-version = "py38"
[tool.ruff.flake8-pytest-style]
fixture-parentheses = false
@@ -184,105 +261,9 @@ known-first-party = ["dvc", "dvc_data", "dvc_objects", "dvc_render", "dvc_task",
ignore-names = ["M", "SCM"]
[tool.ruff.per-file-ignores]
"dvc/commands/**" = ["N806"]
"dvc/testing/**" = ["ARG002"]
"scripts/**" = ["T201", "INP001", "TRY002"]
"dvc/commands/**" = ["N806"]
[tool.ruff.pylint]
max-args = 10
[tool.pytest.ini_options]
log_level = "debug"
addopts = "-ra --cov-config pyproject.toml"
markers = [
"needs_internet: Might need network access for the tests",
"vscode: Tests verifying contract between DVC and VSCode plugin",
"studio: Tests verifying contract between DVC and Studio",
]
xfail_strict = true
testpaths = ["tests"]
filterwarnings = ["error::pytest_mock.PytestMockWarning"]
[tool.coverage.run]
branch = true
source = ["dvc", "tests"]
[tool.coverage.paths]
source = ["dvc"]
[tool.coverage.report]
show_missing = true
exclude_lines = [
"if __name__ == .__main__.:",
"if typing.TYPE_CHECKING:",
"if TYPE_CHECKING:",
"@overload",
"pragma: no cover",
"raise NotImplementedError",
"raise AssertionError",
]
[tool.mypy]
# Error output
show_column_numbers = true
show_error_codes = true
show_error_context = true
show_traceback = true
pretty = true
no_implicit_optional = true
check_untyped_defs = true
strict_equality = true
strict_concatenate = true
# Warnings
warn_no_return = true
warn_redundant_casts = true
warn_unused_configs = true
warn_unreachable = true
ignore_missing_imports = true
files = ["dvc"]
[[tool.mypy.overrides]]
module = [
"celery.*",
"configobj.*",
"dpath.*",
"flatten_dict",
"fsspec.*",
"funcy.*", # https://github.com/Suor/funcy/issues/106,
"grandalf.*",
"ipdb",
"kombu.*",
"networkx.*", # https://github.com/networkx/networkx/issues/3988
"pygtrie.*",
"pyinstrument",
"pytest_docker.plugin",
"ruamel.*",
"ruamel.yaml.*",
"tpi.*",
"viztracer",
"voluptuous",
"yappi",
"zc.*",
]
ignore_missing_imports = true
[tool.pylint.message_control]
disable = [
"format", "refactoring", "spelling", "design", "invalid-name", "fixme",
"duplicate-code", "unused-wildcard-import", "cyclic-import", "wrong-import-order",
"wrong-import-position", "ungrouped-imports", "multiple-imports",
"missing-function-docstring", "missing-module-docstring",
"missing-class-docstring", "raise-missing-from", "import-outside-toplevel",
]
enable = ["c-extension-no-member", "no-else-return"]
[tool.pylint.typecheck]
generated-members = ["pytest.lazy_fixture", "logging.TRACE", "logger.trace", "sys.getwindowsversion", "argparse.Namespace"]
signature-mutators = ["funcy.decorators.decorator"]
[tool.pylint.variables]
dummy-variables-rgx = "_+$|(_[a-zA-Z0-9_]*[a-zA-Z0-9]+?$)"
ignored-argument-names = "_.*|args|kwargs"
[tool.codespell]
ignore-words-list = "ba,datas,fo,uptodate,cachable,falsy"