Skip to content

CI: Add Python 3.11 jobs - #8431

Merged
bashtage merged 2 commits into
statsmodels:mainfrom
EwoutH:ci-py311-2
Oct 26, 2022
Merged

bashtage merged 2 commits into
statsmodels:mainfrom
EwoutH:ci-py311-2

Conversation

@EwoutH

@EwoutH EwoutH commented Oct 9, 2022

Copy link
Copy Markdown
Contributor

Add Python 3.11 jobs to the Azure pipelines CI.

@bashtage

Copy link
Copy Markdown
Member

I think you missed a flag allowing experimental pythons so 3.11rc2 was not found.

@bashtage

Copy link
Copy Markdown
Member

These errors on Windows are disturbing:

"C:\Windows\system32\cmd.exe" /D /E:ON /V:OFF /S /C "CALL "D:\a\_temp\03ff0982-4e99-4cc0-a1d9-ea80a607e06f.cmd""
RuntimeError: module compiled against API version 0xf but this version of numpy is 0xe
ERROR: while parsing the following warning configuration:

We are supposed to be used latest supported numpy which is supposed to automatically handle this.

@EwoutH
EwoutH force-pushed the ci-py311-2 branch 2 times, most recently from 1a33259 to dcd8815 Compare October 10, 2022 07:01
@EwoutH

EwoutH commented Oct 10, 2022

Copy link
Copy Markdown
Contributor Author

I fixed the Python versions syntax. It looks like the Windows errors are unrelated, right?

I would recommend reviewing and merging this PR #8430, which add a weekly scheduled run to the Azure pipelines. That way we can detect errors caused by upstream dependencies or changes in the build environment earlier.

@EwoutH

EwoutH commented Oct 10, 2022

Copy link
Copy Markdown
Contributor Author

As for the Windows issue, what doesn't help, is that NumPy is installed once and then again. I suspect this is to do due to oldest-supported-numpy returning an exact version of NumPy, instead of a minimum.

Beside that, the requirement files are currently a mess. Everything scattered over 4 files: setup.py, requirements.txt, requirements-dev.txt and pyproject.toml. Ideally should be just one file, with the dev requirements listed as an extras. I would recommend putting everything in the pyproject.toml, since that's the latest PEP standard.

@josef-pkt

Copy link
Copy Markdown
Member

@EwoutH @bashtage Thanks for working on this.

numpy abi mismatch also happens in main

from my current PR

C:\Windows\system32\cmd.exe" /D /E:ON /V:OFF /S /C "CALL "D:\a\_temp\0989ae71-55f9-473b-b3ea-22db1576561d.cmd""
RuntimeError: module compiled against API version 0xf but this version of numpy is 0xe
ERROR: while parsing the following warning configuration:

  error:Estimation of VARMA:statsmodels.tools.sm_exceptions.EstimationWarning

https://dev.azure.com/statsmodels/statsmodels-testing/_build/results?buildId=4674&view=logs&j=741c428d-c8b3-5020-9b3f-944bdfcd9522&t=e4ef3104-c8e0-58f6-36a9-8625bff34917

@bashtage

Copy link
Copy Markdown
Member

This is happending because pandas moved the locations of certain errors. You can delete the line error:Estimation of VARMA:statsmodels.tools.sm_exceptions.EstimationWarning from the pyproject file in your PR.

@josef-pkt

Copy link
Copy Markdown
Member

You can delete the line error:Estimation of VARMA:statsmodels.tools.sm_exceptions.EstimationWarning from the pyproject file in your PR.

I don't really know what that means, pyproject.toml doesn't have anything like this. Is the a different pyproject file?

It looks like there is a separate issue building the documentation #8432

@EwoutH

EwoutH commented Oct 10, 2022 •

Copy link
Copy Markdown
Contributor Author

The last run that passed used SciPy 1.9.1. The first run that failed 1.9.2. It could be that there is an issue caused by or related to that change.

@josef-pkt

Copy link
Copy Markdown
Member

scipy issue is less likely because that is heavily unit tested.
pandas usage, especially in notebooks, is much less unit tested. The statsmodels code might have been adjusted to pandas compatibility but not the code in the notebooks

@EwoutH

EwoutH commented Oct 10, 2022

Copy link
Copy Markdown
Contributor Author

Scikit-learn also has issues with the latest SciPy release: scikit-learn/scikit-learn#24612 (comment)

We probably should create a separate issue for this.

@bashtage

Copy link
Copy Markdown
Member

Could just pin Scipy !=1.9.2

@EwoutH

EwoutH commented Oct 11, 2022

Copy link
Copy Markdown
Contributor Author

There is now also a discussion on the SciPy repo, we could see how that plays out: scipy/scipy#17191

@bashtage

Copy link
Copy Markdown
Member

@EwoutH if you rebase on main and force push it might pass now.

@EwoutH

EwoutH commented Oct 20, 2022

Copy link
Copy Markdown
Contributor Author

