#4215 Add py3 asyncio
Closed by ark74. Opened by ark74.
ark74/pagure py3-asyncio  into  master

Download 4215.patch

Some stdlib python3 don't come with asyncio by default [Xenial python3 (3.5.2)] install for those cases when setting up pagure-ev.

asyncio was added to standard library in Python 3.4. Something is wrong with your Python setup if it seems to be missing.

This is what is available man.
Here a nice way to test it using docker.
docker run -it ubuntu:16.04 bash
then run;

cat  << ASYNCIO > asyncio_test
apt update
apt install -y python3 libpython3-stdlib python-dev python3-venv
pyvenv --system-site-packages py3venv
source py3venv/bin/activate
echo -e "\n####### Test asyncio #######\n"
py3venv/bin/python3 -V
py3venv/bin/python3 -c "import asyncio"
echo $? | sed -e "s|0|--> asyncio |"
py3venv/bin/pip3 freeze
echo -e "\n####### end test #######\n"
deactivate
ASYNCIO
bash asyncio_test

The output would be;

####### Test asyncio #######

Python 3.5.2
--> asyncio
pkg-resources==0.0.0
You are using pip version 8.1.1, however version 18.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.

####### end test #######

Let me know if that is a bug.

Update: Got it backwards, fixed. :)

$ podman run --rm -it ubuntu:16.04 /bin/bash
-> $ apt update && apt install python3
-> $ python3 -c "import asyncio"
-> echo $?
0

Returning 0 means it was successful. A failure looks like this:

root@66c3c75a3c80:/# python3 -c "import asynkio"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ImportError: No module named 'asynkio'
root@66c3c75a3c80:/# echo $?
1

Yep, I have rebuild the whole py3 setup on docker and indeed, it is already there.
Closing.

Pull-Request has been closed by ark74

For the sake of proof,

docker run -ti kpengboy/trisquel:8.0 bash
(already has the required libgit2 where xenial doesn't)

cat  << ASYNCIO > asyncio_test
apt update
apt install -y python3 python3-dev python3-venv python3-psycopg2 python3-gdbm python3-jinja2 \
gcc git libgit2-dev libffi-dev libjpeg-dev
pyvenv --system-site-packages py3venv
source py3venv/bin/activate
echo -e "\n####### Test asyncio #######\n"
py3venv/bin/python3 -V
py3venv/bin/python3 -c "import asyncio"
echo $? | sed -e "s|0|--> asyncio in place|"
py3venv/bin/pip3 freeze
echo -e "\n####### end test #######\n"
py3venv/bin/pip3 install --upgrade pip
py3venv/bin/pip3 install pygit2==0.26.4
git clone --depth 1 https://pagure.io/pagure.git pagure-server
cd pagure-server
../py3venv/bin/python3 setup.py build
../py3venv/bin/python3 setup.py install
../py3venv/bin/pip3 install -r requirements.txt
../py3venv/bin/pip3 install -r requirements-ci.txt
../py3venv/bin/pip3 install -r requirements-ev.txt
cd ../
echo -e "\n####### Test trololio.asyncio #######\n"
py3venv/bin/python3 -V
py3venv/bin/python3 -c "import trololio.asyncio"
echo $? | sed -e "s|0|--> trololio.asyncio in place|"
echo -e "\n####### end test #######\n"
echo -e "\n####### Test pagure #######\n"
py3venv/bin/python3 -c "import pagure"
echo $? | sed -e "s|0|--> pagure in place|"
py3venv/bin/python3 -c "import pagure ; print(pagure.__path__)"
echo -e "\n####### end test #######\n"
py3venv/bin/pip3 freeze
deactivate
ASYNCIO
bash asyncio_test
Metadata