Skip to content

Commit

Permalink
Reduce proliferation of requirements and remove temp files (neuronsim…
Browse files Browse the repository at this point in the history
  • Loading branch information
JCGoran authored Nov 14, 2024
1 parent b72f8b3 commit f323bc8
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 14 deletions.
7 changes: 2 additions & 5 deletions nrn_requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,7 @@ setuptools<=70.3.0
scikit-build
matplotlib
ipython
cython
packaging
pytest<=8.1.1 # potential bug from 8.2.0 due to parallelism?
pytest-cov
mpi4py<4 # MUSIC not compatible with MPI 4
numpy
find_libpython
-r packaging/python/build_requirements.txt
-r packaging/python/test_requirements.txt
18 changes: 11 additions & 7 deletions packaging/python/build_wheels.bash
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,15 @@ fi

py_ver=""

# path to the (temp) requirements file containing all of the build dependencies
# for NEURON and its submodules
python_requirements_path="$(mktemp -d)/requirements.txt"

clone_nmodl_and_add_requirements() {
git config --global --add safe.directory /root/nrn
git submodule update --init --recursive --force --depth 1 -- external/nmodl
# We only want the _build_ dependencies
sed -e '/^# runtime dependencies/,$ d' external/nmodl/requirements.txt >> my_requirements.txt
sed -e '/^# runtime dependencies/,$ d' external/nmodl/requirements.txt >> "${python_requirements_path}"
}


Expand Down Expand Up @@ -61,7 +65,7 @@ build_wheel_linux() {

echo " - Installing build requirements"
pip install auditwheel
cp packaging/python/build_requirements.txt my_requirements.txt
cp packaging/python/build_requirements.txt "${python_requirements_path}"

CMAKE_DEFS="NRN_MPI_DYNAMIC=$3"
if [ "$USE_STATIC_READLINE" == "1" ]; then
Expand All @@ -74,8 +78,8 @@ build_wheel_linux() {
CMAKE_DEFS="${CMAKE_DEFS},LINK_AGAINST_PYTHON=OFF,CORENRN_ENABLE_OPENMP=ON"
fi

cat my_requirements.txt
pip install -r my_requirements.txt
cat "${python_requirements_path}"
pip install -r "${python_requirements_path}"
pip check

echo " - Building..."
Expand Down Expand Up @@ -116,7 +120,7 @@ build_wheel_osx() {
(( $skip )) && return 0

echo " - Installing build requirements"
cp packaging/python/build_requirements.txt my_requirements.txt
cp packaging/python/build_requirements.txt "${python_requirements_path}"

CMAKE_DEFS="NRN_MPI_DYNAMIC=$3"
if [ "$USE_STATIC_READLINE" == "1" ]; then
Expand All @@ -129,8 +133,8 @@ build_wheel_osx() {
CMAKE_DEFS="${CMAKE_DEFS},LINK_AGAINST_PYTHON=OFF"
fi

cat my_requirements.txt
pip install -U delocate -r my_requirements.txt
cat "${python_requirements_path}"
pip install -U delocate -r "${python_requirements_path}"
pip check

echo " - Building..."
Expand Down
7 changes: 5 additions & 2 deletions packaging/python/test_requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
pytest
setuptools;python_version>='3.12' # From 3.12, no longer installed by default
pytest<=8.1.1 # potential bug from 8.2.0 due to parallelism?
# for coverage
pytest-cov
# for RXD test
plotly

0 comments on commit f323bc8

Please sign in to comment.