Skip to content

Commit

Permalink
Switch python build to scikit-build-core
Browse files Browse the repository at this point in the history
  • Loading branch information
JeanChristopheMorinPerso committed Nov 23, 2024
1 parent 3a8bad4 commit da5a372
Show file tree
Hide file tree
Showing 9 changed files with 106 additions and 475 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ env:

on:
push:
branches: [ main ]
branches: [ main, "switch_to_scikit_build_core" ]
pull_request:
branches: [ main ]

Expand Down Expand Up @@ -93,6 +93,7 @@ jobs:
py_build_test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-13, macos-latest]
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12']
Expand Down Expand Up @@ -146,8 +147,8 @@ jobs:
sudo apt-get install lcov
- name: Install python build dependencies
run: |
python -m pip install --upgrade pip setuptools wheel "flake8>=3.5" check-manifest
- name: Run check-manifest and lint check
python -m pip install --upgrade pip build "flake8>=3.5"
- name: Run lint check
run: make ci-prebuild
- name: Build and Install
run: |
Expand Down
4 changes: 4 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,10 @@ if(OTIO_PYTHON_INSTALL)
# can find them, rather as part of the C++ SDK package; so the variable
# OTIO_RESOLVED_CXX_DYLIB_INSTALL_DIR indicates where that is.
#
if (SKBUILD)
set(OTIO_PYTHON_INSTALL_DIR ${SKBUILD_PLATLIB_DIR})
endif()

if(OTIO_PYTHON_INSTALL_DIR STREQUAL "" AND CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
# neither install directory supplied from the command line
set(OTIO_RESOLVED_PYTHON_INSTALL_DIR "${Python_SITEARCH}")
Expand Down
31 changes: 0 additions & 31 deletions MANIFEST.in

This file was deleted.

14 changes: 2 additions & 12 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.PHONY: coverage test test_first_fail clean autopep8 lint doc-html \
python-version wheel manifest lcov lcov-html lcov-reset
python-version wheel lcov lcov-html lcov-reset

# Special definition to handle Make from stripping newlines
define newline
Expand Down Expand Up @@ -28,7 +28,6 @@ LCOV_PROG := $(shell command -v lcov 2> /dev/null)
PYCODESTYLE_PROG := $(shell command -v pycodestyle 2> /dev/null)
PYFLAKES_PROG := $(shell command -v pyflakes 2> /dev/null)
FLAKE8_PROG := $(shell command -v flake8 2> /dev/null)
CHECK_MANIFEST_PROG := $(shell command -v check-manifest 2> /dev/null)
CLANG_FORMAT_PROG := $(shell command -v clang-format 2> /dev/null)
# AUTOPEP8_PROG := $(shell command -v autopep8 2> /dev/null)
TEST_ARGS=
Expand All @@ -54,7 +53,7 @@ test-core: python-version

# CI
###################################
ci-prebuild: manifest lint
ci-prebuild: lint
ci-postbuild: coverage
###################################

Expand Down Expand Up @@ -164,15 +163,6 @@ endif
$(eval DIRS += src/py-opentimelineio/opentimelineio-opentime-bindings)
$(eval FILES_TO_FORMAT = $(wildcard $(addsuffix /*.h, $(DIRS)) $(addsuffix /*.cpp, $(DIRS))))
$(shell clang-format -i -style=file $(FILES_TO_FORMAT))

manifest:
ifndef CHECK_MANIFEST_PROG
$(error $(newline)$(ccred)check-manifest is not available on $$PATH please see:$(newline)$(ccend)\
$(ccblue) https://github.com/mgedmin/check-manifest#quick-start$(newline)$(ccend)\
$(dev_deps_message))
endif
@check-manifest
@echo "check-manifest succeeded"


doc-model:
Expand Down
97 changes: 92 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,97 @@
[build-system]
requires = [
"setuptools",
"wheel",
"cmake>=3.12",
requires = ["scikit-build-core>=0.10.7"]
build-backend = "scikit_build_core.build"

[project]
name = "OpenTimelineIO"
version = "0.18.0.dev1"
description = "Editorial interchange format and API"
authors = [
{name = "Contributors to the OpenTimelineIO project", email = "[email protected]"}
]
license = {file = "LICENSE.txt"}
keywords = ["film", "tv", "editing", "editorial", "edit", "non-linear", "edl", "time"]
classifiers = [
"Development Status :: 4 - Beta",
"Topic :: Multimedia :: Graphics",
"Topic :: Multimedia :: Video",
"Topic :: Multimedia :: Video :: Display",
"Topic :: Multimedia :: Video :: Non-Linear Editor",
"Topic :: Software Development :: Libraries :: Python Modules",
"License :: OSI Approved :: Apache Software License",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Operating System :: OS Independent",
"Natural Language :: English",
]

# Disallow 3.9.0 because of https://github.com/python/cpython/pull/22670
requires-python = ">=3.7, !=3.9.0"

dependencies = [
'importlib_metadata>=1.4; python_version < "3.8"'
]

[project.urls]
Documentation = "https://opentimelineio.readthedocs.io"
Homepage = "https://opentimeline.io"
Issues = "https://github.com/AcademySoftwareFoundation/OpenTimelineIO/issues"
Source = "https://github.com/AcademySoftwareFoundation/OpenTimelineIO"

[project.scripts]
otiocat = "opentimelineio.console.otiocat:main"
otioconvert = "opentimelineio.console.otioconvert:main"
otiopluginfo = "opentimelineio.console.otiopluginfo:main"
otiostat = "opentimelineio.console.otiostat:main"
otiotool = "opentimelineio.console.otiotool:main"
otioview = "opentimelineview.console:main"
otioautogen_serialized_schema_docs = "opentimelineio.console.autogen_serialized_datamodel:main"

[project.optional-dependencies]
dev = [
"check-manifest",
"flake8>=3.5",
"coverage>=4.5",
"urllib3>=1.24.3",
]
view = [
'PySide2~=5.11; platform.machine=="x86_64"',
'PySide6~=6.2; platform.machine=="aarch64"',
]
build-backend = "setuptools.build_meta"

[tool.scikit-build]
cmake.version = "CMakeLists.txt"

cmake.build-type = "Release"

logging.level = "DEBUG"
build.verbose = true

sdist.include = ["src/opentimelineio/adapters/builtin_adapters.plugin_manifest.json"]

wheel.packages = ["src/py-opentimelineio/opentimelineio", "src/opentimelineview"]
wheel.install-dir = "opentimelineio"

build-dir = "build"

[[tool.scikit-build.generate]]
path = "opentimelineio/__init__.py"
template-path = "src/py-opentimelineio/opentimelineio/__init__.py"

[[tool.scikit-build.generate]]
path = "opentimelineview/__init__.py"
template-path = "src/opentimelineview/__init__.py"

[tool.scikit-build.cmake.define]
OTIO_PYTHON_INSTALL = "ON"
OTIO_CXX_INSTALL = "OFF"
OTIO_SHARED_LIBS = "OFF"
BUILD_TESTING = "OFF"
OTIO_INSTALL_PYTHON_MODULES = "OFF"

[tool.cibuildwheel.linux]
archs = ["x86_64", "aarch64"]
Expand Down
6 changes: 0 additions & 6 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
###############################################################################
# Python Distribution
###############################################################################
[metadata]
description_file = README.md

###############################################################################
# flake8
###############################################################################
Expand Down
Loading

0 comments on commit da5a372

Please sign in to comment.