The current issue is that lxml doesn't have Python 3.11 wheels available on PyPI, and it fails to build the wheels itself. There is a tracking issue for this: https://bugs.launchpad.net/lxml/+bug/1977998

The Python 3.10 error on Windows is the NumPy error again, and unrelated: RuntimeError: module compiled against API version 0xf but this version of numpy is 0xe.

I can highly recommend merging #8430 to catch those errors on the main branch early.

@bashtage

Copy link
Copy Markdown
Member

If you rebase on main you should get past the windows error. It is a scipy build issue.

@EwoutH

EwoutH commented Oct 20, 2022

Copy link
Copy Markdown
Contributor Author

If you rebase on main you should get past the windows error. It is a scipy build issue.

I'm actually rebased on main. Could be another regression in SciPy 1.9.3 that released yesterday?

@EwoutH

EwoutH commented Oct 23, 2022

Copy link
Copy Markdown
Contributor Author

How heavy is the dependency on lxml? I feel the repository is not that actively maintained, and their build infrastructure looks outdated and fragile. It could be a source of more build issues in the future.

@bashtage

Copy link
Copy Markdown
Member

It isn't that important. I suspect it is needed by the doc build. Do you know what is requesting it?

@EwoutH

EwoutH commented Oct 23, 2022

Copy link
Copy Markdown
Contributor Author

Difficult to say, I used pipdeptree and it doesn't look like a dependency of statsmodels itself.

statsmodels==0.13.2
  - numpy [required: >=1.17, installed: 1.23.4]
  - packaging [required: >=21.3, installed: 21.3]
    - pyparsing [required: >=2.0.2,!=3.0.5, installed: 3.0.9]
  - pandas [required: >=0.25, installed: 1.5.1]
    - numpy [required: >=1.21.0, installed: 1.23.4]
    - python-dateutil [required: >=2.8.1, installed: 2.8.2]
      - six [required: >=1.5, installed: 1.16.0]
    - pytz [required: >=2020.1, installed: 2022.5]
  - patsy [required: >=0.5.2, installed: 0.5.3]
    - numpy [required: >=1.4, installed: 1.23.4]
    - six [required: Any, installed: 1.16.0]
  - scipy [required: >=1.3, installed: 1.9.3]
    - numpy [required: >=1.18.4]

dependencies

@bashtage

Copy link
Copy Markdown
Member

I looked and it is being pulled in by the sphinx-theme AFAICT. You could see hat happens if you comment out all of the docbuild stuff from requirements-dev.

@EwoutH

EwoutH commented Oct 23, 2022 •

Copy link
Copy Markdown
Contributor Author

Testing it out at #8428, see this Azure pipeline run.

@bashtage

Copy link
Copy Markdown
Member

I think one more rebase if you incorporate the changes in the requirements should get it done.

@bashtage

Copy link
Copy Markdown
Member

Same for your other PRs.

@bashtage

Copy link
Copy Markdown
Member

Progress, but now something to do with Cython.

Add Python 3.11 jobs to the Azure pipelines CI.
@EwoutH

EwoutH commented Oct 25, 2022

Copy link
Copy Markdown
Contributor Author

Great news, everything is passing on my test PR!

I ported the changes from that PR to this one, cleaned up and rebased. This PR is ready for review and merging!

@bashtage Thanks for all the help!

@EwoutH EwoutH mentioned this pull request Oct 25, 2022
@bashtage bashtage closed this Oct 25, 2022
@bashtage bashtage reopened this Oct 25, 2022
@bashtage

Copy link
Copy Markdown
Member

Close and reopen to retrigger CI

The GitHub Actions macOS images are lagging a bit behind.
@EwoutH

EwoutH commented Oct 25, 2022

Copy link
Copy Markdown
Contributor Author

Fixed the issue, the macOS images are lacking a bit behind.

See actions/runner-images#6459 (comment).

@benz0li benz0li mentioned this pull request Oct 25, 2022
1 of 4 tasks
@EwoutH

EwoutH commented Oct 25, 2022

Copy link
Copy Markdown
Contributor Author

@bashtage all checks pass, so I say let's go!

@bashtage

Copy link
Copy Markdown
Member

One comment. Could you move the OSX back to 3.10. The latest marker is for lastest dependencies, not Python. We don't have a lot of capacity to debug OSX so something more stable than 3.11 makes sense for us.

@bashtage
bashtage merged commit 250617b into statsmodels:main Oct 26, 2022
@bashtage

Copy link
Copy Markdown
Member

Thanks.

@EwoutH

EwoutH commented Oct 26, 2022

Copy link
Copy Markdown
Contributor Author

Sorry, just saw you last comment, thanks for merging!

Ironically Python 3.11.0 was just added to macOS runners (actions/setup-python#531 (comment)), so we don't need the pre-release anymore. I've created #8466 in which this is reverted.

@bashtage bashtage added this to the 0.14 milestone Apr 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants