From b798f007ce0df1e7d193262906ca6b4e614d90c3 Mon Sep 17 00:00:00 2001 From: Iason Krommydas Date: Fri, 31 Jan 2025 08:17:30 -0600 Subject: [PATCH 1/2] add version.pyi in coffea 0.7.x --- coffea/__init__.py | 16 ++-------------- coffea/version.pyi | 4 ++++ 2 files changed, 6 insertions(+), 14 deletions(-) create mode 100644 coffea/version.pyi diff --git a/coffea/__init__.py b/coffea/__init__.py index ca02eb30f..8ff5fff42 100644 --- a/coffea/__init__.py +++ b/coffea/__init__.py @@ -27,23 +27,11 @@ # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -from coffea._version import __version__ +from . import _version import re -import sys +__version__ = _version.__version__ version = __version__ version_info = tuple(re.split(r"[-\.]", __version__)) - -if sys.version_info.major < 3: - import warnings - - warnings.warn("coffea only supports python3 as of 1 January 2020!") - warnings.warn( - "If you are using python2 and run into problems please submit a pull request to fix the issue!" - ) - -# control severity for utils.deprecate -deprecations_as_errors = False - __all__ = ["deprecations_as_errors"] diff --git a/coffea/version.pyi b/coffea/version.pyi new file mode 100644 index 000000000..91744f983 --- /dev/null +++ b/coffea/version.pyi @@ -0,0 +1,4 @@ +from __future__ import annotations + +version: str +version_tuple: tuple[int, int, int] | tuple[int, int, int, str, str] From 7357f0a3535071a2a6cbeb46bbec6a2aff4040a0 Mon Sep 17 00:00:00 2001 From: Iason Krommydas Date: Fri, 31 Jan 2025 08:23:44 -0600 Subject: [PATCH 2/2] maybe fix? --- coffea/__init__.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/coffea/__init__.py b/coffea/__init__.py index 8ff5fff42..a23829696 100644 --- a/coffea/__init__.py +++ b/coffea/__init__.py @@ -34,4 +34,8 @@ version = __version__ version_info = tuple(re.split(r"[-\.]", __version__)) + +# control severity for utils.deprecate +deprecations_as_errors = False + __all__ = ["deprecations_as_errors"]