Skip to content

Support Python 3.12 #8914

Closed
Closed

Description

@EwoutH

Problem Description

Currently, Python 3.12 isn't fully supported in statsmodels yet, including testing in Continuous Integration (CI) and publishing wheels to PyPI. This can prevent dependent packages from starting work on their Python 3.12 support.

Feature Description

The feature request is for full support of Python 3.12, including testing in CI and publishing wheels to PyPI. This includes addressing and fixing any potential errors and bugs that may arise due to new Python 3.12 features and deprecations.

Alternative Solutions

An alternative could be to wait until NumPy, SciPy, Cython, and Pandas have wheels available for Python 3.12. However, as statsmodels is a lower-level dependency for many projects, it would be beneficial for these projects if Python 3.12 support could be started as soon as possible.

Additional Context

Python 3.12 is expected to be released as stable on Monday, October 2, 2023, with many new features and changes including:

  • PEP 701: Syntactic formalization of f-strings
  • PEP 688: Making the buffer protocol accessible in Python
  • PEP 692: Using TypedDict for more precise **kwargs typing
  • PEP 695: Type Parameter Syntax
  • PEP 698: Override Decorator for Static Typing
  • PEP 623: Remove wstr from Unicode (Deprecation)
  • PEP 632: Remove the distutils package (Deprecation)

The release schedule for Python 3.12 is as follows:

  • 3.12.0 beta 2: Tuesday, 2023-06-06
  • 3.12.0 beta 3: Monday, 2023-06-19
  • 3.12.0 beta 4: Monday, 2023-07-10
  • 3.12.0 candidate 1: Monday, 2023-07-31
  • 3.12.0 candidate 2: Monday, 2023-09-04
  • 3.12.0 final: Monday, 2023-10-02

By testing Python 3.12 in CI, we can catch errors and bugs before Python 3.12 becomes stable. This will not only help speed up Python 3.12 adoption for statsmodels but also for packages that depend on statsmodels.

Activity

  1. bashtage commented on Jun 14, 2023

    @bashtage
    Member

    I think we need at a minimum SciPy wheels (pre release are OK) sincere it is difficult to build.

  2. EwoutH commented on Jun 20, 2023

    @EwoutH
    ContributorAuthor
  3. bashtage commented on Jun 20, 2023

    @bashtage
    Member

    That is a start, but need them to start doing 3.12 nightly wheels before we can test.

  4. Joseisg commented on Jun 28, 2023

    @Joseisg

    quick question my friend. Do you know which version should I install to not have any problems with statsmodels? I just installed the 3.11.4 version but I can't use the .api at all. Any idea what should I use?
    (sorry to ask here but I'm kinda new and I'm literally lost)

  5. EwoutH commented on Sep 26, 2023

    @EwoutH
    ContributorAuthor

    NumPy, SciPy and Pandas now all have stable Python 3.12 wheels on PyPI!

  6. bashtage commented on Sep 26, 2023

    @bashtage
    Member

    So does statsmodels.

  7. EwoutH commented on Sep 26, 2023

    @EwoutH
    ContributorAuthor

    Awesome, thanks a lot!

    The Windows wheel still seems missing however.

  8. bashtage commented on Sep 26, 2023

    @bashtage
    Member

    Thanks. Added it.

  9. added this to the 0.14 milestone on Oct 27, 2023
  10. karrmagadgeteer2 commented on Nov 27, 2023

    @karrmagadgeteer2

    May I ask for advice on how to get statsmodels to work with 3.12 given the above?

  11. bashtage commented on Nov 27, 2023

    @bashtage
    Member

    All wheels for 3.12 are there, so should be able to pip install.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions