Skip to content

Nexus: Package executables in with Nexus libraries#5851

Open
brockdyer03 wants to merge 12 commits intoQMCPACK:developfrom
brockdyer03:bin_packaging
Open

Nexus: Package executables in with Nexus libraries#5851
brockdyer03 wants to merge 12 commits intoQMCPACK:developfrom
brockdyer03:bin_packaging

Conversation

@brockdyer03
Copy link
Contributor

Proposed changes

This is the long-anticipated (since about 5 minutes ago when #5742 was merged) bin packaging PR. With this, users who install Nexus will now be able to use the Nexus scripts (e.g. qmca, nxs-sim, qdens, etc.) when they are in their virtual environments.

What type(s) of changes does this code introduce?

  • New feature
  • Refactoring (no functional changes, no api changes)
  • Documentation

Does this introduce a breaking change?

  • No

What systems has this change been tested on?

Laptop, Fedora 43, Python 3.14.2, Numpy 2.4.2, uv 0.9.42

Checklist

    • I have read the pull request guidance and develop docs
    • This PR is up to date with the current state of 'develop'
    • Documentation has been added (if appropriate)

@brockdyer03 brockdyer03 self-assigned this Mar 12, 2026
@brockdyer03 brockdyer03 added enhancement nexus python Pull requests that update python code labels Mar 12, 2026
Copy link
Contributor

@ye-luo ye-luo left a comment

Choose a reason for hiding this comment

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

I hesitate to relocate nexus scripts. I don't expect packaging to change source codes layout.

When using virtual environment, scripts are expected to be installed under <venv>/bin not <venv>/lib/python3.12/site-packages/nexus/bin

One option I can think of is relaxing the nexus library location check in the scripts if installed in a virtual environment by commenting out the line of find_nexus_modules() call.

@brockdyer03
Copy link
Contributor Author

When using virtual environment, scripts are expected to be installed under <venv>/bin not <venv>/lib/python3.12/site-packages/nexus/bin

The scripts are installed in <venv>/bin, but to actually make it there they need to be in the qmcpack/nexus/nexus directory. This is a hard requirement, described by the Python Packaging Authority (PyPA).

I hesitate to relocate nexus scripts. I don't expect packaging to change source codes layout.

I wouldn't worry about it at all. I've checked and double checked everything I could think of with the movement, and every change indicates that the associations between the scripts and the Nexus libraries are still solid.

I've checked many times, the only way for the scripts to be available is by moving them in with the libraries.

@ye-luo
Copy link
Contributor

ye-luo commented Mar 12, 2026

Another side effect of relocation. nexus installation via QMCPACK is broken.

@brockdyer03
Copy link
Contributor Author

Another side effect of relocation. nexus installation via QMCPACK is broken.

To be clear, it's not a side effect of relocation, but rather a bug in my PR. This just requires some code changes that I'll try to get to tonight or tomorrow.

@ye-luo
Copy link
Contributor

ye-luo commented Mar 12, 2026

Another side effect of relocation. nexus installation via QMCPACK is broken.

To be clear, it's not a side effect of relocation, but rather a bug in my PR. This just requires some code changes that I'll try to get to tonight or tomorrow.

With a bit more thinking, relocation is probably OK. However, we might need the install script to modify the search path based on how QMCPACK installs its subset of scripts and its own copy of nexus.

@brockdyer03
Copy link
Contributor Author

I know I'm a broken record regarding this topic, but I'd like to note that once again this is an extremely frustrating result of the uncommon use of PYTHONPATH modification for "installation".

Given the bin packaging is now trivial, would it really be so difficult to just require that users use the highly convenient package installation method for using the scripts?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement nexus python Pull requests that update python code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants