Skip to content

Commit 46fa40f

Browse files
authored
Recover changes to build PyPI package (#1371)
1 parent fa72030 commit 46fa40f

File tree

3 files changed

+17
-18
lines changed

3 files changed

+17
-18
lines changed

CMakeLists.txt

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -68,11 +68,7 @@ add_subdirectory(src/OMSimulator)
6868
add_subdirectory(src/OMSimulatorLua)
6969
add_subdirectory(src/OMSimulatorPython)
7070
add_subdirectory(src/OMSimulatorServer)
71-
72-
option(OM_OMS_ENABLE_PIP "create the OMSimulator pip package" OFF)
73-
if(OM_OMS_ENABLE_PIP)
74-
add_subdirectory(src/pip)
75-
endif()
71+
add_subdirectory(src/pip)
7672

7773
add_subdirectory(doc)
7874

src/pip/CMakeLists.txt

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,7 @@
11
project(pip)
22

3-
set(CMAKE_INSTALL_BINDIR ${CMAKE_INSTALL_BINDIR}/pip)
4-
# set(CMAKE_INSTALL_DATADIR ${CMAKE_INSTALL_DATADIR}/pip)
5-
6-
IF (OMS_VERSION_STRING MATCHES "^(.*)\\.post(.*)-g(.*)$")
7-
set(OMS_BUILD_TYPE "nightly")
8-
ELSE()
9-
set(OMS_BUILD_TYPE "stable")
10-
ENDIF()
11-
123
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/setup.py" "${CMAKE_CURRENT_BINARY_DIR}/setup.py" @ONLY)
134

14-
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/setup.py"
15-
TYPE BIN)
16-
install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/README.md" "${CMAKE_SOURCE_DIR}/OSMC-License.txt"
17-
TYPE BIN)
5+
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/setup.py" DESTINATION ${CMAKE_CURRENT_SOURCE_DIR}/install/)
6+
install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/README.md" DESTINATION ${CMAKE_CURRENT_SOURCE_DIR}/install/)
7+
install(FILES "${CMAKE_SOURCE_DIR}/OSMC-License.txt" DESTINATION ${CMAKE_CURRENT_SOURCE_DIR}/install/)

src/pip/Makefile

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
.PHONY: pip
2+
3+
pip:
4+
@echo
5+
@echo "# make pip"
6+
@echo
7+
cd install/ && python3 setup.py sdist
8+
@echo
9+
@echo "# All local packages:"
10+
@ls install/dist/ -Art
11+
@echo
12+
@echo "# Run the following command to upload the package"
13+
@echo "> twine upload src/pip/install/dist/$(shell ls install/dist/ -Art | tail -n 1)"

0 commit comments

Comments
 (0)