Skip to content

Commit

Permalink
Recover changes to build PyPI package (#1371)
Browse files Browse the repository at this point in the history
  • Loading branch information
lochel authored Nov 21, 2024
1 parent fa72030 commit 46fa40f
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 18 deletions.
6 changes: 1 addition & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
16 changes: 3 additions & 13 deletions src/pip/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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/)
13 changes: 13 additions & 0 deletions src/pip/Makefile
Original file line number Diff line number Diff line change
@@ -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)"

0 comments on commit 46fa40f

Please sign in to comment.