scikit-hep / pyhf

pure-Python HistFactory implementation with tensors and autodiff
https://pyhf.readthedocs.io/
Apache License 2.0
283 stars 83 forks source link

feat: Use Python 3.12+ tarfile data extraction filter #2455

Closed matthewfeickert closed 6 months ago

matthewfeickert commented 6 months ago

Description

Resolves #2454

In Python 3.12 extraction filters are added and will become default in Python 3.14. To start using them for when Python 3.12 support is added, and to guard against a Python 3.14 DeprecationWarning, use the data extraction filter for extracting tarfiles in pyhf.contrib.utils.download.

Checklist Before Requesting Reviewer

Before Merging

For the PR Assignees:

* In Python 3.12 extraction filters are added and will become default in
  Python 3.14. To start using them for when Python 3.12 support is added, and
  to guard against a Python 3.14 DeprecationWarning, use the data extraction
  filter for extracting tarfiles in pyhf.contrib.utils.download.
   - c.f. https://docs.python.org/3.12/library/tarfile.html#extraction-filters
codecov[bot] commented 6 months ago

Codecov Report

Attention: Patch coverage is 33.33333% with 2 lines in your changes are missing coverage. Please review.

Project coverage is 98.23%. Comparing base (adddb07) to head (b2001f7).

Files Patch % Lines
src/pyhf/contrib/utils.py 33.33% 1 Missing and 1 partial :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #2455 +/- ## ========================================== - Coverage 98.28% 98.23% -0.05% ========================================== Files 69 69 Lines 4539 4541 +2 Branches 803 804 +1 ========================================== Hits 4461 4461 - Misses 45 46 +1 - Partials 33 34 +1 ``` | [Flag](https://app.codecov.io/gh/scikit-hep/pyhf/pull/2455/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=scikit-hep) | Coverage Δ | | |---|---|---| | [contrib](https://app.codecov.io/gh/scikit-hep/pyhf/pull/2455/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=scikit-hep) | `97.81% <33.33%> (-0.05%)` | :arrow_down: | | [doctest](https://app.codecov.io/gh/scikit-hep/pyhf/pull/2455/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=scikit-hep) | `98.10% <33.33%> (-0.05%)` | :arrow_down: | | [unittests-3.10](https://app.codecov.io/gh/scikit-hep/pyhf/pull/2455/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=scikit-hep) | `96.25% <33.33%> (-0.05%)` | :arrow_down: | | [unittests-3.11](https://app.codecov.io/gh/scikit-hep/pyhf/pull/2455/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=scikit-hep) | `96.25% <33.33%> (-0.05%)` | :arrow_down: | | [unittests-3.8](https://app.codecov.io/gh/scikit-hep/pyhf/pull/2455/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=scikit-hep) | `96.27% <33.33%> (-0.05%)` | :arrow_down: | | [unittests-3.9](https://app.codecov.io/gh/scikit-hep/pyhf/pull/2455/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=scikit-hep) | `96.30% <33.33%> (-0.05%)` | :arrow_down: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=scikit-hep#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

matthewfeickert commented 6 months ago

I'm going to approve and merge this myself. As always, PRs approved by a single core dev can be reverted as needed by the rest of the dev team.

matthewfeickert commented 4 months ago

@meeseeksdev backport to release/v0.7.x