Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move Python bindings to own dir #1179

Merged
merged 7 commits into from
Mar 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions packaging/test_wheel.bash
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,14 @@ test_wheel () {
# sample mod file for nrnivmodl check
TEST_DIR="$(mktemp -d)"
OUTPUT_DIR="$(mktemp -d)"
cp "${this_dir}/../nmodl/ext/example/"*.mod "$TEST_DIR/"
cp "${this_dir}/../python/nmodl/ext/example/"*.mod "$TEST_DIR/"
cp "${this_dir}/../test/integration/mod/cabpump.mod" "${this_dir}/../test/integration/mod/var_init.inc" "$TEST_DIR/"
cd "${this_dir}"
for mod in "${TEST_DIR}/"*.mod
do
nmodl -o "${OUTPUT_DIR}" "${mod}" sympy --analytic
$python_exe -c "import nmodl; driver = nmodl.NmodlDriver(); driver.parse_file('${mod}')"
done
$python_exe -m pytest -vvv "${this_dir}/../test/"
cd -
}

echo "== Testing $python_wheel using $python_exe ($python_ver) =="
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ build-backend = "scikit_build_core.build"

[tool.scikit-build]
metadata.version.provider = "scikit_build_core.metadata.setuptools_scm"
wheel.packages = ["nmodl"]
wheel.packages = ["python/nmodl"]
logging.level = "DEBUG"

[tool.scikit-build.cmake]
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion src/language/code_generator.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ set(CODE_GENERATOR_JINJA_FILES
set(CODE_GENERATOR_PY_FILES
${PROJECT_SOURCE_DIR}/src/language/argument.py
${PROJECT_SOURCE_DIR}/src/language/code_generator.py
${PROJECT_SOURCE_DIR}/src/language/language_parser.py
${PROJECT_SOURCE_DIR}/src/language/node_info.py
${PROJECT_SOURCE_DIR}/src/language/nodes.py
${PROJECT_SOURCE_DIR}/src/language/language_parser.py
${PROJECT_SOURCE_DIR}/src/language/utils.py
)

Expand Down
8 changes: 4 additions & 4 deletions src/pybind/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -70,14 +70,14 @@ endif()
# =============================================================================
file(
GLOB NMODL_PYTHON_FILES
RELATIVE "${NMODL_PROJECT_SOURCE_DIR}/nmodl/"
CONFIGURE_DEPENDS "${NMODL_PROJECT_SOURCE_DIR}/nmodl/*.py")
RELATIVE "${NMODL_PROJECT_SOURCE_DIR}/python/nmodl/"
CONFIGURE_DEPENDS "${NMODL_PROJECT_SOURCE_DIR}/python/nmodl/*.py")

foreach(file IN LISTS NMODL_PYTHON_FILES)
cpp_cc_build_time_copy(INPUT ${NMODL_PROJECT_SOURCE_DIR}/nmodl/${file} OUTPUT
cpp_cc_build_time_copy(INPUT ${NMODL_PROJECT_SOURCE_DIR}/python/nmodl/${file} OUTPUT
${CMAKE_BINARY_DIR}/lib/nmodl/${file})
endforeach()
file(COPY ${NMODL_PROJECT_SOURCE_DIR}/nmodl/ext DESTINATION ${CMAKE_BINARY_DIR}/lib/nmodl/)
file(COPY ${NMODL_PROJECT_SOURCE_DIR}/python/nmodl/ext DESTINATION ${CMAKE_BINARY_DIR}/lib/nmodl/)

# =============================================================================
# Install python binding components
Expand Down
Loading