Skip to content
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

[Feature request] Python 3.12 support #1849

Closed
bkmartinjr opened this issue Nov 2, 2023 · 17 comments
Closed

[Feature request] Python 3.12 support #1849

bkmartinjr opened this issue Nov 2, 2023 · 17 comments
Assignees

Comments

@bkmartinjr
Copy link
Member

Add support for Python 3.12 (release Oct 2023).

@bkmartinjr
Copy link
Member Author

while we are at it, it would be good to remove 3.8 support. Lots of our upstream packages have already done so (e.g. numba, pandas, etc)

@johnkerl
Copy link
Member

johnkerl commented Feb 5, 2024

Status as of 2024-02-05: numba 0.58 is not yet ready for Python 3.12.

$ docker run --rm -it --entrypoint=/bin/bash python:3.12-bookworm
root@20d715ac5ab7:/# pip install numba==0.58
Collecting numba==0.58
  Downloading numba-0.58.0.tar.gz (2.6 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 2.6/2.6 MB 32.5 MB/s eta 0:00:00
  Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [8 lines of output]
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "/tmp/pip-install-417bk_qg/numba_1954fc6d020f4c6087042050c24f72c3/setup.py", line 51, in <module>
          _guard_py_ver()
        File "/tmp/pip-install-417bk_qg/numba_1954fc6d020f4c6087042050c24f72c3/setup.py", line 48, in _guard_py_ver
          raise RuntimeError(msg.format(cur_py, min_py, max_py))
      RuntimeError: Cannot install on Python version 3.12.1; only versions >=3.8,<3.12 are supported.
      [end of output]
$ docker run --rm -it --entrypoint=/bin/bash python:3.11-bookworm
root@d8f7153f52c6:/# pip install numba==0.58
Collecting numba==0.58
  Obtaining dependency information for numba==0.58 from https://files.pythonhosted.org/packages/f7/b6/8800604a3380aa94af830c30839db93077c7fe2812a48ce7d4400d75ba9c/numba-0.58.0-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl.metadata
...
Installing collected packages: numpy, llvmlite, numba
Successfully installed llvmlite-0.41.1 numba-0.58.0 numpy-1.25.2

@bkmartinjr
Copy link
Member Author

Numba 0.59, with Python 3.12 support has shipped. Pandas, Scipy and others also have support for it. Worth getting on a sprint plan IMHO

@johnkerl
Copy link
Member

johnkerl commented Feb 13, 2024

@bkmartinjr let me re-try now what failed for me earlier as shown above ...

@johnkerl
Copy link
Member

@bkmartinjr this succeeds for me! :)

ubuntu@anzo[prod][][~]$ docker run --rm -it --entrypoint=/bin/bash python:3.12-bookworm
root@62dc2a187e2d:/# pip install numba==0.59
...

I'll re-try my #2108 probe ...

@johnkerl
Copy link
Member

Work items detailed on #2140; more info coming here momentarily

@johnkerl
Copy link
Member

johnkerl commented Feb 14, 2024

Problem:

To do:

See also: #1938

It seems that maybe:

@johnkerl
Copy link
Member

johnkerl commented Feb 14, 2024

while we are at it, it would be good to remove 3.8 support. Lots of our upstream packages have already done so (e.g. numba, pandas, etc)

@bkmartinjr I will file a separate tracking task (#2141) -- bringing up the leading edge and deprecating the trailing edge (for all stakeholders involved) are two very different problems

@johnkerl
Copy link
Member

Please also see TileDB-Inc/TileDB-Py#1865

[sc-37726]

@bkmartinjr
Copy link
Member Author

@johnkerl - FYI, I believe tiledb-py is now supported on Python 3.12 (in reference to TileDB-Inc/TileDB-Py#1865).

@johnkerl
Copy link
Member

johnkerl commented May 7, 2024

@bkmartinjr thanks! On the discussion list for the next sprint ✌️

@johnkerl
Copy link
Member

Pending TileDB-Inc/TileDB-Py#1865

@johnkerl
Copy link
Member

johnkerl commented Aug 2, 2024

Huge progress: TileDB-Inc/TileDB#5223 is near completion in core. This should go into a core 2.26, which we'd include in a tiledbsoma 1.14.

@johnkerl
Copy link
Member

Current unsolved challenges:

  • Latest Python 3.12 is 3.12.5
    • As debug I tried Python 3.12.3 which worked as debug, but isn't a good option for shipping
  • TileDB-SOMA's current typeguard version is 4.2.0
  • Python 3.12.4 added a new required argument to evaluate_forward_ref within Python's built-in typing module which broke many packages including typeguard
  • As a result, our TileDB-SOMA CI for PR 3001 fails like this
    • TypeError: ForwardRef._evaluate() missing 1 required keyword-only argument: 'recursive_guard'
  • typeguard 4.3.0 contains a fix for this problem
  • But this surfaces another problem which is:
E       typeguard.TypeCheckError: item 0 of argument "coords" (tuple) did not match any element in the union:
E         NoneType: is not an instance of NoneType
E         int: is not an instance of int
E         somacore.types.Slice[int]: is not compatible with the Slice protocol because it has no attribute named '__orig_bases__'

/home/ubuntu/.pyenv/versions/3.12.5/lib/python3.12/site-packages/typeguard/_checkers.py:433: TypeCheckError

single-cell-data/SOMA#222

Once that works, we'll need to:

  • Merge this PR
  • Tag a release of this repo (somacore)
  • Depend on 1.0.next of somacore within the TileDB-SOMA repo

I've currently got the following setup on an EC2 instance:

@johnkerl
Copy link
Member

johnkerl commented Sep 18, 2024

Current status:

We will attempt to work around these bugs in order to deliver Python 3.12 support in TileDB-SOMA 1.14.2 or 1.15.0, whichever comes first.

@johnkerl
Copy link
Member

#3221 (comment)

@johnkerl
Copy link
Member

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

No branches or pull requests

3 participants