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

feature: add CPython 3.11 support #1109

Merged
merged 2 commits into from May 25, 2022
Merged

feature: add CPython 3.11 support #1109

merged 2 commits into from May 25, 2022

Conversation

mayeut
Copy link
Member

@mayeut mayeut commented May 15, 2022

CPython 3.11.0beta1 is now available.
Add CPython 3.11 support using CIBW_PRERELEASE_PYTHONS.

The commit marking CPython 3.11 as a pre-release has been kept isolated to ease the transition by just reverting this commit once CPython 3.11 is released (or ABI stable).

@henryiii
Copy link
Contributor

Didn't realize this was in manylinux already, great!

@joerick
Copy link
Contributor

joerick commented May 16, 2022

Looks great. If it's okay with you guys, I might hold off on merging this until we're close to a release (waiting on pip 22.1.1), since the README stating we support 3.11 could confuse people.

@henryiii
Copy link
Contributor

Should be safe with #1115.

@EwoutH
Copy link

EwoutH commented May 23, 2022

Thanks for this effort, it would be very nice to be able to build wheels for Python 3.11 with cibuildwheel!

@mayeut
Copy link
Member Author

mayeut commented May 23, 2022

Should be safe with #1115.

Merged #1115, rebased this PR (& updated constraints for python 3.11)

@EwoutH
Copy link

EwoutH commented May 24, 2022

Is this CI error on Python 3.6 related?

CI Failures
================================== FAILURES ===================================
__________________________________ test[pip] __________________________________
[gw0] win32 -- Python 3.6.8 C:\hostedtoolcache\windows\Python\3.6.8\x64\python.exe

tmp_path = WindowsPath('C:/Users/VssAdministrator/AppData/Local/Temp/pytest-of-VssAdministrator/pytest-1/popen-gw0/test_pip_0')
build_frontend_env = {'CIBW_BUILD_FRONTEND': 'pip'}

    def test(tmp_path, build_frontend_env):
        project_dir = tmp_path / "project"
        basic_project.generate(project_dir)
    
        # build the wheels
>       actual_wheels = utils.cibuildwheel_run(project_dir, add_env=build_frontend_env)

build_frontend_env = {'CIBW_BUILD_FRONTEND': 'pip'}
project_dir = WindowsPath('C:/Users/VssAdministrator/AppData/Local/Temp/pytest-of-VssAdministrator/pytest-1/popen-gw0/test_pip_0/project')
tmp_path   = WindowsPath('C:/Users/VssAdministrator/AppData/Local/Temp/pytest-of-VssAdministrator/pytest-1/popen-gw0/test_pip_0')

test\test_0_basic.py:26: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
test\utils.py:90: in cibuildwheel_run
    check=True,
        add_args   = []
        add_env    = {'CIBW_BUILD_FRONTEND': 'pip'}
        env        = {'AGENT.JOBSTATUS': 'Succeeded', 'AGENT_BUILDDIRECTORY': 'D:\\a\\1', 'AGENT_DISABLELOGPLUGIN_TESTFILEPUBLISHERPLUGIN': 'true', 'AGENT_DISABLELOGPLUGIN_TESTRESULTLOGPLUGIN': 'false', ...}
        output_dir = None
        package_dir = '.'
        project_path = WindowsPath('C:/Users/VssAdministrator/AppData/Local/Temp/pytest-of-VssAdministrator/pytest-1/popen-gw0/test_pip_0/project')
        tmp_output_dir = 'C:\\Users\\VSSADM~1\\AppData\\Local\\Temp\\tmpfz8lzcoo'
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

