Skip to content

Commit

Permalink
build!: Move to Python 3.7 minimum (#4200)
Browse files Browse the repository at this point in the history
These are build-breaking changes that impose a variety of new minimum
dependencies for the toolchain.

The new minimum Python version supported is now 3.7.

Get rid of 'from future' lines in python scripts in testsuite.

Remove python 2.7 specific ref images from testsuite.

Needless to say, this will not be backported to any release branches,
which guarantee that they will never raise the minimum supported
versions of any dependencies. This is just for future OIIO.

Signed-off-by: Larry Gritz <lg@larrygritz.com>
  • Loading branch information
lgritz authored Apr 5, 2024
1 parent cc36e2a commit 8799aed
Show file tree
Hide file tree
Showing 51 changed files with 15 additions and 1,177 deletions.
8 changes: 2 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -332,26 +332,22 @@ jobs:
- desc: debug gcc9/C++17, sse4.2, exr2.4
nametag: linux-gcc9-cpp17-debug
runner: ubuntu-20.04
container:
image: ubuntu-18.04
cxx_compiler: g++-9
cxx_std: 17
python_ver: 2.7
python_ver: 3.8
simd: sse4.2
openexr_ver: v2.4.3
pybind11_ver: v2.6.2
setenvs: export CMAKE_BUILD_TYPE=Debug
PUGIXML_VERSION=v1.9
CTEST_TEST_TIMEOUT=1200

- desc: static libs gcc9 C++17 exr2.4
nametag: linux-static
runner: ubuntu-20.04
container:
image: ubuntu-18.04
cxx_compiler: g++-9
cxx_std: 17
openexr_ver: v2.4.3
python_ver: 3.8
pybind11_ver: v2.6.2
setenvs: export BUILD_SHARED_LIBS=OFF
depcmds: |
Expand Down
2 changes: 1 addition & 1 deletion INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ NEW or CHANGED MINIMUM dependencies since the last major release are **bold**.
* Qt5 >= 5.6 (tested through 5.15) or Qt6 (tested through 6.6)
* OpenGL
* If you are building the Python bindings or running the testsuite:
* Python >= 2.7 (tested against 2.7, 3.7, 3.8, 3.9, 3.10, 3.11)
* **Python >= 3.7** (tested through 3.12)
* pybind11 >= 2.4.2 (Tested through 2.11. Note that pybind11 v2.10+ does
not support Python < 3.6.)
* NumPy
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ help:
@echo " USE_EXTERNAL_PUGIXML=1 Use the system PugiXML, not the one in OIIO"
@echo " USE_QT=0 Skip anything that needs Qt"
@echo " USE_PYTHON=0 Don't build the Python binding"
@echo " PYTHON_VERSION=2.6 Specify the Python version"
@echo " PYTHON_VERSION=3.9 Specify the Python version"
@echo " USE_NUKE=0 Don't build Nuke plugins"
@echo " Nuke_ROOT=path Custom Nuke installation"
@echo " NUKE_VERSION=ver Custom Nuke version"
Expand Down
2 changes: 1 addition & 1 deletion src/build-scripts/ci-startup.bash
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export LSAN_OPTIONS=suppressions=$PWD/src/build-scripts/nosanitize.txt
export ASAN_OPTIONS=print_suppressions=0
export UBSAN_OPTIONS=suppressions=$PWD/src/build-scripts/ubsan-suppressions.txt

export PYTHON_VERSION=${PYTHON_VERSION:="2.7"}
export PYTHON_VERSION=${PYTHON_VERSION:="3.7"}
export PYTHONPATH=$OpenImageIO_ROOT/lib/python${PYTHON_VERSION}/site-packages:$PYTHONPATH
export BUILD_MISSING_DEPS=${BUILD_MISSING_DEPS:=1}
export COMPILER=${COMPILER:=gcc}
Expand Down
6 changes: 1 addition & 5 deletions src/build-scripts/gh-installdeps.bash
Original file line number Diff line number Diff line change
Expand Up @@ -101,12 +101,8 @@ else
if [[ "${PYTHON_VERSION}" == "3.9" ]] ; then
time sudo apt-get -q install -y python3.9-dev python3-numpy
pip3 --version
pip3 install numpy
elif [[ "$PYTHON_VERSION" == "2.7" ]] ; then
time sudo apt-get -q install -y python-dev python-numpy
else
pip3 install numpy
fi
pip3 install numpy

if [[ "$USE_LIBHEIF" != "0" ]] ; then
sudo add-apt-repository ppa:strukturag/libde265 || true
Expand Down
4 changes: 1 addition & 3 deletions src/build-scripts/gh-win-installdeps.bash
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,7 @@ export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$DEP_DIR/lib:$VCPKG_INSTALLATION_ROOT/i
#ls -l "C:/Program Files (x86)/Microsoft Visual Studio" && true


if [[ "$PYTHON_VERSION" == "3.6" ]] ; then
export CMAKE_PREFIX_PATH="$CMAKE_PREFIX_PATH;/c/hostedtoolcache/windows/Python/3.6.8/x64"
elif [[ "$PYTHON_VERSION" == "3.7" ]] ; then
if [[ "$PYTHON_VERSION" == "3.7" ]] ; then
export CMAKE_PREFIX_PATH="$CMAKE_PREFIX_PATH;/c/hostedtoolcache/windows/Python/3.7.9/x64"
export Python_EXECUTABLE="/c/hostedtoolcache/windows/Python/3.7.9/x64/python.exe"
export PYTHONPATH=$OpenImageIO_ROOT/lib/python${PYTHON_VERSION}/site-packages
Expand Down
1 change: 1 addition & 0 deletions src/cmake/pythonutils.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ macro (find_python)
endif ()
checked_find_package (Python ${PYTHON_VERSION}
${_req}
VERSION_MIN 3.7
COMPONENTS Interpreter Development
PRINT Python_VERSION Python_EXECUTABLE
Python_LIBRARIES
Expand Down
1 change: 0 additions & 1 deletion src/doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
# import sys
# sys.path.insert(0, os.path.abspath('.'))

from __future__ import absolute_import
import sys
import os
import shlex
Expand Down
2 changes: 0 additions & 2 deletions src/doc/help2man_preformat.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
# and munge such that txt2man generates a simple man page with not-too-horrible
# formatting.

from __future__ import print_function
from __future__ import absolute_import
import sys

lines = [l.rstrip().replace('\t', ' '*8) for l in sys.stdin.readlines()]
Expand Down
13 changes: 2 additions & 11 deletions src/python/py_oiio.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,25 +38,16 @@
#include <OpenImageIO/texture.h>
#include <OpenImageIO/typedesc.h>

#if PY_MAJOR_VERSION < 3
OIIO_CLANG_PRAGMA(GCC diagnostic ignored "-Wunused-value")
#endif

#include <pybind11/numpy.h>
#include <pybind11/operators.h>
#include <pybind11/pybind11.h>
#include <pybind11/stl.h>
namespace py = pybind11;


#if PY_MAJOR_VERSION == 2
// Preferred Python string caster for Python2 is py::bytes, so it's a byte
// string (not unicode).
# define PY_STR py::bytes
#else
// Python3 is always unicode, so return a true str
# define PY_STR py::str
#endif
#define PY_STR py::str



namespace pybind11 {
Expand Down
2 changes: 0 additions & 2 deletions testsuite/docs-examples-python/src/docs-examples-imagebuf.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
# SPDX-License-Identifier: Apache-2.0
# https://github.com/AcademySoftwareFoundation/OpenImageIO

from __future__ import print_function
from __future__ import absolute_import


############################################################################
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
# SPDX-License-Identifier: Apache-2.0
# https://github.com/AcademySoftwareFoundation/OpenImageIO

from __future__ import print_function
from __future__ import absolute_import


############################################################################
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
# SPDX-License-Identifier: Apache-2.0
# https://github.com/AcademySoftwareFoundation/OpenImageIO

from __future__ import print_function
from __future__ import absolute_import


############################################################################
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
# SPDX-License-Identifier: Apache-2.0
# https://github.com/AcademySoftwareFoundation/OpenImageIO

from __future__ import print_function
from __future__ import absolute_import


############################################################################
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
# SPDX-License-Identifier: Apache-2.0
# https://github.com/AcademySoftwareFoundation/OpenImageIO

from __future__ import print_function
from __future__ import absolute_import


############################################################################
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
# SPDX-License-Identifier: Apache-2.0
# https://github.com/AcademySoftwareFoundation/OpenImageIO

from __future__ import print_function
from __future__ import absolute_import


############################################################################
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
# SPDX-License-Identifier: Apache-2.0
# https://github.com/AcademySoftwareFoundation/OpenImageIO

from __future__ import print_function
from __future__ import absolute_import


############################################################################
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
# SPDX-License-Identifier: Apache-2.0
# https://github.com/AcademySoftwareFoundation/OpenImageIO

from __future__ import print_function
from __future__ import absolute_import


############################################################################
Expand Down
1 change: 0 additions & 1 deletion testsuite/misnamed-file/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
# https://github.com/AcademySoftwareFoundation/OpenImageIO


from __future__ import absolute_import
import shutil

# Make a copy called "misnamed.exr" that's actually a TIFF file
Expand Down
2 changes: 0 additions & 2 deletions testsuite/missingcolor/src/makepartialexr.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
# SPDX-License-Identifier: Apache-2.0
# https://github.com/AcademySoftwareFoundation/OpenImageIO

from __future__ import print_function
from __future__ import absolute_import
import OpenImageIO as oiio
import numpy as np

Expand Down
1 change: 0 additions & 1 deletion testsuite/oiiotool-color/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
# https://github.com/AcademySoftwareFoundation/OpenImageIO


from __future__ import absolute_import
import os

# print("ociover =", ociover)
Expand Down
1 change: 0 additions & 1 deletion testsuite/oiiotool-text/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
# https://github.com/AcademySoftwareFoundation/OpenImageIO


from __future__ import absolute_import
import os


Expand Down
2 changes: 0 additions & 2 deletions testsuite/oiiotool-xform/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
# https://github.com/AcademySoftwareFoundation/OpenImageIO

#import OpenImageIO as oiio
from __future__ import division
from __future__ import absolute_import
import shutil
import os

Expand Down
30 changes: 0 additions & 30 deletions testsuite/python-colorconfig/ref/out-noocio-python27.txt

This file was deleted.

30 changes: 0 additions & 30 deletions testsuite/python-colorconfig/ref/out-ocio11-python27.txt

This file was deleted.

30 changes: 0 additions & 30 deletions testsuite/python-colorconfig/ref/out-ocio111-python27.txt

This file was deleted.

30 changes: 0 additions & 30 deletions testsuite/python-colorconfig/ref/out-ocio21-python27-alt.txt

This file was deleted.

Loading

0 comments on commit 8799aed

Please sign in to comment.