Skip to content

Commit

Permalink
update pypi action
Browse files Browse the repository at this point in the history
  • Loading branch information
kungjim committed Sep 17, 2023
1 parent deeb967 commit b002baf
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 24 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
cmake --version &&
yum install -y python3-devel python-devel
CIBW_BEFORE_BUILD: >
pip install pybind11
pip install pybind11 ninja
CIBW_ARCHS_LINUX: auto, aarch64

- uses: actions/upload-artifact@v2
Expand Down
16 changes: 1 addition & 15 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,7 @@ include_directories(include)
include_directories(/usr/local/include)
include_directories(/usr/include)

# Find and link to Python
execute_process(
COMMAND
${PYTHON_EXECUTABLE} "-c" "print('Hello, world!')"
RESULT_VARIABLE _status
OUTPUT_VARIABLE _hello_world
ERROR_QUIET
OUTPUT_STRIP_TRAILING_WHITESPACE
)
message(STATUS "RESULT_VARIABLE is: ${_status}")
message(STATUS "OUTPUT_VARIABLE is: ${_hello_world}")



include_directories(${PYTHON_INCLUDE_DIRS})
set(PYTHON ${PYTHON_EXECUTABLE})

message(STATUS "PYTHON_LIBRARIES = ${PYTHON_LIBRARIES}")
message(STATUS "PYTHON_EXECUTABLE = ${PYTHON_EXECUTABLE}")
Expand Down
14 changes: 6 additions & 8 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,6 @@ def __init__(self, name: str, sourcedir: str = "") -> None:
super().__init__(name, sources=[])
self.sourcedir = os.fspath(Path(sourcedir).resolve())

def walk_dir(val):
for root, dirs, files in os.walk(val, topdown=False):
for name in files:
print(os.path.join(root, name))
for name in dirs:
print(os.path.join(root, name))

class CMakeBuild(build_ext):
def build_extension(self, ext: CMakeExtension) -> None:
Expand All @@ -73,11 +67,15 @@ def build_extension(self, ext: CMakeExtension) -> None:
# Set Python_EXECUTABLE instead if you use PYBIND11_FINDPYTHON
# from Python.
venv_dir = os.path.abspath(sys.executable+"/../../")
walk_dir(venv_dir)
python_version = sys.version
pybind11_dir=f"{venv_dir}/lib/python{python_version}/site-packages/pybind11/share/cmake/pybind11"

CMAKE_PREFIX_PATH = os.getenv("CMAKE_PREFIX_PATH")
print(f"Python Versin: {python_version} {CMAKE_PREFIX_PATH}")
cmake_args = [
f"-DCMAKE_LIBRARY_OUTPUT_DIRECTORY={extdir}{os.sep}",
f"-DPYTHON_EXECUTABLE={sys.executable}",
f"-DCMAKE_PREFIX_PATH={venv_dir}",
f"-Dpybind11_DIR={pybind11_dir}",
f"-DCMAKE_BUILD_TYPE={cfg}", # not used on MSVC, but no harm
]
build_args = []
Expand Down

0 comments on commit b002baf

Please sign in to comment.