Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What Changed
Restructure the directory. Moved
quafu
to the root directory fromsrc
.Why this change
The
skbuild
package has some bugs in enabling development mode. See scikit-build/scikit-build#1025. A workaround is to usepython setup.py develop
.However, previously python modules and C++ source codes are all located under
src
directory.And thus in previous
setup.py
, we specified thepackage_dir
field as{'': 'src'}
.When using
python setup.py develop
it find theegg_base
based on distribution'spackage_dir
member (code pointer), normally{'': 'src'}
will take effect and the egg_path will be set tosrc
.Unfortunately,
skbuild
has some other bugs, it overrides the distributionspackage_dir
and{'': 'src'}
is shown to be missing, causing the failure of setting the correctegg_path
and always set theegg_path
as.
.As a result, I think currently the best practice in developing python/c++ hybrid projects is to put python modules in the root directory and put c++ source code in the
src
directory.I just checked that
qiskit-aer
follows the same practice.Testing
All these methods of installing pyquafu works fine