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

docs: add contributor instructions for Python 3.11 on Ubuntu 24.04 #29311

Merged

Conversation

MikeMcC399
Copy link
Contributor

Additional details

Ubuntu 24.04 ships with Python 3.12, which is not compatible with the Cypress yarn build process. Ubuntu 24.04 is currently available as a beta version and the planned release date is April 2024.

If the pre-installed Python 3.12 version of Ubuntu 24.04 is used by yarn install then the build encounters the errors described in #28695 when it attempts to install the npm modules:

The error messages include the following line caused by a breaking change in Python 3.12 which is incompatible with the version of node-gyp currently used by Cypress:

ModuleNotFoundError: No module named 'distutils'

This PR adds instructions to the CONTRIBUTING document to install Python 3.11 on Ubuntu 24.04 in addition to the pre-installed Python 3.12 version. Python 3.11 is the highest version compatible with the Cypress Yarn build process.

Note: Cypress will build using the default pre-installed versions of Python on earlier versions of Ubuntu (20.04, 23.10 and 22.04). These Ubuntu versions have Python versions 3.8, 3.10 and 3.11 respectively pre-installed and so no changes in instructions are necessary for these Ubuntu versions.

Installation instructions

These instructions are intended for Ubuntu 24.04 only:

Execute

sudo apt install python3.11

Add the following to ~/.bashrc

export NODE_GYP_FORCE_PYTHON=/usr/bin/python3.11

Steps to test

On Ubuntu 24.04 apply the above installation instructions, then execute:

sudo apt install git g++ make curl
curl -L https://bit.ly/n-install | bash
. ~/.bashrc
cd ~
git clone https://github.com/cypress-io/cypress
cd cypress
n auto
npm install yarn -g
yarn

The build log should contain the following steps with no errors recorded between these two lines:

[5/6] Building fresh packages...
[6/6] Cleaning modules...

How has the user experience changed?

This is a documentation change which affects only contributors to Cypress. There is no change to the user experience of end-users.

PR Tasks

@cypress-app-bot
Copy link
Collaborator

@MikeMcC399

This comment was marked as outdated.

@MikeMcC399
Copy link
Contributor Author

The section Requirements was re-arranged to accommodate the additional instructions. These are shown in the screenshot in green:

image

@AtofStryker AtofStryker self-requested a review April 11, 2024 18:41
@jennifer-shehane jennifer-shehane merged commit f8d62e0 into cypress-io:develop Apr 11, 2024
30 of 33 checks passed
@MikeMcC399 MikeMcC399 deleted the ubuntu-24/python-3-11 branch April 11, 2024 19:26
@MikeMcC399
Copy link
Contributor Author

https://discourse.ubuntu.com/t/noble-numbat-release-notes/39890#toolchain-upgrades-9 documents:

Python 🐍 now defaults to version 3.12

@MikeMcC399

This comment was marked as resolved.

@MikeMcC399
Copy link
Contributor Author

See https://launchpad.net/%7Edeadsnakes/+archive/ubuntu/ppa

sudo add-apt-repository ppa:deadsnakes/ppa
sudo apt-get update && sudo apt-get upgrade -y
sudo apt-get install python3.11

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