pybedtools icon indicating copy to clipboard operation
pybedtools copied to clipboard

Support python 3.13/cython 3

Open theAeon opened this issue 9 months ago • 4 comments

Apparently it Just Works with Cython 3 if you move the distutils stuff over to setuptools. Who'dve thought. (can't verify all tests right now but passed most of them and then ran out of space).

reference issue #422

theAeon avatar Mar 07 '25 23:03 theAeon

Thank you for this!

(I can't quite work out how to permanently enable running tests for this PR so I have to keep manually enabling...)

daler avatar Mar 11 '25 19:03 daler

No worries!

theAeon avatar Mar 11 '25 20:03 theAeon

currently replicating CI locally as I was not getting import errors (or i wouldn't have submitted the pr)

theAeon avatar Mar 11 '25 20:03 theAeon

Well, that's bizarre. Runs fine when invoking pytest.main from the interpreter and explodes when run from the command line.

theAeon avatar Mar 11 '25 21:03 theAeon

@daler made a few adjustments if you would give it an approval :)

theAeon avatar Mar 14 '25 16:03 theAeon

seems genomepy doesn't actually support 3.13 yet-dunno if that's a blocker

theAeon avatar Mar 14 '25 16:03 theAeon

easy fix tbh https://github.com/simonvh/norns/pull/10

theAeon avatar Mar 14 '25 17:03 theAeon

so it turns out that the directory was a red herring for cython having trouble locating the naked cpdef in cbedtools-so i just added it to init.py and called it a day. should(?) work now

theAeon avatar Mar 14 '25 20:03 theAeon

oh for God's sake I literally excluded that file

theAeon avatar Mar 14 '25 21:03 theAeon

once more

theAeon avatar Mar 14 '25 22:03 theAeon

Fantastic! Thanks for working out all the details. I don't have the bandwidth that I used to, so this is super helpful.

At some point I'll need to do a more careful review of those .pxd files (i.e., prob don't need language level 2 any more) but at least this builds on 3.13. Will cut a release shortly.

daler avatar Mar 14 '25 23:03 daler

Uh oh...upon uploading to TestPyPI, I'm unable to install locally on macOS or Linux with the following:

conda create -y -p ./env "python>=3.13"
conda activate ./env
python3 -m pip install \
  --index-url https://test.pypi.org/simple/ \
  --extra-index-url https://pypi.org/simple/ pybedtools==0.12

I haven't quite figured out why it passed here though.

daler avatar Mar 15 '25 01:03 daler

pulling it down from test.pypi on my end shows cpp files generated by 0.29, which would do that. Just delete the cpp files from the sdist, modern setuptools is smart enough to handle it.

theAeon avatar Mar 15 '25 04:03 theAeon

Ugh, looks like I hadn't run the clean part of setup.py. All fixed; v0.12 is now in PyPI and bioconda. Thanks again for this.

daler avatar Mar 17 '25 12:03 daler