Skip to content

Commit

Permalink
pyproject: apply pyproject-fmt v2 style
Browse files Browse the repository at this point in the history
  • Loading branch information
airwoodix committed May 21, 2024
1 parent 33d16bf commit 32ad8a0
Showing 1 changed file with 160 additions and 139 deletions.
299 changes: 160 additions & 139 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,36 +1,49 @@
[build-system]
build-backend = "poetry.core.masonry.api"
requires = [
"poetry-core>=1",
]

[tool.poetry]
name = "qiskit-aqt-provider"
version = "1.4.0"
description = "Qiskit provider for AQT backends"
authors = ["Qiskit Development Team", "Alpine Quantum Technologies GmbH"]
authors = [
"Qiskit Development Team",
"Alpine Quantum Technologies GmbH",
]
repository = "https://github.com/qiskit-community/qiskit-aqt-provider"
documentation = "https://qiskit-community.github.io/qiskit-aqt-provider"
readme = "README.md"
license = "Apache-2.0"
classifiers=[
"Intended Audience :: Developers",
"Intended Audience :: Science/Research",
"Operating System :: Microsoft :: Windows",
"Operating System :: MacOS",
"Operating System :: POSIX :: Linux",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Topic :: Scientific/Engineering",
]
keywords=["qiskit", "sdk", "quantum"]
classifiers = [
"Intended Audience :: Developers",
"Intended Audience :: Science/Research",
"Operating System :: Microsoft :: Windows",
"Operating System :: MacOS",
"Operating System :: POSIX :: Linux",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Topic :: Scientific/Engineering",
]
keywords = [
"qiskit",
"sdk",
"quantum",
]

packages = [
{ include = "qiskit_aqt_provider" },
{ include = "test", format = "sdist" }
{ include = "qiskit_aqt_provider" },
{ include = "test", format = "sdist" },
]
include = [
"CODE_OF_CONDUCT.md",
"CONTRIBUTING.md",
"LICENSE.txt",
"README.md"
"CODE_OF_CONDUCT.md",
"CONTRIBUTING.md",
"LICENSE.txt",
"README.md",
]

[tool.poetry.plugins."qiskit.transpiler.scheduling"]
Expand Down Expand Up @@ -70,14 +83,16 @@ mypy = "=1.10.0"
poethepoet = "^0.18.1"
polyfactory = "^2.0.0"
pre-commit = "^3.1.1"
pyproject-fmt = "^1.7.0"
pyproject-fmt = "^2.1.3"
pytest = ">=7"
pytest-httpx = "^0.22.0"
pytest-mock = "^3.11.1"
pytest-sugar = "^0.9.6"
qiskit-experiments = "^0.6.0"
qiskit-sphinx-theme = ">=1.16.1"
qiskit = {version = "^1", extras = ["visualization"]}
qiskit = { version = "^1", extras = [
"visualization",
] }
rich = "^13.5.3"
ruff = "^0.4.2"
sphinx = ">=7,<7.3"
Expand All @@ -91,35 +106,101 @@ typos = "^1.21.0"

[tool.poetry.extras]
examples = [
"qiskit-algorithms",
"qiskit-optimization",
"qiskit-algorithms",
"qiskit-optimization",
]

