Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Protocols, remove @overload, from .coveragerc exclude_also #135

Merged
merged 2 commits into from
Aug 8, 2024

Conversation

Avasam
Copy link
Contributor

@Avasam Avasam commented Jul 20, 2024

By the nature of : ... (elipsis on same line as declaration) being ignored by coverage, overloads and most Protocol methods are already ignored.

There is one case not ignored out of the box, and it's when ... is on its own line, like so (docstring means that can't be autofixed by formatters):

class MyClass(Protocol):
    def proto_method(self):
        """some docstring"""
        ...

In this PR, I currently ignore Protocols completely, as that's the example given in https://coverage.readthedocs.io/en/latest/excluding.html#advanced-exclusion , but I think it would work just as well to use ^\s+\.\.\. as mentioned here: nedbat/coveragepy#1476 (comment) . I'll leave the preference up to you (maybe you want to exclude them all, including @overload just in case 🤷 )

Test of these changes on setuptools: pypa/setuptools#4464

Prevents supposed (false-positive) loss of coverage in pypa/setuptools#4192

@Avasam Avasam changed the title Ignore Protocols, but not @overload, in .coveragerc Add Protocols, remove @overload, from .coveragerc exclude_also Jul 20, 2024
@jaraco jaraco merged commit dd30b76 into jaraco:main Aug 8, 2024
11 of 12 checks passed
@Avasam Avasam deleted the patch-3 branch August 9, 2024 04:24
clrpackages pushed a commit to clearlinux-pkgs/pypi-importlib_resources that referenced this pull request Aug 22, 2024
….4.3 to version 6.4.4

Avasam (2):
      Add Protocols, remove @overload, from `.coveragerc` `exclude_also` (jaraco/skeleton#135)
      Loosen restrictions on mypy (jaraco/skeleton#136)

Dimitri Papadopoulos Orfanos (1):
      Update to the latest ruff version (jaraco/skeleton#137)

Jason R. Coombs (7):
      Split the test dependencies into four classes (test, cover, type, check). (jaraco/skeleton#139)
      Add upstream and local sections for 'type' extra, since many projects will have 'types-*' dependencies.
      🧎‍♀️ Genuflect to the types.
      🧎‍♀️ Genuflect to the types.
      🧎‍♀️ Genuflect to the types.
      🧎‍♀️ Genuflect to the types.
      Finalize
clrpackages pushed a commit to clearlinux-pkgs/pypi-jaraco.collections that referenced this pull request Aug 30, 2024
…0.1 to version 5.1.0

Anderson Bravalheri (1):
      Add `--fix`  flag to ruff pre-commit hook for automatic suggestion of fixes (jaraco/skeleton#140)

Avasam (4):
      Add Protocols, remove @overload, from `.coveragerc` `exclude_also` (jaraco/skeleton#135)
      Loosen restrictions on mypy (jaraco/skeleton#136)
      Pass mypy and link issues
      Fully typed `RangeMap` and avoid complete iterations to find matches (#16)

Bartosz Sławecki (1):
      Move project metadata to `pyproject.toml` (jaraco/skeleton#122)

Dimitri Papadopoulos Orfanos (3):
      "preserve" does not require preview any more (jaraco/skeleton#133)
      Enforce ruff/Perflint rule PERF401 (jaraco/skeleton#132)
      Update to the latest ruff version (jaraco/skeleton#137)

Jason R. Coombs (14):
      Pin against pytest 8.1.x due to pytest-dev/pytest#12194.
      Migrated config to pyproject.toml using jaraco.develop.migrate-config and ini2toml.
      Allow macos on Python 3.8 to fail as GitHub CI has dropped support.
      Move project.urls to appear in the order that ini2toml generates it. Remove project.scripts.
      Revert "Allow macos on Python 3.8 to fail as GitHub CI has dropped support."
      Rename extras to align with core metadata spec.
      Prefer "Source" to "Homepage" for the repository label.
      Exclude pytest-ruff (and thus ruff), which cannot build on cygwin.
      Re-enable preview, this time not for one specific feature, but for all features in preview.
      Split the test dependencies into four classes (test, cover, type, check). (jaraco/skeleton#139)
      Add upstream and local sections for 'type' extra, since many projects will have 'types-*' dependencies.
      Disable mypy for now. Ref jaraco/skeleton#143
      Finalize
      Remove unsupported attribution. See jaraco/skeleton#144.
clrpackages pushed a commit to clearlinux-pkgs/pypi-zipp that referenced this pull request Aug 30, 2024
…n 3.20.1

Anderson Bravalheri (1):
      Add `--fix`  flag to ruff pre-commit hook for automatic suggestion of fixes (jaraco/skeleton#140)

Avasam (2):
      Add Protocols, remove @overload, from `.coveragerc` `exclude_also` (jaraco/skeleton#135)
      Loosen restrictions on mypy (jaraco/skeleton#136)

Dimitri Papadopoulos Orfanos (1):
      Update to the latest ruff version (jaraco/skeleton#137)

Jason R. Coombs (19):
      Uncomment link to the docs.
      Split the test dependencies into four classes (test, cover, type, check). (jaraco/skeleton#139)
      Add upstream and local sections for 'type' extra, since many projects will have 'types-*' dependencies.
      🧎‍♀️ Genuflect to the types.
      🧎‍♀️ Genuflect to the types.
      🧎‍♀️ Genuflect to the types.
      Add reference to development methodology.
      Disable mypy for now. Ref jaraco/skeleton#143
      Add two tests capturing the expectation for unsupported names.
      Adjust the expectation in test_malformed_paths to expect empty paths ignored and .. to be a path segment.
      Removed SanitizedNames.
      Address infinite loop when zipfile begins with more than one leading slash.
      Refine expectation that paths with leading slashes are simply not visible.
      Invent DirtyZipInfo to create an unsanitized zipfile with backslashes.
      Add news fragment.
      Mark unused code as uncovered.
      Prefer simpler path.rstrip to consolidate checks for empty or only paths.
      Add TODO to consolidate this behavior in CPython.
      Finalize
clrpackages pushed a commit to clearlinux-pkgs/pypi-setuptools that referenced this pull request Aug 30, 2024
…version 74.0.0

Anderson Bravalheri (11):
      Remove outdated import error check for warnings
      Satisfy ruff import format
      Add `--fix`  flag to ruff pre-commit hook for automatic suggestion of fixes (jaraco/skeleton#140)
      Remove unnecessary conditional on TYPE_CHECKING
      Test setuptools own sdist does not include tox files
      Prune .tox directory
      Remove custom manifest_maker.prune_file_list and rely on default implementation in sdist
      Automatically exclude top-level .tox|.nox|.ven from sdist
      Test against false positve matches
      Account for windows path separators in tests
      Add missing news fragment for PR 4603

Avasam (18):
      Add Protocols, remove @overload, from `.coveragerc` `exclude_also` (jaraco/skeleton#135)
      Loosen restrictions on mypy (jaraco/skeleton#136)
      Raise `TypeError` in `easy_install.CommandSpec.from_param`
      Type-check on all Python versions
      Pin Ruff to a lower bound rather than pinning pytest-ruff to an upper-bound
      Move static-checkers-only dependencies into their dedicated extras
      Avoid issues with  _build_ext being Any (#4599)
      `pkg_resources`: use `_typeshed.importlib.LoaderProtocol` (#4597)
      Make get_ext_filename typesafe (#4592)
      `pkg_resources` fully type all collection attributes (#4598)
      Made setuptools.package_index.Credential a NamedTuple (#4585)
      Initial pyright config (#4192)
      Type str/repr dunders (#4582)
      Type all get/set dunders
      Type all comparison/operators dunders (#4583)
      Type context manager dunders (#4581)
      Link to issues in mypy.ini for non py.typed dependencies (#4561)
      Reraise sensible errors from auto_chmod

Cal Jacobson (3):
      handle failures to find a user home directory
      Update distutils/dist.py
      format

Chris Barker (1):
      change VERSION to __version__ in the example (#4590)

Christoph Reiter (1):
      Remove unused wininst-*.exe files

Dimitri Papadopoulos (9):
      Apply ruff/tryceratops rule TRY300
      Apply ruff/tryceratops rule TRY301
      Enforce ruff/tryceratops rules (TRY)
      Enforce ruff/flake8-2020 rule (YTT301)
      Apply ruff/Perflint rule PERF102
      Apply ruff/Perflint rule PERF402
      Apply ruff/Perflint rule PERF403
      Enforce ruff/Perflint rules (PERF)
      Add `# local` to ignore conflicts with upstrea

Dimitri Papadopoulos Orfanos (1):
      Update to the latest ruff version (jaraco/skeleton#137)

Jason R. Coombs (17):
      Split the test dependencies into four classes (test, cover, type, check). (jaraco/skeleton#139)
      Add upstream and local sections for 'type' extra, since many projects will have 'types-*' dependencies.
      Disable mypy for now. Ref jaraco/skeleton#143
      Simply suppress the exception.
      Sort imports
      Define the variable in one place.
      Extract logic around the mappings into a function to compute the spec.
      Tweak docstring
      Remove legacy msvc compiler modules.
      Remove associated tests
      Remove monkeypatching of _msvccompiler.
      Remove associated tests
      Apply downstream VS 2017 support.
      Apply error message from downstream.
      Add news fragment.
      Add news fragment.
      Bump version: 73.0.1 → 74.0.0

Kagami Sascha Rosylight (8):
      Use arm64 MSVC on arm64 Windows
      Check MSVC arm64 variant on arm64 host (#4555)
      conditionally construct PLAT_TO_VCVARS
      function-ify
      nit
      python supports comparison chains
      apply feedback
      restore the lost comment
clrpackages pushed a commit to clearlinux-pkgs/pypi-inflect that referenced this pull request Sep 10, 2024
…ion 7.4.0

Anderson Bravalheri (1):
      Add `--fix`  flag to ruff pre-commit hook for automatic suggestion of fixes (jaraco/skeleton#140)

Avasam (2):
      Add Protocols, remove @overload, from `.coveragerc` `exclude_also` (jaraco/skeleton#135)
      Loosen restrictions on mypy (jaraco/skeleton#136)

Dimitri Papadopoulos Orfanos (3):
      "preserve" does not require preview any more (jaraco/skeleton#133)
      Enforce ruff/Perflint rule PERF401 (jaraco/skeleton#132)
      Update to the latest ruff version (jaraco/skeleton#137)

Jason R. Coombs (14):
      Exclude pytest-ruff (and thus ruff), which cannot build on cygwin.
      Re-enable preview, this time not for one specific feature, but for all features in preview.
      Split the test dependencies into four classes (test, cover, type, check). (jaraco/skeleton#139)
      Add upstream and local sections for 'type' extra, since many projects will have 'types-*' dependencies.
      🧎‍♀️ Genuflect to the types.
      Move comment
      Construct the _gend_sing dictionary statically.
      Disable mypy for now. Ref jaraco/skeleton#143
      Move overload-overlap disablement to its own line for easier diffs and simpler relevant comments.
      Add a degenerate nitpick_ignore for downstream consumers. Add a 'local' comment to delineate where the skeleton ends and the downstream begins.
      Add support for linking usernames.
      Include the trailing slash in disable_error_code(overload-overlap), also required for clean diffs.
      Add news fragment.
      Finalize

Josh Stephenson (1):
      Clarify that inflect is for English.

Mitchel Humpherys (2):
      Handle a single apostrophe more gracefully
      Add a test for a single-character apostrophe string
clrpackages pushed a commit to clearlinux-pkgs/pypi-importlib_metadata that referenced this pull request Sep 16, 2024
…4.0 to version 8.5.0

Anderson Bravalheri (1):
      Add `--fix`  flag to ruff pre-commit hook for automatic suggestion of fixes (jaraco/skeleton#140)

Avasam (4):
      Add Protocols, remove @overload, from `.coveragerc` `exclude_also` (jaraco/skeleton#135)
      Loosen restrictions on mypy (jaraco/skeleton#136)
      Pass mypy and link issues
      Update tests/_path.py with jaraco.path 3.7.2

Daniel Hollas (3):
      Defer import of zipp
      Defer json import
      Defer platform import

Dimitri Papadopoulos Orfanos (1):
      Update to the latest ruff version (jaraco/skeleton#137)

Jason R. Coombs (24):
      Split the test dependencies into four classes (test, cover, type, check). (jaraco/skeleton#139)
      👹 Feed the hobgoblins (delint).
      Remove superfluous parentheses.
      Rely on zipp overlay for zipfile.Path.
      Add upstream and local sections for 'type' extra, since many projects will have 'types-*' dependencies.
      🧎‍♀️ Genuflect to the types.
      🧎‍♀️ Genuflect to the types.
      🧎‍♀️ Genuflect to the types.
      🧎‍♀️ Genuflect to the types.
      🧎‍♀️ Genuflect to the types.
      🧎‍♀️ Genuflect to the types.
      Add reference to development methodology.
      Disable mypy for now. Ref jaraco/skeleton#143
      Move overload-overlap disablement to its own line for easier diffs and simpler relevant comments.
      Add a degenerate nitpick_ignore for downstream consumers. Add a 'local' comment to delineate where the skeleton ends and the downstream begins.
      Add support for linking usernames.
      Include the trailing slash in disable_error_code(overload-overlap), also required for clean diffs.
      Add comment to protect the deferred import.
      Add news fragment.
      Revert "Defer platform import"
      Add comment to protect the deferred import.
      Add news fragment.
      Back out changes to tests._path
      Finalize
clrpackages pushed a commit to clearlinux-pkgs/pypi-keyring that referenced this pull request Sep 19, 2024
…sion 25.4.0

Anderson Bravalheri (1):
      Add `--fix`  flag to ruff pre-commit hook for automatic suggestion of fixes (jaraco/skeleton#140)

Avasam (4):
      Add Protocols, remove @overload, from `.coveragerc` `exclude_also` (jaraco/skeleton#135)
      Loosen restrictions on mypy (jaraco/skeleton#136)
      Re-enable mypy and add libraries to type checking
      Fix an incompatibility (and source of merge conflicts) with projects using Ruff/isort.

David Hotham (1):
      add a couple of type annotations

Dimitri Papadopoulos Orfanos (1):
      Update to the latest ruff version (jaraco/skeleton#137)

Jason R. Coombs (16):
      Split the test dependencies into four classes (test, cover, type, check). (jaraco/skeleton#139)
      Add upstream and local sections for 'type' extra, since many projects will have 'types-*' dependencies.
      🧎‍♀️ Genuflect to the types.
      🧎‍♀️ Genuflect to the types.
      Restrict SimpleCredential to require a password.
      Introduce AnonymousCredential to support the use-case of a secret without a username.
      Add news fragment.
      Disable mypy for now. Ref jaraco/skeleton#143
      Move overload-overlap disablement to its own line for easier diffs and simpler relevant comments.
      Add a degenerate nitpick_ignore for downstream consumers. Add a 'local' comment to delineate where the skeleton ends and the downstream begins.
      Add support for linking usernames.
      Include the trailing slash in disable_error_code(overload-overlap), also required for clean diffs.
      Remove workaround for sphinx-contrib/sphinx-lint#83
      Allow the workflow to be triggered manually.
      Add Python 3.13 and 3.14 into the matrix. (jaraco/skeleton#146)
      Finalize
clrpackages pushed a commit to clearlinux-pkgs/pypi-jaraco.functools that referenced this pull request Oct 1, 2024
…2 to version 4.1.0

Anderson Bravalheri (1):
      Add `--fix`  flag to ruff pre-commit hook for automatic suggestion of fixes (jaraco/skeleton#140)

Avasam (4):
      Add Protocols, remove @overload, from `.coveragerc` `exclude_also` (jaraco/skeleton#135)
      Loosen restrictions on mypy (jaraco/skeleton#136)
      Strict typing
      Fix an incompatibility (and source of merge conflicts) with projects using Ruff/isort.

Dimitri Papadopoulos Orfanos (1):
      Update to the latest ruff version (jaraco/skeleton#137)

Jason R. Coombs (15):
      Split the test dependencies into four classes (test, cover, type, check). (jaraco/skeleton#139)
      Add upstream and local sections for 'type' extra, since many projects will have 'types-*' dependencies.
      Disable mypy for now. Ref jaraco/skeleton#143
      Move overload-overlap disablement to its own line for easier diffs and simpler relevant comments.
      Add a degenerate nitpick_ignore for downstream consumers. Add a 'local' comment to delineate where the skeleton ends and the downstream begins.
      Add support for linking usernames.
      Include the trailing slash in disable_error_code(overload-overlap), also required for clean diffs.
      Remove workaround for sphinx-contrib/sphinx-lint#83
      Allow the workflow to be triggered manually.
      Add Python 3.13 and 3.14 into the matrix. (jaraco/skeleton#146)
      Added chainable decorator.
      🚡 Toil the docs.
      Restore Python 3.8 compatibility.
      Use 'in' check to produce a bool.
      Finalize
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants