diff --git a/.github/SECURITY.md b/.github/SECURITY.md index e70dcb3d..35f43c1c 100644 --- a/.github/SECURITY.md +++ b/.github/SECURITY.md @@ -2,10 +2,10 @@ ## Supported Versions -| Version | Supported | -| -------- | ------------------ | -| 1.18 + | :white_check_mark: | -| < 1.18 | :x: | +| Version | Supported | +| ------- | ------------------ | +| 1.18 + | :white_check_mark: | +| < 1.18 | :x: | ## Reporting a Vulnerability diff --git a/.markdownlint.yaml b/.markdownlint.yaml new file mode 100644 index 00000000..f30749b7 --- /dev/null +++ b/.markdownlint.yaml @@ -0,0 +1,8 @@ +MD013: + code_blocks: false + headers: false + line_length: 120 + tables: false + +MD046: + style: fenced diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 402abe5d..29a62500 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -15,11 +15,11 @@ repos: rev: v2.37.3 hooks: - id: pyupgrade - args: [ "--py37-plus" ] + args: ["--py37-plus"] exclude: "^(tests/roots/test-dummy/dummy_module.py)$" - id: pyupgrade files: "^(tests/roots/test-dummy/dummy_module.py)$" - args: [ "--py36-plus" ] + args: ["--py36-plus"] - repo: https://github.com/PyCQA/isort rev: 5.10.1 hooks: @@ -28,12 +28,12 @@ repos: rev: 22.8.0 hooks: - id: black - args: [ --safe ] + args: [--safe] - repo: https://github.com/asottile/blacken-docs rev: v1.12.1 hooks: - id: blacken-docs - additional_dependencies: [ black==22.6 ] + additional_dependencies: [black==22.8] - repo: https://github.com/pre-commit/pygrep-hooks rev: v1.9.0 hooks: @@ -42,21 +42,37 @@ repos: rev: "0.5.2" hooks: - id: tox-ini-fmt - args: [ "-p", "fix" ] + args: ["-p", "fix"] - repo: https://github.com/asottile/setup-cfg-fmt rev: v2.0.0 hooks: - id: setup-cfg-fmt - args: [ --min-py3-version, "3.7", "--max-py-version", "3.10" ] + args: [--min-py3-version, "3.7", "--max-py-version", "3.11"] - repo: https://github.com/PyCQA/flake8 rev: 5.0.4 hooks: - id: flake8 additional_dependencies: - - flake8-bugbear==22.7.1 + - flake8-bugbear==22.9.11 - flake8-comprehensions==3.10 - flake8-pytest-style==1.6 - flake8-spellcheck==0.28 - flake8-unused-arguments==0.0.11 - - flake8-noqa==1.2.8 - - pep8-naming==0.13.1 + - flake8-noqa==1.2.9 + - pep8-naming==0.13.2 + - repo: https://github.com/pre-commit/mirrors-prettier + rev: "v2.7.1" + hooks: + - id: prettier + additional_dependencies: + - prettier@2.7.1 + - "@prettier/plugin-xml@2.2" + args: ["--print-width=120", "--prose-wrap=always"] + - repo: https://github.com/igorshubovych/markdownlint-cli + rev: v0.32.2 + hooks: + - id: markdownlint + - repo: meta + hooks: + - id: check-hooks-apply + - id: check-useless-excludes diff --git a/README.md b/README.md index 2ec4c832..e54d8749 100644 --- a/README.md +++ b/README.md @@ -41,7 +41,9 @@ def format_unit(value: Union[float, int], unit: str) -> str: First, use pip to download and install the extension: - $ pip install sphinx-autodoc-typehints +```bash +pip install sphinx-autodoc-typehints +``` Then, add the extension to your `conf.py`: @@ -100,8 +102,8 @@ tracker for more information. Sometimes functions or classes from two different modules need to reference each other in their type annotations. This creates a circular import problem. The solution to this is the following: -1. Import only the module, not the classes/functions from it -2. Use forward references in the type annotations (e.g. `def methodname(self, param1: 'othermodule.OtherClass'):`) +1. Import only the module, not the classes/functions from it +2. Use forward references in the type annotations (e.g. `def methodname(self, param1: 'othermodule.OtherClass'):`) On Python 3.7, you can even use `from __future__ import annotations` and remove the quotes. diff --git a/pyproject.toml b/pyproject.toml index aed2a824..2f7823b0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,5 @@ [build-system] -requires = ["setuptools>=63.4", "setuptools_scm>=7.0.5"] +requires = ["setuptools>=65.3", "setuptools_scm>=7.0.5"] build-backend = 'setuptools.build_meta' [tool.black] diff --git a/setup.cfg b/setup.cfg index e4ae33c3..39ebaa3d 100644 --- a/setup.cfg +++ b/setup.cfg @@ -37,10 +37,10 @@ where = src [options.extras_require] testing = covdefaults>=2.2 - coverage>=6.4.2 + coverage>=6.4.4 diff-cover>=6.5.1 - nptyping>=2.2 - pytest>=7.1.2 + nptyping>=2.3.1 + pytest>=7.1.3 pytest-cov>=3 sphobjinv>=2.2.2 typing-extensions>=4.3 diff --git a/tox.ini b/tox.ini index ffa90976..fa42325c 100644 --- a/tox.ini +++ b/tox.ini @@ -47,7 +47,7 @@ setenv = {tty:MYPY_FORCE_COLOR = 1} deps = mypy==0.971 - types-docutils>=0.19 + types-docutils>=0.19.1 commands = mypy --python-version 3.10 src mypy --python-version 3.10 tests @@ -61,7 +61,7 @@ setenv = skip_install = true deps = covdefaults>=2.2 - coverage>=6.4.2 + coverage>=6.4.4 diff-cover>=6.5.1 extras = parallel_show_output = true