Skip to content

Use scikit build core#5

Open
jonaslb wants to merge 9 commits into
masterfrom
scikitbuild
Open

Use scikit build core#5
jonaslb wants to merge 9 commits into
masterfrom
scikitbuild

Conversation

@jonaslb

@jonaslb jonaslb commented Jun 9, 2026

Copy link
Copy Markdown
Owner

No description provided.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR migrates PSiesta’s build/install workflow from a legacy setup.py/distutils+Cython flow to a modern PEP 517 build using scikit-build-core + CMake, and adds smoke tests plus a Nix-based dev environment to make builds more reproducible.

Changes:

  • Replace setup.py/requirements.txt with pyproject.toml (scikit-build-core) and a new CMakeLists.txt that builds the _psiesta extension and (optionally) fetches/builds Siesta as a subproject.
  • Add a Nix flake development shell (plus lockfile) and update the README with the new build/test workflow.
  • Add pytest smoke tests (import checks + simple H/H2 runs) and include a test pseudopotential fixture.

Reviewed changes

Copilot reviewed 10 out of 14 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
CMakeLists.txt New CMake-based build that wires Cython + Fortran bindings and links against Siesta + MPI.
pyproject.toml New PEP 517 build configuration using scikit-build-core; declares runtime/dev dependencies and pytest config.
README.md Updates build + dev instructions for Nix + uv + CMake/scikit-build-core; documents smoke tests.
flake.nix Adds a Nix dev shell with MPI, compilers, CMake/Ninja, and scientific dependencies.
flake.lock Pins the Nix input revisions for the dev shell.
.gitignore Ignores wheel/build artifacts, Python cache files, uv venv/lock, and CMake build outputs.
tests/test_import.py Adds a basic import test for the compiled extension module.
tests/test_mpi_import.py Adds a basic import test under MPI/mpi4py context.
tests/test_calculations.py Adds “technical smoke” calculation tests (H atom, H2, rerun).
tests/fixtures/H.psml Adds a hydrogen PSML pseudopotential fixture used by calculation tests.
test/run.py Adds an ad-hoc performance/smoke runner script intended for manual use.
setup.py Removes the legacy distutils-based build script.
requirements.txt Removes the old requirements list (replaced by pyproject.toml).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread test/run.py
@@ -0,0 +1,48 @@
#!/usr/bin/env mpirun -n 4 python3 -m mpi4py
Comment thread test/run.py
from mpi4py import MPI
import sisl as si
from psiesta import FilePSiesta
import numpy as np
Comment thread test/run.py
Comment on lines +25 to +26
if rank == 0:
sp.run(['zstd', '-d', '-f', 'C.psf.zst'])
Comment thread test/run.py
print(f"Time taken: {t1-t0}")
if "keep" not in sys.argv:
shutil.rmtree('tenbyten')
Path('C.psf').unlink() No newline at end of file
Comment thread CMakeLists.txt
Comment on lines +15 to +16
set(PSIESTA_SIESTA_GIT_REPOSITORY "https://gitlab.com/siesta-project/siesta.git" CACHE STRING "Siesta git repository")
set(PSIESTA_SIESTA_GIT_TAG "master" CACHE STRING "Siesta git tag, branch, or commit")
Comment thread test/run.py
#!/usr/bin/env mpirun -n 4 python3 -m mpi4py
"""
A "slow" test to see if it works and also judge performance a bit.
On a AMD 1600X this file (see shebang) runs in about :
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants