Skip to content

Conversation

@pre-commit-ci
Copy link
Contributor

@pre-commit-ci pre-commit-ci bot commented Jan 6, 2025

updates:

Before Merging

For the PR Assignees:

  • Summarize commit messages into a comprehensive review of the PR
* Update pre-commit hooks:
   - github.com/pre-commit/pre-commit-hooks: v5.0.0 → v6.0.0
   - github.com/astral-sh/ruff-pre-commit: v0.12.0 → v0.14.3
   - github.com/psf/black-pre-commit-mirror: 24.10.0 → 25.9.0
   - github.com/adamchainz/blacken-docs: 1.19.1 → 1.20.0
   - github.com/pre-commit/mirrors-mypy: v1.13.0 → v1.18.2
   - github.com/codespell-project/codespell: v2.3.0 → v2.4.1
   - github.com/python-jsonschema/check-jsonschema: 0.30.0 → 0.34.1
* Apply fixes for RUF059: unused-unpacked-variable
   - c.f. https://docs.astral.sh/ruff/rules/unused-unpacked-variable/
* Apply fixes for RUF043: pytest-raises-ambiguous-pattern
   - c.f. https://docs.astral.sh/ruff/rules/pytest-raises-ambiguous-pattern/
* Add validation and test of pyhf.readxml.process_channel's ElementTree argument being
  not None.

Co-authored-by: Giordon Stark <[email protected]>
Co-authored-by: Matthew Feickert <[email protected]>

@pre-commit-ci pre-commit-ci bot force-pushed the pre-commit-ci-update-config branch from c420a9e to 11fb5c5 Compare February 3, 2025 22:11
@pre-commit-ci pre-commit-ci bot force-pushed the pre-commit-ci-update-config branch from f606fac to d4672a8 Compare March 3, 2025 19:27
@matthewfeickert matthewfeickert force-pushed the pre-commit-ci-update-config branch from 5adc4f7 to 5f35a85 Compare March 11, 2025 00:08
@pre-commit-ci pre-commit-ci bot force-pushed the pre-commit-ci-update-config branch from 5f35a85 to cdb1420 Compare April 7, 2025 19:28
@pre-commit-ci pre-commit-ci bot force-pushed the pre-commit-ci-update-config branch from 1cac64d to ab9a315 Compare May 5, 2025 19:11
@pre-commit-ci pre-commit-ci bot force-pushed the pre-commit-ci-update-config branch from de475fa to c8c2bfd Compare June 2, 2025 19:12
@pre-commit-ci pre-commit-ci bot force-pushed the pre-commit-ci-update-config branch from f2b0a46 to 4f6e571 Compare July 7, 2025 19:36
@pre-commit-ci pre-commit-ci bot force-pushed the pre-commit-ci-update-config branch from 389eacb to 0fb4e64 Compare August 4, 2025 19:43
@codecov
Copy link

codecov bot commented Aug 4, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.23%. Comparing base (239f765) to head (31b252e).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2568   +/-   ##
=======================================
  Coverage   98.23%   98.23%           
=======================================
  Files          65       65           
  Lines        4190     4190           
  Branches      452      453    +1     
=======================================
  Hits         4116     4116           
  Misses         45       45           
  Partials       29       29           
Flag Coverage Δ
contrib 98.11% <100.00%> (ø)
doctest 98.23% <100.00%> (ø)
unittests-3.10 96.42% <100.00%> (ø)
unittests-3.11 96.42% <100.00%> (ø)
unittests-3.12 96.42% <100.00%> (ø)
unittests-3.13 96.42% <100.00%> (ø)
unittests-3.9 96.46% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@matthewfeickert
Copy link
Member

More typing issues:

mypy with Python 3.9.....................................................Failed
- hook id: mypy
- exit code: 1

src/pyhf/tensor/manager.py:150: error: If x = b'abc' then f"{x}" or "{}".format(x) produces "b'abc'", not "abc". If this is desired behavior, use f"{x!r}" or "{!r}".format(x). Otherwise, decode the bytes  [str-bytes-safe]
src/pyhf/tensor/manager.py:154: error: If x = b'abc' then f"{x}" or "{}".format(x) produces "b'abc'", not "abc". If this is desired behavior, use f"{x!r}" or "{!r}".format(x). Otherwise, decode the bytes  [str-bytes-safe]
src/pyhf/readxml.py:296: error: Item "None" of "Optional[Element[str]]" has no attribute "attrib"  [union-attr]
src/pyhf/readxml.py:297: error: Item "None" of "Optional[Element[str]]" has no attribute "attrib"  [union-attr]
src/pyhf/readxml.py:300: error: Item "None" of "Optional[Element[str]]" has no attribute "findall"  [union-attr]
src/pyhf/readxml.py:303: error: Item "None" of "Optional[Element[str]]" has no attribute "attrib"  [union-attr]
src/pyhf/readxml.py:305: error: Item "None" of "Optional[Element[str]]" has no attribute "findall"  [union-attr]
src/pyhf/readxml.py:462: error: Argument 1 to "process_channel" has incompatible type "ElementTree[Element[str]]"; expected "ElementTree[Optional[Element[str]]]"  [arg-type]
src/pyhf/readxml.py:470: error: Argument 1 to "process_measurements" has incompatible type "ElementTree[Element[str]]"; expected "ElementTree[Optional[Element[str]]]"  [arg-type]
Found 9 errors in 2 files (checked 72 source files)

mypy with Python 3.12....................................................Failed
- hook id: mypy
- exit code: 1

src/pyhf/tensor/manager.py:150: error: If x = b'abc' then f"{x}" or "{}".format(x) produces "b'abc'", not "abc". If this is desired behavior, use f"{x!r}" or "{!r}".format(x). Otherwise, decode the bytes  [str-bytes-safe]
src/pyhf/tensor/manager.py:154: error: If x = b'abc' then f"{x}" or "{}".format(x) produces "b'abc'", not "abc". If this is desired behavior, use f"{x!r}" or "{!r}".format(x). Otherwise, decode the bytes  [str-bytes-safe]
src/pyhf/readxml.py:296: error: Item "None" of "Element[str] | None" has no attribute "attrib"  [union-attr]
src/pyhf/readxml.py:297: error: Item "None" of "Element[str] | None" has no attribute "attrib"  [union-attr]
src/pyhf/readxml.py:300: error: Item "None" of "Element[str] | None" has no attribute "findall"  [union-attr]
src/pyhf/readxml.py:303: error: Item "None" of "Element[str] | None" has no attribute "attrib"  [union-attr]
src/pyhf/readxml.py:305: error: Item "None" of "Element[str] | None" has no attribute "findall"  [union-attr]
src/pyhf/readxml.py:462: error: Argument 1 to "process_channel" has incompatible type "ElementTree[Element[str]]"; expected "ElementTree[Element[str] | None]"  [arg-type]
src/pyhf/readxml.py:470: error: Argument 1 to "process_measurements" has incompatible type "ElementTree[Element[str]]"; expected "ElementTree[Element[str] | None]"  [arg-type]
Found 9 errors in 2 files (checked 72 source files)

@pre-commit-ci pre-commit-ci bot force-pushed the pre-commit-ci-update-config branch from 9f8b94c to 5c22b28 Compare September 1, 2025 19:34
@pre-commit-ci pre-commit-ci bot force-pushed the pre-commit-ci-update-config branch from 2463c57 to 21a6a62 Compare October 6, 2025 20:26
@matthewfeickert matthewfeickert force-pushed the pre-commit-ci-update-config branch from 5bcff92 to f3b7d11 Compare October 14, 2025 22:22
@matthewfeickert
Copy link
Member

Things are now just failing on Ruff revision requests, so this can get easily fixed up and then merged.

@pre-commit-ci pre-commit-ci bot force-pushed the pre-commit-ci-update-config branch from f3b7d11 to a6cb09f Compare November 3, 2025 19:54
@matthewfeickert matthewfeickert force-pushed the pre-commit-ci-update-config branch from f88c065 to 19101f3 Compare November 5, 2025 17:44
updates:
- [github.com/pre-commit/pre-commit-hooks: v5.0.0 → v6.0.0](pre-commit/pre-commit-hooks@v5.0.0...v6.0.0)
- [github.com/astral-sh/ruff-pre-commit: v0.12.0 → v0.14.3](astral-sh/ruff-pre-commit@v0.12.0...v0.14.3)
- [github.com/psf/black-pre-commit-mirror: 24.10.0 → 25.9.0](psf/black-pre-commit-mirror@24.10.0...25.9.0)
- [github.com/adamchainz/blacken-docs: 1.19.1 → 1.20.0](adamchainz/blacken-docs@1.19.1...1.20.0)
- [github.com/pre-commit/mirrors-mypy: v1.13.0 → v1.18.2](pre-commit/mirrors-mypy@v1.13.0...v1.18.2)
- [github.com/codespell-project/codespell: v2.3.0 → v2.4.1](codespell-project/codespell@v2.3.0...v2.4.1)
- [github.com/python-jsonschema/check-jsonschema: 0.30.0 → 0.34.1](python-jsonschema/check-jsonschema@0.30.0...0.34.1)
@matthewfeickert matthewfeickert force-pushed the pre-commit-ci-update-config branch from 19101f3 to da7d673 Compare November 5, 2025 21:17
@matthewfeickert matthewfeickert added style Changes that do not affect the meaning of the code chore Other changes that don't modify src or test files pre-commit Related to pre-commit hooks labels Nov 6, 2025
Copy link
Member

@matthewfeickert matthewfeickert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fixes @kratsg. I have a few questions on:

  • How you feel about keeping some things with _ prefixes for maintainer readability in the future.
  • If we need get_backend() calls at all if they aren't setting anything.
  • Why an assert was added.

@github-project-automation github-project-automation bot moved this to In progress in pyhf v0.8.0 Nov 6, 2025
@matthewfeickert matthewfeickert added the docs Documentation related label Nov 6, 2025
kratsg and others added 4 commits November 6, 2025 07:23
c.f. B108: hardcoded_tmp_directory

Flagged by Codecov
@kratsg kratsg merged commit 0f52681 into main Nov 6, 2025
23 checks passed
@kratsg kratsg deleted the pre-commit-ci-update-config branch November 6, 2025 08:26
@github-project-automation github-project-automation bot moved this from In progress to Done in pyhf v0.8.0 Nov 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chore Other changes that don't modify src or test files docs Documentation related pre-commit Related to pre-commit hooks style Changes that do not affect the meaning of the code

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants