Skip to content

Commit abb2d44

Browse files
Migrate Python packaging to pyproject.toml (#2782)
This changelist migrates the MaterialX Python packaging configuration from the legacy `setup.py` script to the modern `pyproject.toml` standard, as defined in PEP 517 and PEP 621.
1 parent 72d59cb commit abb2d44

4 files changed

Lines changed: 15 additions & 21 deletions

File tree

python/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ if(SKBUILD)
1212
endif()
1313

1414
if(MATERIALX_INSTALL_PYTHON AND PYTHON_EXECUTABLE AND NOT SKBUILD)
15-
set(SETUP_PY "${CMAKE_INSTALL_PREFIX}/python/setup.py")
16-
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/setup.py.in" "${SETUP_PY}")
15+
set(PYPROJECT_TOML "${CMAKE_INSTALL_PREFIX}/python/pyproject.toml")
16+
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/pyproject.toml.in" "${PYPROJECT_TOML}")
1717
install(CODE "execute_process(COMMAND ${PYTHON_EXECUTABLE} -m pip install . WORKING_DIRECTORY ${CMAKE_INSTALL_PREFIX}/python)")
1818
endif()

python/MaterialX/MANIFEST.in

Lines changed: 0 additions & 1 deletion
This file was deleted.

python/pyproject.toml.in

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
[build-system]
2+
requires = ["setuptools"]
3+
build-backend = "setuptools.build_meta"
4+
5+
[project]
6+
name = "MaterialX"
7+
version = "${MATERIALX_MAJOR_VERSION}.${MATERIALX_MINOR_VERSION}.${MATERIALX_BUILD_VERSION}"
8+
9+
[tool.setuptools]
10+
packages = ["MaterialX"]
11+
12+
[tool.setuptools.package-data]
13+
MaterialX = ["**/*"]

python/setup.py.in

Lines changed: 0 additions & 18 deletions
This file was deleted.

0 commit comments

Comments
 (0)