Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 27 additions & 1 deletion python/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,28 @@

# Add the MDSplus Python package subdirectory
add_subdirectory(MDSplus)

# Find Python interpreter for building the wheel
find_package(Python3 COMPONENTS Interpreter REQUIRED)

# Define where the wheel will be placed
set(WHEEL_OUTPUT_DIR ${CMAKE_BINARY_DIR}/python)

# Ensure the output directory exists
file(MAKE_DIRECTORY ${WHEEL_OUTPUT_DIR})

# Custom target that depends on the build command
add_custom_target(build_wheel ALL
${Python3_EXECUTABLE} -m pip wheel --wheel-dir ${WHEEL_OUTPUT_DIR} --no-deps ${CMAKE_CURRENT_SOURCE_DIR}/MDSplus
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/MDSplus/_version.py
COMMENT "Building MDSplus wheel"
)

# After building the wheel, install it into the python directory of the project

install(DIRECTORY ${WHEEL_OUTPUT_DIR}
DESTINATION ${CMAKE_INSTALL_PREFIX}
FILES_MATCHING
PATTERN "*.whl"
PATTERN "MDSplus" EXCLUDE
PATTERN "CMakeFiles" EXCLUDE
)
4 changes: 3 additions & 1 deletion python/MDSplus/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,6 @@ install(
PATTERN "tests" EXCLUDE
PATTERN "*.pyc" EXCLUDE
PATTERN "__pycache__" EXCLUDE
)
PATTERN "build" EXCLUDE
PATTERN "*.egg-info" EXCLUDE
)
11 changes: 4 additions & 7 deletions python/MDSplus/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,13 @@
authors = [
{name = "MDSplus Development Team", email = "mdsplusadmin@psfc.mit.edu"},
]
license = {text = "MIT License"}
description = "MDSplus Python Object interface"
license = "MIT"
classifiers = [
"Programming Language :: Python",
"Intended Audience :: Science/Research",
"Environment :: Console",
"Topic :: Scientific/Engineering",
"License :: OSI Approved :: MIT License",
]
keywords=['physics', 'mdsplus']
dynamic = ["version"]
Expand All @@ -33,20 +32,18 @@
[tool.setuptools]
packages = [
'MDSplus',
'MDSplus.widgets',
'MDSplus.widgets',
'MDSplus.wsgi',
'MDSplus.tests',
]
include-package-data = false # use package-data below

[tool.setuptools.package-dir]
'MDSplus' = '.'
'MDSplus.widgets' = 'widgets'
'MDSplus.wsgi' = 'wsgi'
'MDSplus.tests' = 'tests'


[tool.setuptools.package-data]
'MDSplus.wsgi' = [
'MDSplus.wsgi' = [
'html/*',
'conf/*',
'js/*',
Expand Down