From 46fa40fcf72dad3513e029bfb34aebf8a4d99e10 Mon Sep 17 00:00:00 2001 From: Lennart Ochel Date: Thu, 21 Nov 2024 21:27:54 +0100 Subject: [PATCH] Recover changes to build PyPI package (#1371) --- CMakeLists.txt | 6 +----- src/pip/CMakeLists.txt | 16 +++------------- src/pip/Makefile | 13 +++++++++++++ 3 files changed, 17 insertions(+), 18 deletions(-) create mode 100644 src/pip/Makefile diff --git a/CMakeLists.txt b/CMakeLists.txt index 63bc377b6..697e76c09 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -68,11 +68,7 @@ add_subdirectory(src/OMSimulator) add_subdirectory(src/OMSimulatorLua) add_subdirectory(src/OMSimulatorPython) add_subdirectory(src/OMSimulatorServer) - -option(OM_OMS_ENABLE_PIP "create the OMSimulator pip package" OFF) -if(OM_OMS_ENABLE_PIP) - add_subdirectory(src/pip) -endif() +add_subdirectory(src/pip) add_subdirectory(doc) diff --git a/src/pip/CMakeLists.txt b/src/pip/CMakeLists.txt index f5d77808e..67c0a6683 100644 --- a/src/pip/CMakeLists.txt +++ b/src/pip/CMakeLists.txt @@ -1,17 +1,7 @@ project(pip) -set(CMAKE_INSTALL_BINDIR ${CMAKE_INSTALL_BINDIR}/pip) -# set(CMAKE_INSTALL_DATADIR ${CMAKE_INSTALL_DATADIR}/pip) - -IF (OMS_VERSION_STRING MATCHES "^(.*)\\.post(.*)-g(.*)$") - set(OMS_BUILD_TYPE "nightly") -ELSE() - set(OMS_BUILD_TYPE "stable") -ENDIF() - configure_file("${CMAKE_CURRENT_SOURCE_DIR}/setup.py" "${CMAKE_CURRENT_BINARY_DIR}/setup.py" @ONLY) -install(FILES "${CMAKE_CURRENT_BINARY_DIR}/setup.py" - TYPE BIN) -install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/README.md" "${CMAKE_SOURCE_DIR}/OSMC-License.txt" - TYPE BIN) +install(FILES "${CMAKE_CURRENT_BINARY_DIR}/setup.py" DESTINATION ${CMAKE_CURRENT_SOURCE_DIR}/install/) +install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/README.md" DESTINATION ${CMAKE_CURRENT_SOURCE_DIR}/install/) +install(FILES "${CMAKE_SOURCE_DIR}/OSMC-License.txt" DESTINATION ${CMAKE_CURRENT_SOURCE_DIR}/install/) diff --git a/src/pip/Makefile b/src/pip/Makefile new file mode 100644 index 000000000..8f0fcd156 --- /dev/null +++ b/src/pip/Makefile @@ -0,0 +1,13 @@ +.PHONY: pip + +pip: + @echo + @echo "# make pip" + @echo + cd install/ && python3 setup.py sdist + @echo + @echo "# All local packages:" + @ls install/dist/ -Art + @echo + @echo "# Run the following command to upload the package" + @echo "> twine upload src/pip/install/dist/$(shell ls install/dist/ -Art | tail -n 1)"