stan-dev / pystan

PyStan, a Python interface to Stan, a platform for statistical modeling. Documentation: https://pystan.readthedocs.io
ISC License
337 stars 58 forks source link

ci: macos-11 image uses 10.9 wheels #369

Closed ahartikainen closed 1 year ago

ahartikainen commented 1 year ago

Describe the bug

For some reason macos11 images in ci pipeline use 10.9 wheels with pip.

Describe your system

Github Actions

Steps/Code to Reproduce

ahartikainen commented 1 year ago

For some reason on macos-11image

python -c "from distutils import util;print(util.get_platform())"
# macosx-10.15-x86_64

And just to be sure

python -c "from setuptools._distutils import util;print(util.get_platform())"
# macosx-10.15-x86_64
riddell-stan commented 1 year ago

Is macos 11 refusing to install wheels built using older versions of macos? I thought macos wheels built on older systems would work on newer os versions.

ahartikainen commented 1 year ago

I think on macos-11 image in github actions the python is refusing to install newer (gh actions10.x vs pypi 11) wheels.

httpstan macos-11 ci also creates 10.x wheel for local use, but httpstan-wheels repo creates the correct 11 wheel.

ahartikainen commented 1 year ago

Ok, I wonder if GH actions use the same python binary for macos10 and macos11?

ahartikainen commented 1 year ago

I guess this is somehow related

https://github.com/actions/python-versions/pull/114

riddell-stan commented 1 year ago

Let's fix this problem first. We could also build a Python 3.11 wheel in httpstan-wheels while we are at it.

riddell-stan commented 1 year ago

It's just macos-11, 3.10. macos-11, 3.9 seems to work fine.

ahartikainen commented 1 year ago

Yes, we need to address this first.

So 3.9 and 3.8 has macos 10.16 wheels. 3.10 has macos 11.0.

https://pypi.org/project/httpstan/#files

And the python on GH Actions thinks it is macos 10.15.

So any 10.x works but 11.x does not?

riddell-stan commented 1 year ago

So why can't macos 11.0 (Python 3.10) install the PyPI wheel httpstan-4.8.2-cp310-cp310-macosx_11_0_x86_64.whl? Looks compatible to me!

riddell-stan commented 1 year ago

Perhaps we should try to build a Python 3.10 wheel on an older macos version in httpstan-wheels?

ahartikainen commented 1 year ago

That might be a solution.

I bet pip tool somehow fails with 10.x vs 11.x (major.minor) difference given major number difference.

riddell-stan commented 1 year ago

I think I've figured it out. Setting ARCHFLAGS to x86_64 did the trick. Now I'm able to build httpstan-4.8.2-cp310-cp310-macosx_10_15_x86_64.whl. See https://github.com/stan-dev/httpstan-wheels/pull/92

riddell-stan commented 1 year ago

Fixed in httpstan-wheels.