OpenBB icon indicating copy to clipboard operation
OpenBB copied to clipboard

Update latest allowed python version to 3.10.x

Open lotia opened this issue 2 years ago • 1 comments

Description

This PR raises the latest allowed python version 3.10.x which is the latest minor version.

How has this been tested?

I have run the test suite using pytest tests and although tests were skipped, there were no failures. This was done on macOS 12.4 on which python is managed using asdf and the python plugin for asdf.

To reproduce

  1. Install a current 3.10.x version of python, in my case I use the asdf version manager and the associated python plugin.

  2. Confirm you are using that python version in your current shell using python --version

  3. Install poetry

  4. Install all dependencies including optional ones

    poetry install --no-root -E prediction -E bots -E jupyterlab
    
  5. Activate the poetry shell

    poetry shell
    
  6. Run test suite

    pytest tests
    

This should enable you to confirm (hopefully) that all dependencies install cleanly using just poetry and also that the test suite does not have any failures, although some tests are skipped.

Others

  • [x] I have performed a self-review of my own code.
  • [x] My code passes all the checks pylint, flake8, black, ... To speed up development you should run pre-commit install.
  • [x] New and existing unit tests pass locally with my changes. You can test this locally using pytest tests/....

lotia avatar Jul 29 '22 22:07 lotia

Can confirm that above steps were also successful on Arch Linux under python 3.10.5

lotia avatar Jul 29 '22 23:07 lotia

I attempted this by installing Python 3.10.5 from my base Conda environment. I made the change to the file shown, then after confirming that Python 3.10.5 was the active version I ran poetry install --no-root -E prediction -E bots -E jupyterlab

poetry shell

Then launching the terminal, and attempting to enter the prediction menu, with a M1 Mac Pro, I received the error: Illegal instruction 4

Python version is 3.9.9, despite my starting point at 3.10.5

deeleeramone avatar Jul 31 '22 07:07 deeleeramone

Screen Shot 2022-07-31 at 12 55 47 AM Screen Shot 2022-07-31 at 12 56 32 AM Screen Shot 2022-07-31 at 12 56 45 AM Screen Shot 2022-07-31 at 12 57 06 AM

deeleeramone avatar Jul 31 '22 07:07 deeleeramone

Hello @deeleeramone thanks for looking into this. Unlike conda, poetry is installed per env. It is entirely possible that poetry was attempting to run against 3.10.5 despite not being installed for that executable. I'm also very happy to go over this on a pairing session if you'd like so we can get to the bottom of this issue. I can do discord or we can attempt to pair using Pop which I've found to be an excellent tool for pairing.

lotia avatar Jul 31 '22 14:07 lotia

Hi @lotia, I deleted the Poetry environment, but I'll have another go at installing this way.

I can assure you that between @piiq, @martinb-bb, and myself, we have spent a lot of time messing around with the dependency chain, figuring out what package distributions do not work. @piiq is probably the best person you could connect with to attempt to iron out a viable solution.

On the plus side, it is entirely possible to run the Terminal from Python 3.10.5 & 3.10.7, on a Mac M1 as well as a legacy Mac Pro system running OS Catalina. This was accomplished by installing with conda install -c conda-forge python==3.10.x

I have not tested for errors, but on the surface things appear to work.

deeleeramone avatar Jul 31 '22 20:07 deeleeramone

Pystan may be a problem that blocks the Terminal from 3.10. The poetry installation fails and there is no Conda distribution for 3.10.

deeleeramone avatar Aug 01 '22 08:08 deeleeramone

I'll close the PR for now and continue with the latest stable 3.9.x. Thanks for the time you have put in and apologies if it was annoying.

lotia avatar Aug 01 '22 11:08 lotia

It worked for me. I wouldn't about -E prediction because we are changing how that works anyway. Pytest did generate 3 errors locally, but I do not think this is due to the switch to python 3.10. @martinb-bb, would be interesting to see how this interacts with our menu.

colin99d avatar Aug 01 '22 12:08 colin99d

It shouldnt affect too much. Will have to do testing for sure !

martinb-ai avatar Aug 01 '22 12:08 martinb-ai

Please freel free to open or ask me to rebase if/when we can sort out. I'm excited by the push the PSF has towards performance improvments in 3.10 and the upcoming ones in 3.11 specially since you folks have so much cool prediction/simulation functionality available

lotia avatar Aug 01 '22 12:08 lotia