From 20c206a5f6197f0b5220db3b7487e55c8c8796d4 Mon Sep 17 00:00:00 2001 From: Rodrigo Barbosa Date: Tue, 19 Aug 2025 20:08:23 +0000 Subject: [PATCH] testing upgrages --- README.md | 19 +++++++++++++++++++ requirements.txt | 9 +++++++-- setup.py | 14 ++++++++++++-- 3 files changed, 38 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 31518ca9..0d746e85 100644 --- a/README.md +++ b/README.md @@ -50,6 +50,25 @@ For desktop features, use: pip install "roboflow[desktop]" ``` +### Compatibility notes + +- OpenCV is required. This package uses `opencv-python(-headless)>=4.10.0.84`. +- NumPy selection depends on Python version: + - Python 3.8–3.9: `numpy>=1.26,<2`. + - Python 3.10+: `numpy>=2`. + +If you installed an incompatible NumPy previously, reinstall with one of the following: + +```bash +# Python 3.8–3.9 +pip install --upgrade --force-reinstall "numpy>=1.26,<2" "opencv-python-headless>=4.10.0.84" + +# Python 3.10+ +pip install --upgrade "numpy>=2" "opencv-python-headless>=4.10.0.84" +``` + +If you use the `desktop` extra, it will install `opencv-python>=4.10.0.84`. +
Install from source diff --git a/requirements.txt b/requirements.txt index 71092638..68c1d703 100644 --- a/requirements.txt +++ b/requirements.txt @@ -3,8 +3,13 @@ idna==3.7 cycler kiwisolver>=1.3.1 matplotlib -numpy>=1.18.5 -opencv-python-headless==4.10.0.84 +# NumPy and OpenCV compatibility: +# - For Python < 3.10, stick to NumPy 1.26.x (NumPy 2.x does not provide wheels) +# - For Python >= 3.10, allow NumPy 2.x +# - Keep OpenCV mandatory and allow latest compatible wheels +numpy>=1.26,<2; python_version < "3.10" +numpy>=2; python_version >= "3.10" +opencv-python-headless>=4.10.0.84 Pillow>=7.1.2 # https://github.com/roboflow/roboflow-python/issues/390 pi-heif<2 diff --git a/setup.py b/setup.py index 0a22d142..ad259db4 100644 --- a/setup.py +++ b/setup.py @@ -14,7 +14,9 @@ long_description = fh.read() with open("requirements.txt") as fh: - install_requires = fh.read().split("\n") + install_requires = [ + line.strip() for line in fh.read().split("\n") if line.strip() and not line.strip().startswith("#") + ] setuptools.setup( name="roboflow", @@ -29,7 +31,10 @@ packages=find_packages(exclude=("tests",)), # create optional [desktop] extras_require={ - "desktop": ["opencv-python==4.8.0.74"], + # Keep OpenCV mandatory in desktop extra across versions + "desktop": [ + "opencv-python>=4.10.0.84", + ], "dev": [ "mypy", "responses", @@ -49,6 +54,11 @@ }, classifiers=[ "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", "License :: OSI Approved :: Apache Software License", "Operating System :: OS Independent", ],