Repository navigation
Closed
Description
PyPI/GitHub rc-release preparation checklist:
- All PRs/issues attached to the release are merged.
- All the badges on the README are passing.
- License information is verified as correct. If you are unsure, please comment below.
- Locally rendered documentation contains all appropriate pages, tutorials, and other human-written text is up-to-date with any changes in the code.
- All API references are included. To check this, run
conda install scikit-packageand thenpackage build api-doc. Review any edits made by rerendering the docs locally. - Installation instructions in the README, documentation, and the website are updated.
- Successfully run any tutorial examples or do functional testing with the latest Python version.
- Grammar and writing quality are checked (no typos).
- Install
pip install build twine, runpython -m buildandtwine check dist/*to ensure that the package can be built and is correctly formatted for PyPI release. - Dispatch matrix testing to test the release on all Python versions and systems. If you do not have permission to run this workflow, tag the maintainer and say
@maintainer, please dispatch matrix testing workflow.
Please tag the maintainer (e.g., @username) in the comment here when you are ready for the PyPI/GitHub release. Include any additional comments necessary, such as version information and details about the pre-release here:
PyPI/GitHub full-release preparation checklist:
- Create a new conda environment and install the rc from PyPI (
pip install <package-name>==??) - License information on PyPI is correct.
- Docs are deployed successfully to
https://<github-username-or-orgname>/<package-name>. - Successfully run all tests, tutorial examples or do functional testing.
Please let the maintainer know that all checks are done and the package is ready for full release.
conda-forge release preparation checklist:
- Ensure that the full release has appeared on PyPI successfully.
- New package dependencies listed in
conda.txtandtests.txtare added tometa.yamlin the feedstock. - Close any open issues on the feedstock. Reach out to the maintainer if you have questions.
- Tag the maintainer for conda-forge release.
Post-release checklist
- Run tutorial examples and conduct functional testing using the installation guide in the README. Attach screenshots/results as comments.
- Documentation (README, tutorials, API references, and websites) is deployed without broken links or missing figures.
Metadata
Metadata
Assignees
Labels
No labels
Activity
cadenmyers13 commentedon Nov 2, 2026
Hi @vincefn ! Our new package diffpy.cmirietveld depends on
pyobjcryst's features that have not been released yet. We would like to push out a release. Are there any features/updates you would like to add to the release? Also, let me know if I've handled the version syntax correctly. Maybe it should be2026.2.0.vincefn commentedon Nov 2, 2026
Maybe have a look at #101 - if you can validate the nanobind version at the same time, it would be great (then it should be 2026.2.0 indeed). Maybe you can test this cmirietveld with that branch.
sbillinge commentedon Nov 3, 2026
Let's push out a
2026.2.0-rc0and test everything. @vincefn is the nanobind work that needs to better all merged into main?[-]Ready for 2026.1.1 PyPI/GitHub release[/-][+]Ready for 2026.2.0 PyPI/GitHub release[/+]cadenmyers13 commentedon Nov 3, 2026
@SYMSCAE Are you able to help with this?
sbillinge commentedon Nov 15, 2026
@vincefn @cadenmyers13 @clemisch the CI build failed on the
2026.2.0-rc.0macos-15-intelbuild. I think we will drop this shortly as they will stop having this runner, but it serves our users with legacy macs until it goes away. We could either try and figure this out, or drop it from the current build. I don't mind either way tbh. The legacy users will have access to everything up to2026.1.0which has a python 3.14 build, so it will be around for ages to come. What are your thoughts?sbillinge commentedon Nov 15, 2026
btw, for the record, it
2026.2.0-rc.0built successfully onlinux,windowsandmacos-latestvincefn commentedon Nov 16, 2026
Strange failure, nothing specific to the arch. I don't understand how the mismatch
ReflectionProfilePseudoVoigtAnisotropicReflectionProfilePseudoVoigtcan actually happen given the code...Though indeed macos intel is effectively obsolete.. I'll re-run the job 🤞
vincefn commentedon Nov 16, 2026
Ah, when re-running, the macos/intel build+test passes, but the wheel test fails for ubuntu/py3.15 and macos/3.13 and 3.15, for the same test.
So I guess we'll have to figure this one out...
vincefn commentedon Nov 16, 2026
Ok, this seems to be real and needs to be corrected - here is claude's analysis:
Failure in the
2026.2.0-rc.0build runThe failed jobs all fail on the same test, and it fails only intermittently:
cibw-wheels-macos-15-intelbuild (attempt 1, py3.14); the rerun passedtest-wheels-3.15-ubuntu-latest,test-wheels-3.15-macos-15-intel,test-wheels-3.13-macos-15-intelRoot cause: nanobind reuses a stale wrapper after C++ frees the object
setUpholdsself.profile = self.ppd.GetProfile(), a wrapper for the phase's defaultReflectionProfilePseudoVoigt.ppd.SetProfile(template)→ ObjCrystPowderPatternDiffraction::SetProfilerunsdelete mpReflectionProfile.self.profilenow dangles, but nanobind still has it registered in its instance map under that address.second.SetProfile(template)→ the new copy may be allocated at the freed address.second.GetProfile()→ nanobind 3.1.0nb_type_putfinds an existing instance at that address. Its type is a subclass of the requested static type (ReflectionProfile), so nanobind returns the stalePseudoVoigtwrapper.Whether the address gets reused depends on heap state, so the result varies between runs and between Python/arch combinations. Boost.Python created a new wrapper on each call, so it did not have this aliasing. The dangling pointer itself was already there.
Reproduced locally with the rc0 wheels (arm64 and x86_64)
GetProfile()/SetProfile()loop while keeping the old wrappers: a stale wrapper was returned 1990/2000 times. Same type, so there is no error, but the result is silently wrong and uses freed memory.This is a general problem: C++ deletes an object that Python still references
Remove*bindings avoid it by passingdel=false, which leaks the object but never frees it:RemoveScatterer/RemoveScatteringPower(nb_crystal.cpp),Molecule.RemoveAtom/Bond/BondAngle/DihedralAngle(nb_molecule.cpp).PowderPatternDiffraction.SetProfile(always deletes)SetReflectionProfilePar(callsSetProfile)(wrong: those deletions are inMolecule::XMLInput(deletes all atoms/bonds/angles)~Molecule; see C++ deletes objects still referenced by Python wrappers (dangling pointers, double free) #132)XMLInputpaths still need to be auditedFix direction (in the bindings, not per-method upstream patches)
del=false), or, if a wrapper exists (nb::find), transfer ownership to that wrapper. Single-call alternative: an ObjCrystSetProfile(p, del)or a "release" API.sbillinge commentedon Nov 16, 2026
Thanks @vincefn. I guess this may affect other variables too, so let's do a careful inventory, along the lines that Claude suggests. @SYMSCAE or @clemisch are you able to look at this?
vincefn commentedon Nov 16, 2026
Yes, this is the tip of the iceberg for the lack of proper joint c++/python ownership management. Something already present in boost, but different wrapper management just hid this with some minor leaks.
A completely proper fix would use a common c++/python reference counting and associated gc.
SYMSCAE commentedon Nov 16, 2026
It seems the more optimal way is to modify
objcrystand passshared_ptracross the language boundary. Or we can simply pass a independent copy forGetProfileinstead? That will change behaviour though.vincefn commentedon Nov 16, 2026
I'm working on modifying objcryst and fixing this. 4 hour train in China..
Seems completely tackling this with proper reference counting would be a little more tricky, so this will have to be done later.
fix: keep Python wrappers valid when ObjCryst++ releases sub-objects