-
Couldn't load subscription status.
- Fork 3
Python packaging for PyNEST-NG #33
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
base: pynest-ng
Are you sure you want to change the base?
Conversation
…n run_examples.sh
…rsion to 3.8.post0.dev4
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @steffengraber! Thanks for this PR and apologies for taking weeks before looking at it. I have tried the pip install and that worked very nicely on my macOS 15.5 (arm64) system. I could also run all non-MPI tests with
pytest --ignore=$PyTestDir/mpi --ignore=$PyTestDir/sli2py_mpi $PyTestDir
where PyTestDir points to .../testsuite/pytests under the site_packages/nest directory.
Building with MPI did not quite work. NEST built, but the CMake output did not even show a search for OpenMPI and NEST then built nicely without MPI. One problem I had was that my zsh shell did not like the line
python3 -m pip install -v --force-reinstall --check-build-dependencies --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/ --config-settings=cmake.define.with-mpi="ON" --no-binary pynest-ng pynest-ng[mpi]
I had to put the final pynest-ng[mpi] in quotes to make this run. Could that have caused the problem?
What are the SKBUILD switches in the CMake files about? Probably a dumb question ...
You also mentioned that some secrets needed adjustment before merging. Do you mean merging this branch into my branch or the eventual merge into NEST master?
| "Bug Tracker" = "https://github.com/nest/nest-simulator/issues" | ||
| Changelog = "https://nest-simulator.readthedocs.io/en/stable/whats_new/index.html" | ||
|
|
||
| [tool.scikit-build] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why "scikit"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I use a program called "Scikit-build-core" to help me package pynest-ng. "It provides a bridge between CMake and the Python build system, allowing you to make Python modules with CMake." https://scikit-build-core.readthedocs.io/en/latest/
The scikit tag here marks some definitions for the build process.
| ] | ||
| dependencies = [ | ||
| "numpy", | ||
| "pynest-api", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe add pytest, so one can easily run the testsuite after installation?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pytest has been added as a dependency.
pyproject.toml
Outdated
| NEST_SRC_DIR=${PWD} | ||
| if [ $AUDITWHEEL_POLICY == "musllinux_1_2" ] | ||
| then | ||
| apk add git readline readline-dev libc6-compat gsl gsl-dev ncurses ncurses-dev wget bzip2 hdf5 cmake |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For PyNEST-NG, we should no longer need readline and readline-dev.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 Readline has been removed.
Maybe a Mac thing?
For Phyton packaging, some installation paths need to be adjusted. The SKBUILB switch recognizes that a build is being performed with Scikit-build-core and the corresponding changes can be made.
Both. In order for CI to perform the upload to testpypi or later to pypi, a token must be set as an environment variable. |
|
Pull request automatically marked stale! |
Key changes:
Python packaging
CI Workflow
CMake Files
Before merging, the project name and deployment secrets need to be adjusted.
The Python package may be tested in a Docker container:
docker run -it --rm --name test ubuntu:24.04 bashInstall Dependencies and Create an Python venv
Intalll from https://test.pypi.org/project/pynest-ng/
python3 -m pip --no-cache-dir install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/ pynest-ng python3 -c "import nest; nest.help()"Rebuild with MPI
Install and Build from GitHub Repository
python3 -m pip install -v --force-reinstall git+https://{GITHUB_TOKEN}@github.com/steffengraber/nest-simulator.git@hep_pynest-ng python3 -c "import nest; nest.help()"