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
Move dxtbx to src/ layout #382
Conversation
An embedded layout is a requirement for moving dxtbx towards being a relatively normal package. src/ layout provides isolation against namespace contamination with the other folders in the package root. - Updated SConscript to retain identical build behaviour and provide include paths to the new location - Created setup.py to (editable or otherwise) install the dxtbx library into an existing environment. It generates the list of console_scripts entry points and Format registry entry points automatically - Modified libtbx_refresh.py to editable-install the dxtbx package when configured as part of a libtbx environment
This will need some rigorous testing. One to discuss next Thursday, I assume.
No, libtbx is fine as it is. The By transforming dxtbx into a standard python module you implicitly removed the So how can you fix this? It should be relatively easy. Tell libtbx to generate an additional outer dispatcher for the inner dispatcher. Set entry points While you're there - could you please also add an entry point |
I suspect most of these errors now are due to #383 |
Codecov Report
@@ Coverage Diff @@
## main #382 +/- ##
===========================================
+ Coverage 49.58% 64.18% +14.60%
===========================================
Files 235 175 -60
Lines 19489 15043 -4446
Branches 2761 2051 -710
===========================================
- Hits 9663 9656 -7
+ Misses 9286 4846 -4440
- Partials 540 541 +1 |
Co-authored-by: Markus Gerstel <2102431+Anthchirp@users.noreply.github.com>
So, I've put it back in, but only if it is already installed (or it can't tell). I think that's possibly cleaner than continuing to install it into new environments. |
CCTBX bootstrap for Running libtbx.refresh with the new changes (normal dials bootstrap) seem to run into:
|
More effort than what I'd have put in for something that will be removed anyway 🤷 The error is not that surprising - for some reason you explicitly tell libtbx to generate dispatchers for the To be honest, I would suggest completely eliminating the |
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.
Haven't tested the upgrade paths, but bootstrapping looks good to me
I'm just trying on a very old distribution on my old mac. It's rather slow to rebuild everything though... |
This worked fine. It did need three
I think this comes from the limitation that a packages dispatchers are handled before we can fiddle with entry_points in |
Okay, so the plan was to merge this, and patch the new dxtbx include path into the dials include path temporarily. Except that won't work because xfel recalculates the dials path: https://github.com/cctbx/cctbx_project/blob/8a572444f4c6e6787c6fd4af2fa1569adc331d9b/xfel/SConscript#L7-L8. So I'm going to leave this here until cctbx-base 2021.6 is release, which should hopefully be around beginning of... july |
An embedded layout (e.g. at least in a subfolder to the root) is a requirement for moving dxtbx towards being a relatively normal installable package.
src/
layout provides isolation against namespace contamination with the other folders in the package root - both for headers, andPYTHONPATH
purposes.setup.py
somewhat plain, and moved the dynamic logic into abuild.py
fileA possible... complication, is that it appears that the general "generate console_scripts entrypoints as libtbx dispatchers" behaviour appears to be somewhat related to calling
libtbx.pkg_utils.define_entry_points
. At least, the dispatchers for things likebin/pytest
have disappeared on my environments. Not sure how to work around that?