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

coverage: update config #5280

Closed
wants to merge 3 commits into from
Closed

Conversation

oliver-sanders
Copy link
Member

This might help with a coverage error reported on Element

According to the changelog:

Changes to file pattern matching, which might require updating your configuration:

Previously, * would incorrectly match directory separators, making precise matching difficult. This is now fixed, closing issue 1407.

Now ** matches any number of nested directories, including none.

So I think our use of * is now broken? Not sure.

Check List

  • I have read CONTRIBUTING.md and added my name as a Code Contributor.
  • Contains logically grouped changes (else tidy your branch by rebase).
  • Does not contain off-topic changes (use other PRs for other changes).
  • Applied any dependency changes to both setup.cfg and conda-environment.yml.
  • Tests are included (or explain why tests are not needed).
  • CHANGES.md entry included if this is a change that can affect users
  • Cylc-Doc pull request opened if required at cylc/cylc-doc/pull/XXXX.
  • If this is a bug fix, PR should be raised against the relevant ?.?.x branch.

@oliver-sanders oliver-sanders added this to the cylc-8.1.0 milestone Dec 22, 2022
@oliver-sanders oliver-sanders self-assigned this Dec 22, 2022
@oliver-sanders
Copy link
Member Author

oliver-sanders commented Dec 22, 2022

The error message has now changed to:

coverage.exceptions.ConfigError: File pattern can't include '**/**'

**/** does not appear in the config file either.

@MetRonnie
Copy link
Member

MetRonnie commented Dec 22, 2022

That looks like it's happening for **_pb2.py:

    if "/" not in pattern:
        pattern = "**/" + pattern

https://github.com/nedbat/coveragepy/blob/31513b4b0559fdc7578aa1a30e048b928dc46188/coverage/files.py#L336-L337

@oliver-sanders
Copy link
Member Author

So ./**_pb2.py would probably work then.

.coveragerc Outdated Show resolved Hide resolved
.coveragerc Outdated Show resolved Hide resolved
@MetRonnie
Copy link
Member

MetRonnie commented Dec 23, 2022

I don't think anything we do in the config will fix this. It appears to be a bug nedbat/coveragepy#1513. A temporary solution could be to pin coverage to 6.*

@nedbat
Copy link

nedbat commented Dec 23, 2022

What is the error? (I've never used matrix, and am getting lost in the chat...) I have a fix that allows plus signs and curly braces in directory and file names: https://github.com/nedbat/coveragepy/tree/nedbat/special-in-dirnames-1513

Update: I see it: coverage.exceptions.ConfigError: File pattern can't include '+'. This will be fixed very soon.

@nedbat
Copy link

nedbat commented Dec 23, 2022

The coverage.py fix is now on master in GitHub, I'll probably be publishing it today.

@MetRonnie MetRonnie closed this Dec 23, 2022
@oliver-sanders oliver-sanders deleted the cov-config branch January 3, 2023 10:06
@MetRonnie
Copy link
Member

The test is now passing on master

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.

None yet

3 participants