diff --git a/docs/conf.py b/docs/conf.py index 0f85661789d..adf05f8a1ee 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -1,3 +1,6 @@ +from __future__ import annotations + + extensions = [ 'sphinx.ext.autodoc', 'jaraco.packaging.sphinx', @@ -93,6 +96,7 @@ # Be strict about any broken references nitpicky = True +nitpick_ignore: list[tuple[str, str]] = [] # Include Python intersphinx mapping to prevent failures # jaraco/skeleton#51 @@ -104,32 +108,17 @@ # Preserve authored syntax for defaults autodoc_preserve_defaults = True -intersphinx_mapping.update({ - 'pip': ('https://pip.pypa.io/en/latest', None), - 'build': ('https://build.pypa.io/en/latest', None), - 'PyPUG': ('https://packaging.python.org/en/latest/', None), - 'packaging': ('https://packaging.pypa.io/en/latest/', None), - 'twine': ('https://twine.readthedocs.io/en/stable/', None), - 'importlib-resources': ( - 'https://importlib-resources.readthedocs.io/en/latest', - None, - ), -}) - -# Add support for linking usernames -github_url = 'https://github.com' -github_repo_org = 'pypa' -github_repo_name = 'setuptools' -github_repo_slug = f'{github_repo_org}/{github_repo_name}' -github_repo_url = f'{github_url}/{github_repo_slug}' -github_sponsors_url = f'{github_url}/sponsors' +# Add support for linking usernames, PyPI projects, Wikipedia pages +github_url = 'https://github.com/' extlinks = { - 'user': (f'{github_sponsors_url}/%s', '@%s'), + 'user': (f'{github_url}%s', '@%s'), 'pypi': ('https://pypi.org/project/%s', '%s'), 'wiki': ('https://wikipedia.org/wiki/%s', '%s'), } extensions += ['sphinx.ext.extlinks'] +# local + # Ref: https://github.com/python-attrs/attrs/pull/571/files\ # #diff-85987f48f1258d9ee486e3191495582dR82 default_role = 'any' @@ -163,7 +152,7 @@ # Support for distutils # Ref: https://stackoverflow.com/a/30624034/595220 -nitpick_ignore = [ +nitpick_ignore += [ ('c:func', 'SHGetSpecialFolderPath'), # ref to MS docs ('envvar', 'DIST_EXTRA_CONFIG'), # undocumented ('envvar', 'DISTUTILS_DEBUG'), # undocumented @@ -245,3 +234,16 @@ }, # rel="apple-touch-icon" does not support SVG yet ] + +intersphinx_mapping.update({ + 'pip': ('https://pip.pypa.io/en/latest', None), + 'build': ('https://build.pypa.io/en/latest', None), + 'PyPUG': ('https://packaging.python.org/en/latest/', None), + 'packaging': ('https://packaging.pypa.io/en/latest/', None), + 'twine': ('https://twine.readthedocs.io/en/stable/', None), + 'importlib-resources': ( + 'https://importlib-resources.readthedocs.io/en/latest', + None, + ), +}) + diff --git a/mypy.ini b/mypy.ini index fe6b23844ad..6891d0d2d05 100644 --- a/mypy.ini +++ b/mypy.ini @@ -7,6 +7,11 @@ warn_unused_ignores = True warn_redundant_casts = True # required to support namespace packages: https://github.com/python/mypy/issues/14057 explicit_package_bases = True + +disable_error_code = + # Disable due to many false positives + overload-overlap, + exclude = (?x)( # Avoid scanning Python files in generated folders ^build/ @@ -19,8 +24,6 @@ exclude = (?x)( # Duplicate module name | ^pkg_resources/tests/data/my-test-package-source/setup.py$ ) -# Too many false-positives -disable_error_code = overload-overlap # DistributionMetadata.license_files and DistributionMetadata.license_file # are dynamically patched in setuptools/_core_metadata.py