-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move string logic to Python instead of C API
- Loading branch information
Showing
17 changed files
with
478 additions
and
204 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#!/bin/bash | ||
|
||
|
||
SCR=$(cat << EOF | ||
import re | ||
import subprocess | ||
repo = subprocess.check_output("git rev-parse --show-toplevel", shell=True).decode('utf8').strip() | ||
with open(f"{repo}/README.md", "r") as f: | ||
md = f.read() | ||
with open(f"{repo}/setup.py", "r") as f: | ||
content = f.read() | ||
with open(f"{repo}/setup.py", "w") as f: | ||
f.write(re.sub(r"long_description=.*? url", 'long_description="""' + md + '""",\n url', content, flags=re.DOTALL)) | ||
subprocess.check_output(f"git add {repo}/setup.py", shell=True) | ||
EOF | ||
) | ||
|
||
python3 -c "$SCR" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,12 @@ | ||
cmake_minimum_required(VERSION 3.11.0) | ||
project(elkai) | ||
|
||
# set(CMAKE_POSITION_INDEPENDENT_CODE ON) | ||
|
||
find_package(PythonExtensions REQUIRED) | ||
|
||
include_directories(${CMAKE_SOURCE_DIR}/LKH-3.0.8/SRC/INCLUDE) | ||
file(GLOB LKH_SRC "LKH-3.0.8/SRC/*.c") | ||
|
||
# add_library(LKH ${LKH_SRC}) | ||
# target_compile_definitions(LKH PRIVATE TWO_LEVEL_TREE) | ||
# target_compile_options(LKH PRIVATE -flto -fcommon) | ||
|
||
add_library(_elkai MODULE elkai/_elkai.c ${LKH_SRC}) | ||
python_extension_module(_elkai) | ||
# target_link_libraries(_elkai LKH) | ||
|
||
install(TARGETS _elkai LIBRARY DESTINATION elkai) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.