input = None, timeout = None, check = True
popenargs = (['C:\\hostedtoolcache\\windows\\Python\\3.6.8\\x64\\python.exe', '-m', 'cibuildwheel', '--prerelease-pythons', '--output-dir', 'C:\\Users\\VSSADM~1\\AppData\\Local\\Temp\\tmpfz8lzcoo', ...],)
kwargs = {'cwd': WindowsPath('C:/Users/VssAdministrator/AppData/Local/Temp/pytest-of-VssAdministrator/pytest-1/popen-gw0/test_p... 'AGENT_DISABLELOGPLUGIN_TESTFILEPUBLISHERPLUGIN': 'true', 'AGENT_DISABLELOGPLUGIN_TESTRESULTLOGPLUGIN': 'false', ...}}
process = <subprocess.Popen object at 0x00000255B0879B38>, stdout = None
stderr = None, retcode = 1

    def run(*popenargs, input=None, timeout=None, check=False, **kwargs):
        """Run command with arguments and return a CompletedProcess instance.
    
        The returned instance will have attributes args, returncode, stdout and
        stderr. By default, stdout and stderr are not captured, and those attributes
        will be None. Pass stdout=PIPE and/or stderr=PIPE in order to capture them.
    
        If check is True and the exit code was non-zero, it raises a
        CalledProcessError. The CalledProcessError object will have the return code
        in the returncode attribute, and output & stderr attributes if those streams
        were captured.
    
        If timeout is given, and the process takes too long, a TimeoutExpired
        exception will be raised.
    
        There is an optional argument "input", allowing you to
        pass a string to the subprocess's stdin.  If you use this argument
        you may not also use the Popen constructor's "stdin" argument, as
        it will be used internally.
    
        The other arguments are the same as for the Popen constructor.
    
        If universal_newlines=True is passed, the "input" argument must be a
        string and stdout/stderr in the returned object will be strings rather than
        bytes.
        """
        if input is not None:
            if 'stdin' in kwargs:
                raise ValueError('stdin and input arguments may not both be used.')
            kwargs['stdin'] = PIPE
    
        with Popen(*popenargs, **kwargs) as process:
            try:
                stdout, stderr = process.communicate(input, timeout=timeout)
            except TimeoutExpired:
                process.kill()
                stdout, stderr = process.communicate()
                raise TimeoutExpired(process.args, timeout, output=stdout,
                                     stderr=stderr)
            except:
                process.kill()
                process.wait()
                raise
            retcode = process.poll()
            if check and retcode:
                raise CalledProcessError(retcode, process.args,
>                                        output=stdout, stderr=stderr)
E               subprocess.CalledProcessError: Command '['C:\\hostedtoolcache\\windows\\Python\\3.6.8\\x64\\python.exe', '-m', 'cibuildwheel', '--prerelease-pythons', '--output-dir', 'C:\\Users\\VSSADM~1\\AppData\\Local\\Temp\\tmpfz8lzcoo', '.']' returned non-zero exit status 1.

check      = True
input      = None
kwargs     = {'cwd': WindowsPath('C:/Users/VssAdministrator/AppData/Local/Temp/pytest-of-VssAdministrator/pytest-1/popen-gw0/test_p... 'AGENT_DISABLELOGPLUGIN_TESTFILEPUBLISHERPLUGIN': 'true', 'AGENT_DISABLELOGPLUGIN_TESTRESULTLOGPLUGIN': 'false', ...}}
popenargs  = (['C:\\hostedtoolcache\\windows\\Python\\3.6.8\\x64\\python.exe', '-m', 'cibuildwheel', '--prerelease-pythons', '--output-dir', 'C:\\Users\\VSSADM~1\\AppData\\Local\\Temp\\tmpfz8lzcoo', ...],)
process    = <subprocess.Popen object at 0x00000255B0879B38>
retcode    = 1
stderr     = None
stdout     = None
timeout    = None

C:\hostedtoolcache\windows\Python\3.6.8\x64\lib\subprocess.py:438: CalledProcessError

@henryiii
Copy link
Contributor

henryiii commented May 24, 2022

Don't think so, looks like a network error getting pip 22.1.1 on Python 3.11 if you check the output capture. (I've restarted it to see)

@EwoutH
Copy link

EwoutH commented May 24, 2022

It now passes, nice!

| PyPy 3.7 v7.3 | ✅ | N/A | ✅ | N/A | N/A | ✅¹ | ✅¹ | ✅¹ | N/A | N/A |
| PyPy 3.8 v7.3 | ✅ | N/A | ✅ | N/A | N/A | ✅¹ | ✅¹ | ✅¹ | N/A | N/A |
| PyPy 3.9 v7.3 | ✅ | N/A | ✅ | N/A | N/A | ✅¹ | ✅¹ | ✅¹ | N/A | N/A |

<sup>¹ PyPy is only supported for manylinux wheels.</sup><br>
<sup>² Windows arm64 support is experimental.</sup><br>
<sup>³ Alpine 3.14 and very briefly 3.15's default python3 [was not able to load](https://github.com/pypa/cibuildwheel/issues/934) musllinux wheels. This has been fixed; please upgrade the python package if using Alpine from before the fix.</sup><br>
<sup>⁴ CPython 3.11 is available using the [CIBW_PRERELEASE_PYTHONS](https://cibuildwheel.readthedocs.io/en/stable/options/#prerelease-pythons) option.</sup><br>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we reiterate here that they are not something you should be uploading to PyPI, CPython 3.11 is not ABI stable yet?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I used the same kind of wording that was used in https://github.com/pypa/cibuildwheel/tree/v2.0.1
c.f. @joerick comment for the same question at the time of CPython 3.10.

@henryiii
Copy link
Contributor

once CPython 3.11 is released (or ABI stable).

The final beta is when it becomes ABI stable (though I think we have waited till RC1 in the past).

@joerick
Copy link
Contributor

joerick commented May 25, 2022

Thanks all. I'll merge and release this evening (~6pm BST).

@joerick joerick merged commit d73f1ea into pypa:main May 25, 2022
@joerick
Copy link
Contributor

joerick commented May 25, 2022

Thanks @mayeut ! Cutting a release now...

@mayeut mayeut deleted the python-3.11 branch May 26, 2022 10:21
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

Successfully merging this pull request may close these issues.

None yet

4 participants