Skip to content

Instantly share code, notes, and snippets.

@semick-dev
Last active June 22, 2024 07:30
Show Gist options
  • Save semick-dev/d40d9cea3ab5185e0077d17d6fe2fed1 to your computer and use it in GitHub Desktop.
Save semick-dev/d40d9cea3ab5185e0077d17d6fe2fed1 to your computer and use it in GitHub Desktop.
Configure a usable pypy39 environment on WSL (Ubuntu 20.04)

Getting a pypy Virtual Env on WSL

All of the details in this instruction are being run from the default user folder of your WSL. For me, that's /home/semick/. ~ is also used to refer to this same /home/semick directory.

So install Ubuntu 20.04 LTS from Microsoft Store! (If you aren't using the new windows terminal I HIGHLY recommend it)

Finally, get a usable venv for pypy39

sudo apt update && sudo apt upgrade
curl -O https://downloads.python.org/pypy/pypy3.9-v7.3.13-linux64.tar.bz2
tar -xjf ./pypy3.9-v7.3.13-linux64.tar.bz2
./pypy3.9-v7.3.13-linux64/bin/pypy3.9 -m ensurepip
./pypy3.9-v7.3.13-linux64/bin/pypy3.9 -m pip install virtualenv
./pypy3.9-v7.3.13-linux64/bin/pypy3.9 -m virtualenv ./venv
source  ./venv/bin/activate
python --version
# expect to see
# Python 3.9.18 (c5262994620471e725f57d652d78d842270649d6, Sep 27 2023, 13:43:44)
# [PyPy 7.3.13 with GCC 10.2.1 20210130 (Red Hat 10.2.1-11)]

Once you have a venv activated, it is the same as a prep and run from windows.

To repro an individual test error

git clone https://github.com/azure/azure-sdk-for-python.git
cd azure-sdk-for-python
git checkout identify-storage-pypy-hang
cd sdk/storage/azure-storage-blob
pip install -r ../../../eng/test_tools.txt
pip install -r dev_requirements.txt
pip install .
pytest ./tests/test_blob_access_conditions_async.py -k "test_lease_blob_with_if_match"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment