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

Build musllinux wheels #307

Closed
richli opened this issue Aug 4, 2023 · 4 comments
Closed

Build musllinux wheels #307

richli opened this issue Aug 4, 2023 · 4 comments

Comments

@richli
Copy link
Contributor

richli commented Aug 4, 2023

As of numpy 1.25, musllinux wheels are built and distributed on PyPI, supplementing the existing manylinux ones. It would be helpful for cftime to likewise build wheels for this platform.

It should essentially be a matter of updating the .github/workflows/cibuildwheel.yml to remove *musllinux* from the CIBW_SKIP variable. However, when I tried running it locally, the wheels built successfully but one test fails:

=================================== FAILURES ===================================
___________________________ test_num2date_precision ____________________________
                                                                                                                               
    def test_num2date_precision():           
        if np.finfo(np.longdouble).precision < 18:
            pytest.skip("skipping tests that require extended precision longdouble type")
        testdates = [(1271, 3, 18, 19, 41, 33),                                                                                
                     (1271, 3, 18, 19, 41, 32, 999998)]      
        unitinc = ['microseconds', 'seconds', 'minutes', 'hours', 'days']
        for cc in ['standard', 'gregorian', 'julian', 'proleptic_gregorian',
                   'noleap', 'all_leap', '365_day', '366_day', '360_day']:                                    
            for uinc in unitinc:             
                if cc in ['standard', 'gregorian', 'julian']:
                    units = uinc + ' since -4713-01-01 12:00:00'
                elif cc in ['proleptic_gregorian']:                                                                            
                    units = uinc + ' since -4714-01-01 12:00:00'
                elif cc in ['noleap', 'all_leap', '365_day', '366_day', '360_day']:
                    units = uinc + ' since 0000-01-01 12:00:00'        
                # scalar
                date = datetimex(*testdates[0], calendar=cc)                                                                   
                num = date2num(date, units, calendar=cc, longdouble=True)                            
                date2 = num2date(num, units, calendar=cc)                                                                      
                assert date == date2                                                                                           
                # array                                                                                                                                                                                                                                       
                date = [ datetimex(*dd, calendar=cc) for dd in testdates ]                           
                num = date2num(date, units, calendar=cc, longdouble=True)                  
                date2 = num2date(num, units, calendar=cc)
                for i in range(len(date)):                                                                                     
>                   assert date[i] == date2[i]                                                                                 
E                   AssertionError: assert cftime.datetime(1271, 3, 18, 19, 41, 32, 999998, calendar='standard', has_year_zero=False) == cftime.DatetimeGregorian(1271, 3, 18, 19, 41, 33, 0, has_year_zero=False)

/project/test/test_cftime.py:2212: AssertionError

It looks like numpy has had some similar test failures for long doubles using musl. This comment identified that on the x86_64 architecture, long double is actually the x87 80-bit float, not the IEEE-754 128-bit float type.

jswhit added a commit that referenced this issue Aug 15, 2023
@jswhit
Copy link
Collaborator

jswhit commented Aug 15, 2023

I created PR #308 - and it shows the same test failure, only for Python 3.9 for some reason. It is true that long doubles are actually 80, not 128 bits on x86_64, but that doesn't explain why all the x86_64 tests pass except for musllinux with python 3.9.

@richli
Copy link
Contributor Author

richli commented Aug 15, 2023

It also fails for Python 3.10 and 3.11, it's just that since 3.9 fails first it doesn't try testing those ones.

@richli
Copy link
Contributor Author

richli commented Aug 15, 2023

I don't think it's a Python version issue, but a numpy version issue. With Python 3.7 and 3.8, it's using an older version of numpy.

jswhit added a commit that referenced this issue Oct 28, 2023
include musslinux wheels (issue #307)
@jswhit
Copy link
Collaborator

jswhit commented Oct 28, 2023

PR #308 merged, musllinux wheels should be created in the next release

@jswhit jswhit closed this as completed Oct 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants