Skip to content

Commit

Permalink
build!: Move to Python 3.7 minimum
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. I won't
merge this until after April 1, at which point I will also tag the
last spot in master that is known to work with Python 2.7.

Signed-off-by: Larry Gritz <lg@larrygritz.com>
  • Loading branch information
lgritz committed Mar 23, 2024
1 parent d743c61 commit e82f665
Show file tree
Hide file tree
Showing 51 changed files with 27 additions and 1,213 deletions.
56 changes: 14 additions & 42 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,18 +34,6 @@ jobs:
fail-fast: false
matrix:
include:
- desc: gcc6/C++14 py2.7 boost1.66 exr2.4 ocio1.1
nametag: linux-vfx2019
runner: ubuntu-latest
container: aswf/ci-osl:2019
vfxyear: 2019
cxx_std: 14
openexr_ver: v2.4.3
python_ver: 2.7
simd: sse4.2
fmt_ver: 7.0.1
pybind11_ver: v2.4.2
setenvs: export PUGIXML_VERSION=v1.9 CMAKE_VERSION=3.15.5
- desc: gcc6/C++14 py3.7 boost1.70 exr2.4 ocio1.1
nametag: linux-vfx2020
runner: ubuntu-latest
Expand Down Expand Up @@ -163,18 +151,18 @@ jobs:
simd: "avx2,f16c"
fmt_ver: 10.1.1
pybind11_ver: v2.10.0
- desc: oldest/hobbled gcc6.3/C++14 py2.7 boost-1.66 exr-2.4 no-sse no-ocio
- desc: oldest/hobbled gcc9.3/C++17 py3.7 boost-1.66 exr-2.4 no-sse no-ocio
# Oldest versions of the dependencies that we can muster, and various
# things disabled (no SSE, OCIO, or OpenCV, don't embed plugins).
nametag: linux-oldest
runner: ubuntu-latest
container: aswf/ci-osl:2019
vfxyear: 2019
cxx_std: 14
container: aswf/ci-osl:2021
vfxyear: 2021
cxx_std: 17
fmt_ver: 7.0.1
openexr_ver: v2.4.0
pybind11_ver: v2.4.2
python_ver: 2.7
python_ver: 3.7
simd: 0
setenvs: export EMBEDPLUGINS=0
CMAKE_VERSION=3.15.5
Expand Down Expand Up @@ -352,41 +340,25 @@ jobs:
OPENCOLORIO_VERSION=v2.1.2
USE_OPENVDB=0
# The installed OpenVDB has a TLS conflict with Python 3.8
- desc: debug gcc7/C++14, sse4.2, exr2.4
nametag: linux-gcc7-cpp14-debug
- 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++-7
cxx_std: 14
python_ver: 2.7
cxx_compiler: g++-9
cxx_std: 17
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: gcc8 C++17 avx exr2.5
nametag: linux-gcc8
runner: ubuntu-20.04
container:
image: ubuntu-18.04
cc_compiler: gcc-8
cxx_compiler: g++-8
cxx_std: 17
openexr_ver: v2.5.8
pybind11_ver: v2.5.0
simd: avx
setenvs: export EXTRA_DEP_PACKAGES=libjpeg-turbo8-dev
- desc: static libs gcc7 C++14 exr2.4
- desc: static libs gcc9 C++17 exr2.4
nametag: linux-static
runner: ubuntu-20.04
container:
image: ubuntu-18.04
cxx_compiler: g++-7
cxx_std: 14
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 @@ -37,7 +37,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.

Loading

0 comments on commit e82f665

Please sign in to comment.