diff --git a/.github/workflows/build-wheels.yml b/.github/workflows/build-wheels.yml index bb7de252b..7b10028d2 100644 --- a/.github/workflows/build-wheels.yml +++ b/.github/workflows/build-wheels.yml @@ -34,7 +34,7 @@ jobs: # These are the platform build strings provided to # cibuildwheel, with wildcarding. See # https://cibuildwheel.readthedocs.io/en/stable/options/#build-skip - python-build: ['cp39*64', 'cp310*64', 'cp311*64'] + python-build: ['cp310*64', 'cp311*64'] defaults: run: # Annoyingly required here since `matrix` isn't available in the @@ -68,10 +68,12 @@ jobs: # deploy on that platform. CIBW_BUILD: ${{ matrix.python-build }} CIBW_SKIP: '*musllinux* *arm64*' - CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014 + # manylinux_2_28 is based on AlmaLinux 8, which uses glibc + # 2.28 and new libstdc++ ABI. + CIBW_MANYLINUX_X86_64_IMAGE: manylinux_2_28 PIP_VERBOSE: 1 - # Required as we make use of c++17 features - MACOSX_DEPLOYMENT_TARGET: 10.15 + # VFX Reference Platform CY23-CY24 + MACOSX_DEPLOYMENT_TARGET: 11 # Ensure .pyi stub tests won't be skipped OPENASSETIO_TEST_ENABLE_PYTHON_STUBGEN: 1 diff --git a/CMakeLists.txt b/CMakeLists.txt index 73178520c..f0a91af2c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -13,8 +13,8 @@ cmake_minimum_required(VERSION 3.27) # Additional include directories for CMake utils. list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/cmake) -# Minimum required for the C++17 features used. -set(CMAKE_OSX_DEPLOYMENT_TARGET 10.15) +# VFX Reference Platform CY23-CY24 +set(CMAKE_OSX_DEPLOYMENT_TARGET 11) # Forbid in-source builds. if (${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR}) diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index d852f2f37..0ee448dc2 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -11,9 +11,10 @@ section for more details._ ### Breaking changes -- Removed official support for Python 3.7. The minimum supported Python - version is now Python 3.9. +- Removed official support for Python 3.7 and 3.9. The minimum supported + Python version is now Python 3.10. This includes PyPI packages. [#1365](https://github.com/OpenAssetIO/OpenAssetIO/pull/1365) + [#1389](https://github.com/OpenAssetIO/OpenAssetIO/pull/1389) - Removed deprecated type aliases `openassetio.TraitsData`, `openassetio.BatchElementError` @@ -81,6 +82,10 @@ section for more details._ `openassetio.test.manager` API Compliance test harness, to aid in IDE code completion when writing test cases for manager plugins. +- `importlib_metadata` is no longer a dependency for Python + manager plugins to make use of Python entry point hooks. + [#1389](https://github.com/OpenAssetIO/OpenAssetIO/issues/1389) + ### Bug fixes - Modified OpenAssetIO Python distributions (e.g. installed with `pip @@ -88,6 +93,10 @@ section for more details._ multiple shared libraries, allowing external libraries to link. [#1340](https://github.com/OpenAssetIO/OpenAssetIO/issues/1340) +- Fixed Python wheel builds to use the new libstdc++ ABI, reflecting + their associated VFX Reference Platform version. + [#1352](https://github.com/OpenAssetIO/OpenAssetIO/issues/1352) + - Fixed the (Python-only) `terminology.Mapper` class such that its terminology dict can be updated by the manager. [#1356](https://github.com/OpenAssetIO/OpenAssetIO/pull/1356) diff --git a/doc/BUILDING.md b/doc/BUILDING.md index 1b74a76cc..3cdf8d81b 100644 --- a/doc/BUILDING.md +++ b/doc/BUILDING.md @@ -20,7 +20,7 @@ We assume the following system packages are installed - CMake 3.27+ - C++17 or later compliant compiler -(GCC 9.3+ / MSVC 16.9+ / macOS 10.15+) +(GCC 11.2+ / MSVC 17.4+ / macOS 11+) For linting and other build verification options, we assume the following packages are installed: @@ -34,7 +34,7 @@ following packages are installed: Binary builds additionally require the following packages to be available. -- [Python 3.9+](https://www.python.org/) (development install) +- [Python 3.10+](https://www.python.org/) (development install) - [pybind11](https://pybind11.readthedocs.io/en/stable/) 2.8.1+ - [toml++](https://marzer.github.io/tomlplusplus/) 3.2.0+ - [fmt](https://github.com/fmtlib/fmt) 9.1.0 diff --git a/doc/contributing/CODING_STANDARDS.md b/doc/contributing/CODING_STANDARDS.md index 62a57b665..11323a13d 100644 --- a/doc/contributing/CODING_STANDARDS.md +++ b/doc/contributing/CODING_STANDARDS.md @@ -55,7 +55,7 @@ disambiguating fixtures from tests. ### Python Python code should be written using only features included in Python -3.9. +3.10. Where feasible, Python unit test cases should use a class for each unit, where the methods of the test class are the test cases for that unit. In diff --git a/doc/doxygen/src/Configuration.dox b/doc/doxygen/src/Configuration.dox index c3e4f594d..59d18a176 100644 --- a/doc/doxygen/src/Configuration.dox +++ b/doc/doxygen/src/Configuration.dox @@ -207,9 +207,6 @@ * version as the one used to install via `pip`. * - Check that the appropriate directory is on `sys.path` in the * host's interpreter. - * - Check that `importlib_metadata` is available to the host - * interpreter (a message will be logged during startup if this is - * missing). * * @subsection manual_plugins_missing Manually installed plugins not being found * diff --git a/resources/build/bootstrap-cibuildwheel-manylinux-2014.sh b/resources/build/bootstrap-cibuildwheel-manylinux.sh similarity index 78% rename from resources/build/bootstrap-cibuildwheel-manylinux-2014.sh rename to resources/build/bootstrap-cibuildwheel-manylinux.sh index 61ddfea94..cda537638 100755 --- a/resources/build/bootstrap-cibuildwheel-manylinux-2014.sh +++ b/resources/build/bootstrap-cibuildwheel-manylinux.sh @@ -14,13 +14,12 @@ pip3 install -r "resources/build/requirements.txt" # Use explicit predictable conan root path, where packages are cached. export CONAN_USER_HOME="$HOME/conan" -# Create default conan profile so we can configure it before instlibXcomposite-develall. +# Create default conan profile so we can configure it before install. # Use --force so that if it already exists we don't error out. conan profile new default --detect --force -# Use old C++11 ABI as per VFX Reference Platform CY2022. Not strictly -# necessary as this is the default for conan, but we can't be certain -# it'll remain the default in future. -conan profile update settings.compiler.libcxx=libstdc++ default +# Use new/non-deprecated C++11 ABI to match VFX Reference Platform +# CY23+. +conan profile update settings.compiler.libcxx=libstdc++11 default # If we need to pin a package to a specific Conan recipe revision, then # we need to explicitly opt-in to this functionality. conan config set general.revisions_enabled=True diff --git a/src/openassetio-python/package/openassetio/pluginSystem/PythonPluginSystem.py b/src/openassetio-python/package/openassetio/pluginSystem/PythonPluginSystem.py index c533fd9aa..419c646b6 100644 --- a/src/openassetio-python/package/openassetio/pluginSystem/PythonPluginSystem.py +++ b/src/openassetio-python/package/openassetio/pluginSystem/PythonPluginSystem.py @@ -19,6 +19,7 @@ """ import os.path +import importlib.metadata import importlib.util import hashlib import sys @@ -113,30 +114,17 @@ def scan_entry_points(self, entryPointName): the first plugin with any given identifier will be registered. @param entryPointName `str` The entry point name to search for - (see: importlib_metadata.entry_points group). + (see: importlib.metadata.entry_points group). @returns True if entry point discovery is possible, False if - there was a problem loading importlib_metadata. + there was a problem loading importlib.metadata. """ - # We opt to use the backport implementation of modern importlib - # since the API changes from 3.9 to 3.10. - # Pip installs should have this module available, but other methods may not, - # so be tolerant of it being missing. - try: - import importlib_metadata # pylint: disable=import-outside-toplevel - except ImportError: - self.__logger.warning( - "PythonPluginSystem: Can not load entry point plugins as the importlib_metadata " - "package is unavailable." - ) - return False - self.__logger.debug( f"PythonPluginSystem: Searching packages for '{entryPointName}' entry points." ) - for entryPoint in importlib_metadata.entry_points(group=entryPointName): + for entryPoint in importlib.metadata.entry_points(group=entryPointName): self.__logger.debug(f"PythonPluginSystem: Found entry point in {entryPoint.name}") try: module = entryPoint.load() diff --git a/src/openassetio-python/pyproject.toml b/src/openassetio-python/pyproject.toml index f9355a41a..478a0ff8f 100644 --- a/src/openassetio-python/pyproject.toml +++ b/src/openassetio-python/pyproject.toml @@ -14,10 +14,7 @@ build-backend = "setuptools.build_meta" [project] name = "openassetio" version = "1.0.0b2.rev2" -requires-python = ">=3.9" -dependencies = [ - "importlib_metadata >= 3.6" -] +requires-python = ">=3.10" authors = [ { name = "Contributors to the OpenAssetIO project", email = "openassetio-discussion@lists.aswf.io" } @@ -37,7 +34,6 @@ classifiers = [ "Operating System :: Microsoft :: Windows", "Operating System :: POSIX :: Linux", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Topic :: Software Development :: Libraries :: Python Modules", @@ -144,5 +140,5 @@ environment-pass = ["PIP_VERBOSE", "OPENASSETIO_TEST_ENABLE_PYTHON_STUBGEN"] [tool.cibuildwheel.linux] # Linux runs in a docker container, with the project at top level -before-build = "resources/build/bootstrap-cibuildwheel-manylinux-2014.sh" +before-build = "resources/build/bootstrap-cibuildwheel-manylinux.sh" environment = { CMAKE_TOOLCHAIN_FILE=".conan/conan_paths.cmake" } diff --git a/src/openassetio-python/requirements.txt b/src/openassetio-python/requirements.txt deleted file mode 100644 index 7e753f6ce..000000000 --- a/src/openassetio-python/requirements.txt +++ /dev/null @@ -1 +0,0 @@ -importlib_metadata>=3.6 diff --git a/src/openassetio-python/tests/CMakeLists.txt b/src/openassetio-python/tests/CMakeLists.txt index c79679fed..40ae0daf1 100644 --- a/src/openassetio-python/tests/CMakeLists.txt +++ b/src/openassetio-python/tests/CMakeLists.txt @@ -47,13 +47,6 @@ endif () #----------------------------------------------------------------------- # Test dependencies. -# Install openassetio-specific dependencies that allow us to -# extend PYTHONPATH without needing to pip install to run tests. -openassetio_add_python_environment_dependency( - openassetio.internal.python.install-deps - "${PROJECT_SOURCE_DIR}/src/openassetio-python/requirements.txt" -) - # Install test-specific dependencies (e.g. pytest). openassetio_add_python_environment_dependency( openassetio.internal.pytest.install-deps diff --git a/src/openassetio-python/tests/package/pluginSystem/resources/broken/src/missing_plugin/pyproject.toml b/src/openassetio-python/tests/package/pluginSystem/resources/broken/src/missing_plugin/pyproject.toml index cf86b3df2..97d9f280a 100644 --- a/src/openassetio-python/tests/package/pluginSystem/resources/broken/src/missing_plugin/pyproject.toml +++ b/src/openassetio-python/tests/package/pluginSystem/resources/broken/src/missing_plugin/pyproject.toml @@ -10,7 +10,7 @@ build-backend = "setuptools.build_meta" [project] name = "missing-plugin" version = "0.0.0" -requires-python = ">=3.9" +requires-python = ">=3.10" description = """\ A test OpenAssetIO Manager plugin that is missing the top-level diff --git a/src/openassetio-python/tests/package/pluginSystem/resources/broken/src/raises_exception/pyproject.toml b/src/openassetio-python/tests/package/pluginSystem/resources/broken/src/raises_exception/pyproject.toml index 1ea84ec0e..96a9cad55 100644 --- a/src/openassetio-python/tests/package/pluginSystem/resources/broken/src/raises_exception/pyproject.toml +++ b/src/openassetio-python/tests/package/pluginSystem/resources/broken/src/raises_exception/pyproject.toml @@ -10,7 +10,7 @@ build-backend = "setuptools.build_meta" [project] name = "raises-exception" version = "0.0.0" -requires-python = ">=3.9" +requires-python = ">=3.10" description = """\ A test OpenAssetIO Manager plugin that raises an exception during inmport. diff --git a/src/openassetio-python/tests/package/pluginSystem/resources/entryPoint/src/pyproject.toml b/src/openassetio-python/tests/package/pluginSystem/resources/entryPoint/src/pyproject.toml index e6cfc069a..235de11d2 100644 --- a/src/openassetio-python/tests/package/pluginSystem/resources/entryPoint/src/pyproject.toml +++ b/src/openassetio-python/tests/package/pluginSystem/resources/entryPoint/src/pyproject.toml @@ -10,7 +10,7 @@ build-backend = "setuptools.build_meta" [project] name = "packaged-plugin" version = "0.0.0" -requires-python = ">=3.9" +requires-python = ">=3.10" description = """\ A test OpenAssetIO Manager plugin that can be pip installed and \ diff --git a/src/openassetio-python/tests/package/pluginSystem/test_pythonpluginsystem.py b/src/openassetio-python/tests/package/pluginSystem/test_pythonpluginsystem.py index 3491ca3f2..9f4b64c74 100644 --- a/src/openassetio-python/tests/package/pluginSystem/test_pythonpluginsystem.py +++ b/src/openassetio-python/tests/package/pluginSystem/test_pythonpluginsystem.py @@ -175,22 +175,6 @@ def test_when_entry_point_package_installed_then_loaded_and_true_returned( assert a_plugin_system.scan_entry_points(PLUGIN_ENTRY_POINT_GROUP) is True assert a_plugin_system.identifiers() == [entry_point_plugin_identifier] - def test_when_importlib_metadata_missing_then_a_warning_is_loggeed_and_false_returned( - self, mock_logger, monkeypatch - ): - # Remove any previously imported versions - sys.modules.pop("importlib_metadata", None) - monkeypatch.setattr(sys, "path", []) - - plugin_system = PythonPluginSystem(mock_logger) - assert plugin_system.scan_entry_points("some.entrypoint") is False - - mock_logger.mock.log.assert_called_once_with( - mock_logger.Severity.kWarning, - "PythonPluginSystem: Can not load entry point plugins as the importlib_metadata " - "package is unavailable.", - ) - def test_when_plugins_broken_then_skipped_with_expected_errors( self, broken_python_plugins_path, mock_logger, monkeypatch ): diff --git a/src/openassetio-python/tests/test_cmake.py b/src/openassetio-python/tests/test_cmake.py index 5e039bfd1..445face1c 100644 --- a/src/openassetio-python/tests/test_cmake.py +++ b/src/openassetio-python/tests/test_cmake.py @@ -18,18 +18,11 @@ """ # pylint: disable=missing-function-docstring,invalid-name import os +from importlib import metadata import pytest -try: - from importlib import metadata - - # pylint: disable=bare-except -except: - import importlib_metadata as metadata - - @pytest.mark.skipif( os.environ.get("OPENASSETIO_CMAKE_PACKAGE_VERSION") is None, reason="CMake package only" )