Skip to content

Commit

Permalink
update project deployement
Browse files Browse the repository at this point in the history
rm clic static from wheel
clean sdist
add pre-commit and flake8 lining
  • Loading branch information
StRigaud authored Sep 7, 2023
2 parents f8b4f0e + 2ec7a35 commit 6a24947
Show file tree
Hide file tree
Showing 19 changed files with 50 additions and 622 deletions.
46 changes: 0 additions & 46 deletions .github/workflows/conda.yml

This file was deleted.

40 changes: 16 additions & 24 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# Set minimum version of CMake.
cmake_minimum_required(VERSION 3.20)

# Set project name and version
project(
${SKBUILD_PROJECT_NAME}
VERSION ${SKBUILD_PROJECT_VERSION}
Expand All @@ -10,40 +8,37 @@ project(
string(TOLOWER ${PROJECT_NAME} PY_PACKAGE_NAME)
set(CY_PACKAGE_NAME _${PY_PACKAGE_NAME})

set(CLIC_REPO_TAG 0.7.1) # use master or branch name for dev
set(CLIC_REPO_URL https://github.com/clEsperanto/CLIc_prototype.git)


# Set flags for build
## flags and options
set(CMAKE_BUILD_TYPE Release)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_LIBCPP_DISABLE_AVAILABILITY")
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") # library linking for UNIX
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC")
endif()
set(CMAKE_SKIP_INSTALL_ALL_DEPENDENCY TRUE)
option(BUILD_TESTING OFF)
option(BUILD_BENCHMARK OFF)
option(BUILD_SHARED_LIBS OFF)


## CLIc dependency
set(CLIC_REPO_TAG 0.7.1) # branch name for dev
set(CLIC_REPO_URL https://github.com/clEsperanto/CLIc_prototype.git)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/src/clic EXCLUDE_FROM_ALL)


# look for python in virtual env or conda first before checking the system.
## look for python
set(Python_FIND_VIRTUALENV "FIRST")
find_package(Python COMPONENTS Interpreter Development.Module REQUIRED)

## fetch CLIc from repo release
include(FetchContent)
option(BUILD_TESTING OFF)
option(BUILD_BENCHMARK OFF)
option(BUILD_SHARED_LIBS OFF)
FetchContent_Declare(
CLIc
GIT_REPOSITORY ${CLIC_REPO_URL}
GIT_TAG ${CLIC_REPO_TAG}
)
FetchContent_MakeAvailable(CLIc)

## list of files to compile and folder to include
set(PACKAGE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/${PY_PACKAGE_NAME})
set(WRAPPER_DIR ${CMAKE_CURRENT_SOURCE_DIR}/wrapper)
set(WRAPPER_DIR ${CMAKE_CURRENT_SOURCE_DIR}/src/wrapper)
file(GLOB_RECURSE WRAPPER_SOURCES_FILES ${WRAPPER_DIR}/*.cpp)


## build the python package
if(SKBUILD)
# Scikit-Build does not add your site-packages to the search path
# automatically, so we need to add it _or_ the pybind11 specific directory
Expand All @@ -53,12 +48,10 @@ if(SKBUILD)
OUTPUT_VARIABLE _tmp_dir
OUTPUT_STRIP_TRAILING_WHITESPACE COMMAND_ECHO STDOUT)
list(APPEND CMAKE_PREFIX_PATH "${_tmp_dir}")

find_package(pybind11 CONFIG REQUIRED)
python_add_library(${CY_PACKAGE_NAME} MODULE ${WRAPPER_SOURCES_FILES} WITH_SOABI)

target_link_libraries(${CY_PACKAGE_NAME} PRIVATE CLIc::CLIc pybind11::headers)
add_dependencies(${CY_PACKAGE_NAME} CLIc)
target_include_directories(${CY_PACKAGE_NAME} PUBLIC "$<BUILD_INTERFACE:${WRAPPER_DIR}>")
target_compile_definitions(${CY_PACKAGE_NAME} PRIVATE VERSION_INFO=${PROJECT_VERSION})

Expand All @@ -73,7 +66,6 @@ if(SKBUILD)
else()
set(CY_PACKAGE_RPATH "$ORIGIN;$ORIGIN/${CMAKE_INSTALL_LIBDIR};$ORIGIN/${CMAKE_INSTALL_BINDIR}")
endif()

set_target_properties(${CY_PACKAGE_NAME} PROPERTIES
INSTALL_RPATH "${CY_PACKAGE_RPATH}"
BUILD_WITH_INSTALL_RPATH TRUE
Expand Down
79 changes: 0 additions & 79 deletions MANIFEST.in

This file was deleted.

63 changes: 0 additions & 63 deletions conda.recipe/meta.yaml

This file was deleted.

Loading

0 comments on commit 6a24947

Please sign in to comment.