[build-system]
build-backend = "poetry.core.masonry.api"
requires = [
"poetry-core>=1",
[tool.ruff]
target-version = "py39"
line-length = 100
extend-exclude = [
"qiskit_aqt_provider/api_models_generated.py", # generated code
]

[tool.datamodel-codegen]
disable-timestamp = true
enable-faux-immutability = true
enum-field-as-literal = "one"
field-constraints = true
output-model-type = "pydantic_v2.BaseModel"
strict-nullable = true
target-python-version = '3.9'
use-annotated = true
use-double-quotes = true
use-field-description = true
use-schema-description = true
wrap-string-literal = true
lint.select = [
"ARG", # flake8-unused-arguments
"BLE", # flake8-blind-except
"C4", # flake8-comprehensions
"C90", # mccabe
"COM", # flake8-commas
"D", # pydocstyle
"E", # pycodestyle errors
"ERA", # eradicate
"F", # pyflakes
"I", # isort
"ICN", # flake8-import-conventions
"ISC", # flake8-implicit-str-concat
"NPY", # numpy
"PGH", # pygrep-hooks
"PIE", # flake8-pie
"PT", # flake8-pytest-style
"PTH", # flake8-use-pathlib
"PYI", # flake8-pyi
"RET", # flake8-return
"RSE", # flake8-raise
"RUF", # ruff specials
"S", # flake8-bandit
"SIM", # flake8-simplify
"T10", # flake8-debugger
"T20", # flake8-print
"TID", # flake8-tidy-imports
"UP", # pyupgrade
"W", # pycodestyle warnings
]
lint.ignore = [
"COM812",
"COM819",
"D100", # missing docstring in public module
"D101", # missing docstring in public class
"D102", # missing docstring in public method
"D104", # missing docstring in public package
"D107", # missing docstring in __init__
"D206",
"D211", # no-blank-line-before-class (incompatible with D203)
"D213", # multiline-summary-second-line (incompatible with D212)
"D300",
"E111",
"E114",
"E117",
"E501",
"ISC001",
"ISC002",
"Q000",
"Q001",
"Q002",
"Q003",
"S311", # suspicious-non-cryptographic-random-usage
"SIM117", # multiple-with-statements
#
# ignore following rules since they are conflicting with the formatter
# https://docs.astral.sh/ruff/formatter/#conflicting-lint-rules
"W191",
]
lint.per-file-ignores."examples/*.py" = [
"T201", # allow prints
]
lint.per-file-ignores."scripts/*.py" = [
"T201", # allow prints
]
lint.per-file-ignores."test/**/*.py" = [
"D205", # allow multiline docstring summaries
"PT011", # allow pytest.raises without match=
"S101", # allow assertions
]
lint.pydocstyle.convention = "google"

[tool.coverage.run]
dynamic_context = "test_function"
relative_files = true

[tool.coverage.report]
fail_under = 99

[tool.pyright]
exclude = [
"**/__pycache__",
"**/.*",
"docs/",
"**/__pycache__",
"**/.*",
"docs/",
]

typeCheckingMode = "basic"
Expand All @@ -137,102 +218,27 @@ reportDuplicateImport = "error"
pythonVersion = "3.9"
pythonPlatform = "Linux"

[tool.ruff]
line-length = 100
target-version = 'py39'
extend-exclude = [
"qiskit_aqt_provider/api_models_generated.py", # generated code
]

[tool.ruff.lint]
select = [
"ARG", # flake8-unused-arguments
"BLE", # flake8-blind-except
"C4", # flake8-comprehensions
"C90", # mccabe
"COM", # flake8-commas
"D", # pydocstyle
"E", # pycodestyle errors
"ERA", # eradicate
"F", # pyflakes
"I", # isort
"ICN", # flake8-import-conventions
"ISC", # flake8-implicit-str-concat
"NPY", # numpy
"PGH", # pygrep-hooks
"PIE", # flake8-pie
"PT", # flake8-pytest-style
"PTH", # flake8-use-pathlib
"PYI", # flake8-pyi
"RET", # flake8-return
"RSE", # flake8-raise
"RUF", # ruff specials
"S", # flake8-bandit
"SIM", # flake8-simplify
"T10", # flake8-debugger
"T20", # flake8-print
"TID", # flake8-tidy-imports
"UP", # pyupgrade
"W", # pycodestyle warnings
]
ignore = [
"D100", # missing docstring in public module
"D101", # missing docstring in public class
"D102", # missing docstring in public method
"D104", # missing docstring in public package
"D107", # missing docstring in __init__
"D211", # no-blank-line-before-class (incompatible with D203)
"D213", # multiline-summary-second-line (incompatible with D212)
"S311", # suspicious-non-cryptographic-random-usage
"SIM117", # multiple-with-statements
#
# ignore following rules since they are conflicting with the formatter
# https://docs.astral.sh/ruff/formatter/#conflicting-lint-rules
"W191",
"E111",
"E114",
"E117",
"E501",
"D206",
"D300",
"Q000",
"Q001",
"Q002",
"Q003",
"COM812",
"COM819",
"ISC001",
"ISC002",
]

[tool.ruff.lint.per-file-ignores]
"examples/*.py" = [
"T201", # allow prints
]
"scripts/*.py" = [
"T201", # allow prints
]
"test/**/*.py" = [
"S101", # allow assertions
"D205", # allow multiline docstring summaries
"PT011", # allow pytest.raises without match=
]

[tool.ruff.lint.pydocstyle]
convention = "google"

[tool.coverage.run]
dynamic_context = "test_function"
relative_files = true

[tool.coverage.report]
fail_under = 99
[tool.datamodel-codegen]
disable-timestamp = true
enable-faux-immutability = true
enum-field-as-literal = "one"
field-constraints = true
output-model-type = "pydantic_v2.BaseModel"
strict-nullable = true
target-python-version = '3.9'
use-annotated = true
use-double-quotes = true
use-field-description = true
use-schema-description = true
wrap-string-literal = true

[tool.interrogate]
ignore-module = true
ignore-nested-functions = true
ignore-magic = true
exclude = ["qiskit_aqt_provider/api_models_generated.py"]
exclude = [
"qiskit_aqt_provider/api_models_generated.py",
]
fail-under = 100

[tool.typos.files]
Expand Down Expand Up @@ -285,9 +291,24 @@ shell = "interrogate -v qiskit_aqt_provider test"
shell = "typos ."

[tool.poe.tasks]
lint = ["check_api_models", "docstring_coverage", "ruff_check", "spellcheck"]
format_check = ["python_format_check", "pyproject_format_check"]
lint = [
"check_api_models",
"docstring_coverage",
"ruff_check",
"spellcheck",
]
format_check = [
"python_format_check",
"pyproject_format_check",
]
generate-models = "./scripts/api_models.py generate"
version_check = "./scripts/package_version.py --verbose check"
docs = "sphinx-build -j auto -b html -W docs docs/_build"
all = ["version_check", "format_check", "lint", "typecheck", "test", "docs"]
all = [
"version_check",
"format_check",
"lint",
"typecheck",
"test",
"docs",
]

0 comments on commit 32ad8a0

Please sign in to comment.