From e0e9d08f90087cd3d5bc2135ead82c4497688b29 Mon Sep 17 00:00:00 2001 From: Mark Molinaro Date: Mon, 2 Feb 2026 20:52:40 +0000 Subject: [PATCH] remove numpy<2.0.0 version constraint to support numpy v2 As far as I can tell (from manual inspection and running some validations), the codebase is already compatible with numpy v2 but is only held back because of the version constraint. Code review confirmed no usage of deprecated numpy APIs like: - Uses explicit dtypes (np.float32, np.int16, np.uint8) not deprecated aliases (np.float, np.int, np.bool) - No removed functions (np.asscalar, np.matrix, etc.) - No deprecated attributes (np.string_, np.PINF, etc.) Validated with NumPy 2.4.2 and PyTorch 2.10.0: 1. Run the package test suite: cd python && python test.py 2. Test datalayer BCH encoding/decoding: ```python import numpy as np print(f'NumPy version: {np.__version__}') from trustmark.datalayer import DataLayer for mode in [0, 1, 2, 3]: dl = DataLayer(100, verbose=False, encoding_mode=mode) cap = dl.schemaCapacity(mode) print(f'Mode {mode} ({dl.schemaInfo(mode)}): capacity={cap} bits') test_bits = '1' * cap encoded = dl.encode_binary([test_bits]) print(f' Encoded shape: {encoded.shape}, dtype: {encoded.dtype}') decoded, valid, version = dl.decode_bitstream(encoded, MODE='binary')[0] print(f' Decoded valid: {valid}, version: {version}') print(f' Bits match: {decoded == test_bits}') ``` --- python/pyproject.toml | 2 +- python/requirements.txt | 2 +- python/setup.py | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/python/pyproject.toml b/python/pyproject.toml index 2868c3e..9a24f8d 100644 --- a/python/pyproject.toml +++ b/python/pyproject.toml @@ -32,7 +32,7 @@ classifiers = [ dependencies = [ "omegaconf>=2.1", - "numpy>=1.20.0,<2.0.0", + "numpy>=1.20.0,<3.0.0", "torch>=2.1.2", "torchvision>=0.16.2", "lightning>=2.0", diff --git a/python/requirements.txt b/python/requirements.txt index 030e9b5..b9d1051 100644 --- a/python/requirements.txt +++ b/python/requirements.txt @@ -1,4 +1,4 @@ -numpy>=1.20.0,<2.0.0 +numpy>=1.20.0,<3.0.0 torch>=2.1.2 torchvision>=0.16.2 lightning>=2.0 diff --git a/python/setup.py b/python/setup.py index 9300419..90d29c8 100644 --- a/python/setup.py +++ b/python/setup.py @@ -11,7 +11,7 @@ long_description = f.read() setup(name='trustmark', - version='0.9.0', + version='0.10.0', python_requires='>=3.8.5', description='High fidelty image watermarking for the Content Authenticity Initiative (CAI)', url='https://github.com/adobe/trustmark', @@ -24,7 +24,7 @@ package_data={'trustmark': ['**/*.yaml','**/*.ckpt','**/*.md']}, include_package_data = True, install_requires=['omegaconf>=2.1', - 'numpy>=1.20.0,<2.0.0', + 'numpy>=1.20.0,<3.0.0', 'torch>=2.1.2', 'torchvision>=0.16.2', 'lightning>=2.0',