Skip to content

Commit

Permalink
OpenCV 4.7.0 release preparation
Browse files Browse the repository at this point in the history
- Python 3.7 as baseline
- Python 3.11 support
- Various updates
  • Loading branch information
asmorkalov committed Dec 29, 2022
1 parent 7ebbdc3 commit 339bca5
Show file tree
Hide file tree
Showing 13 changed files with 37 additions and 30 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/build_wheels_linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ['3.6']
python-version: ['3.7']
platform: [x64]
with_contrib: [0, 1]
without_gui: [0, 1]
Expand Down Expand Up @@ -84,7 +84,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ['3.6', '3.7', '3.8', '3.9', '3.10']
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11']
platform: [x64]
with_contrib: [0, 1]
without_gui: [0, 1]
Expand All @@ -93,7 +93,7 @@ jobs:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
MB_PYTHON_VERSION: ${{ matrix.python-version }}
NP_TEST_DEP: numpy==1.19.4
NP_TEST_DEP_LATEST: numpy==1.21.2
NP_TEST_DEP_LATEST: numpy==1.24.0
CONFIG_PATH: travis_config.sh
PLAT: x86_64
steps:
Expand All @@ -106,7 +106,7 @@ jobs:
submodules: true
fetch-depth: 0
- name: Setup Environment variables
run: if [ "3.10" == "${{ matrix.python-version }}" ]; then echo "TEST_DEPENDS=$(echo $NP_TEST_DEP_LATEST)" >> $GITHUB_ENV; else echo "TEST_DEPENDS=$(echo $NP_TEST_DEP)" >> $GITHUB_ENV; fi
run: if [ "3.10" == "${{ matrix.python-version }}" -o "3.11" == "${{ matrix.python-version }}" ]; then echo "TEST_DEPENDS=$(echo $NP_TEST_DEP_LATEST)" >> $GITHUB_ENV; else echo "TEST_DEPENDS=$(echo $NP_TEST_DEP)" >> $GITHUB_ENV; fi
- name: Download a wheel accordingly to matrix
uses: actions/download-artifact@v3
with:
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/build_wheels_linux_arm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ['3.6']
python-version: ['3.7']
platform: [x64]
with_contrib: [0, 1]
without_gui: [0, 1]
Expand Down Expand Up @@ -84,7 +84,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ['3.6', '3.7', '3.8', '3.9', '3.10']
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11']
platform: [x64]
with_contrib: [0, 1]
without_gui: [0, 1]
Expand All @@ -94,7 +94,7 @@ jobs:
MB_PYTHON_VERSION: ${{ matrix.python-version }}
PLAT: aarch64
NP_TEST_DEP: numpy==1.19.4
NP_TEST_DEP_LATEST: numpy==1.21.4
NP_TEST_DEP_LATEST: numpy==1.24.0
CONFIG_PATH: travis_config.sh
DOCKER_TEST_IMAGE: multibuild/focal_arm64v8
UNICODE_WIDTH: 32
Expand All @@ -108,7 +108,7 @@ jobs:
submodules: true
fetch-depth: 0
- name: Setup Environment variables
run: if [ "3.10" == "${{ matrix.python-version }}" ]; then echo "TEST_DEPENDS=$(echo $NP_TEST_DEP_LATEST)" >> $GITHUB_ENV; else echo "TEST_DEPENDS=$(echo $NP_TEST_DEP)" >> $GITHUB_ENV; fi
run: if [ "3.10" == "${{ matrix.python-version }}" -o "3.11" == "${{ matrix.python-version }}" ]; then echo "TEST_DEPENDS=$(echo $NP_TEST_DEP_LATEST)" >> $GITHUB_ENV; else echo "TEST_DEPENDS=$(echo $NP_TEST_DEP)" >> $GITHUB_ENV; fi
- name: Download a wheel accordingly to matrix
uses: actions/download-artifact@v3
with:
Expand Down
16 changes: 11 additions & 5 deletions .github/workflows/build_wheels_macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ['3.6']
python-version: ['3.7']
platform: [x64]
with_contrib: [0, 1]
without_gui: [0, 1]
Expand Down Expand Up @@ -58,6 +58,12 @@ jobs:
if [[ "${{ github.event_name }}" == "schedule" || "${{ github.event_name }}" == "workflow_dispatch" ]]; then
echo "ENABLE_ROLLING=1" >> $GITHUB_ENV
fi
# hack for image issue on mac: https://github.com/actions/runner-images/issues/6817
rm /usr/local/bin/2to3*
rm /usr/local/bin/idle3*
rm /usr/local/bin/pydoc3*
rm /usr/local/bin/python3*
# end hack
- name: Checkout
uses: actions/checkout@v3
with:
Expand Down Expand Up @@ -100,7 +106,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ['3.6', '3.7', '3.8', '3.9', '3.10']
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11']
platform: [x64]
with_contrib: [0, 1]
without_gui: [0, 1]
Expand All @@ -109,7 +115,7 @@ jobs:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
MB_PYTHON_VERSION: ${{ matrix.python-version }}
NP_TEST_DEP: numpy==1.19.4
NP_TEST_DEP_LATEST: numpy==1.21.4
NP_TEST_DEP_LATEST: numpy==1.24.0
CONFIG_PATH: travis_config.sh
PLAT: x86_64
OPENCV_TEST_DATA_PATH: ${{ github.workspace }}/opencv_extra/testdata
Expand All @@ -129,7 +135,7 @@ jobs:
python-version: ${{ matrix.python-version }}
architecture: ${{ matrix.platform }}
- name: Setup Environment variables
run: if [ "3.10" == "${{ matrix.python-version }}" ]; then echo "TEST_DEPENDS=$(echo $NP_TEST_DEP_LATEST)" >> $GITHUB_ENV; else echo "TEST_DEPENDS=$(echo $NP_TEST_DEP)" >> $GITHUB_ENV; fi
run: if [ "3.10" == "${{ matrix.python-version }}" -o "3.11" == "${{ matrix.python-version }}" ]; then echo "TEST_DEPENDS=$(echo $NP_TEST_DEP_LATEST)" >> $GITHUB_ENV; else echo "TEST_DEPENDS=$(echo $NP_TEST_DEP)" >> $GITHUB_ENV; fi
- name: Download a wheel accordingly to matrix
uses: actions/download-artifact@v3
with:
Expand All @@ -146,7 +152,7 @@ jobs:
python modules/python/test/test.py -v --repo .
- name: Pylint test
run: |
python -m pip install pylint==2.12.2
python -m pip install pylint==2.15.9
cd ${{ github.workspace }}/tests
python -m pylint $PYLINT_TEST_FILE
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/build_wheels_macos_m1.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ['3.7', '3.8', '3.9', '3.10']
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11']
platform: [x64]
with_contrib: [0, 1]
without_gui: [0, 1]
Expand Down Expand Up @@ -109,7 +109,7 @@ jobs:
arch -arm64 python${{ matrix.python-version }} modules/python/test/test.py -v --repo .
- name: Pylint test
run: |
arch -arm64 python${{ matrix.python-version }} -m pip install pylint==2.12.2
arch -arm64 python${{ matrix.python-version }} -m pip install pylint==2.15.9
cd ${{ github.workspace }}/tests
arch -arm64 python${{ matrix.python-version }} -m pylint $PYLINT_TEST_FILE
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/build_wheels_windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ['3.6']
python-version: ['3.7']
platform: [x86, x64]
with_contrib: [0, 1]
without_gui: [0, 1]
Expand Down Expand Up @@ -67,7 +67,7 @@ jobs:
python -m pip install --upgrade setuptools
python -m pip install cmake==3.24.2
python -m pip install toml && python -c "import toml; c = toml.load('pyproject.toml'); print('\n'.join(c['build-system']['requires']))" >> requirements.txt | python -m pip install -r requirements.txt
set "CI_BUILD=1" && python setup.py bdist_wheel --py-limited-api=cp36 --dist-dir=%cd%\wheelhouse -v
set "CI_BUILD=1" && python setup.py bdist_wheel --py-limited-api=cp37 --dist-dir=%cd%\wheelhouse -v
shell: cmd
- name: Saving all wheels
uses: actions/upload-artifact@v3
Expand All @@ -89,7 +89,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ['3.6', '3.7', '3.8', '3.9', '3.10']
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11']
platform: [x86, x64]
with_contrib: [0, 1]
without_gui: [0, 1]
Expand Down Expand Up @@ -133,7 +133,7 @@ jobs:
python modules\python\test\test.py -v --repo .
- name: Pylint test
run: |
python -m pip install pylint==2.12.2
python -m pip install pylint==2.15.9
cd ${{ github.workspace }}\tests
python -m pylint $PYLINT_TEST_FILE
Expand Down
2 changes: 1 addition & 1 deletion opencv
Submodule opencv updated 282 files
2 changes: 1 addition & 1 deletion opencv_contrib
Submodule opencv_contrib updated 123 files
5 changes: 3 additions & 2 deletions patch_auditwheel_whitelist.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@ def add_zlib_versions():
for line in manylinux_policy_lines:
if "ZLIB" in line:
if len(line) > 22:
updated_line = line[:-2] + ', "1.2.9", "1.2.12"]'
updated_line = line[:-2] + ', "1.2.9", "1.2.12", "1.2.13"]'
else:
updated_line = line[:-2] + '"1.2.9", "1.2.12"]'
updated_line = line[:-2] + '"1.2.9", "1.2.12", "1.2.13"]'
print("auditwheel patch: replace policy line \"%s\" with \"%s\"" % (line, updated_line))
manylinux_policy_replacement = line.replace(line, updated_line)
else:
manylinux_policy_replacement = line
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ requires = [
"setuptools==59.2.0", "wheel==0.37.0", "cmake>=3.1", "pip",
"scikit-build>=0.13.2",
"numpy==1.13.3; python_version=='3.6' and platform_machine != 'aarch64' and platform_machine != 'arm64'",
"numpy==1.14.5; python_version=='3.7' and platform_machine != 'aarch64' and platform_machine != 'arm64'",
"numpy==1.17.0; python_version=='3.7' and platform_machine != 'aarch64' and platform_machine != 'arm64'",
"numpy==1.17.3; python_version=='3.8' and platform_machine != 'aarch64' and platform_machine != 'arm64'",
"numpy==1.19.3; python_version<='3.9' and sys_platform == 'linux' and platform_machine == 'aarch64'",
"numpy==1.21.0; python_version<='3.9' and sys_platform == 'darwin' and platform_machine == 'arm64'",
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def main():

install_requires = [
'numpy>=1.13.3; python_version<"3.7"',
'numpy>=1.14.5; python_version>="3.7"',
'numpy>=1.17.0; python_version>="3.7"', # https://github.com/numpy/numpy/pull/13725
'numpy>=1.17.3; python_version>="3.8"',
'numpy>=1.19.3; python_version>="3.9"',
'numpy>=1.21.2; python_version>="3.10"',
Expand Down
6 changes: 3 additions & 3 deletions travis_config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ function bdist_wheel_cmd {
local abs_wheelhouse=$1
# install all required packages in pyproject.toml, because bdist_wheel does not do it
python${PYTHON_VERSION} -m pip install toml && python${PYTHON_VERSION} -c 'import toml; c = toml.load("pyproject.toml"); print("\n".join(c["build-system"]["requires"]))' | python${PYTHON_VERSION} -m pip install -r /dev/stdin
CI_BUILD=1 python${PYTHON_VERSION} setup.py bdist_wheel --py-limited-api=cp36 -v
CI_BUILD=1 python${PYTHON_VERSION} setup.py bdist_wheel --py-limited-api=cp37 -v
cp dist/*.whl $abs_wheelhouse
if [ -z "$IS_OSX" ]; then
# this path can be changed in the latest manylinux image
Expand Down Expand Up @@ -143,7 +143,7 @@ function run_tests {

echo "Running for linux"

if [ $PYTHON == "python3.6" ]; then
if [ $PYTHON == "python3.7" ]; then
$PYTHON -m pip install -U numpy==1.19.4
fi
cd /io/tests
Expand All @@ -168,7 +168,7 @@ function pylint_test {

echo "Starting Pylint tests..."

$PYTHON -m pip install pylint==2.12.2
$PYTHON -m pip install pylint==2.15.9
cd /io/tests
$PYTHON -m pylint /io/opencv/samples/python/squares.py
}
Expand Down

0 comments on commit 339bca5

Please sign in to comment.