Ver Fonte

Upgrade Python 3 + PyPy => PyPy2 rename + PyPy3 integration (#2918)

* Upgrade CPython + PyPy2 and add PyPy3

* Upgrade CPython + PyPy2 and add PyPy3

* Revolve pedantic remark from @msmith-techempower about pypy => pypy2
Ludovic Gasc há 8 anos atrás
pai
commit
882490524e

+ 9 - 9
frameworks/Python/README.md

@@ -6,9 +6,10 @@ For further guidance, review the
 
 ## Infrastructure Software Versions
 
-* [CPython2](https://www.python.org/)
 * [CPython3](https://www.python.org/)
-* [PyPy](http://pypy.org/)
+* [CPython2](https://www.python.org/)
+* [PyPy3](http://pypy.org/)
+* [PyPy2](http://pypy.org/)
 * [nginx](http://nginx.org/)
 * [uWSGI](https://uwsgi-docs.readthedocs.org/en/latest/)
 
@@ -30,20 +31,19 @@ For further guidance, review the
 
 Newest Python.
 
-It will be most major interpreter for Web Development in this or next year.
-This is a bit slower than CPython 2, but more simple and productive than it.
+It is the most major interpreter for Web Development.
 
 ### (C)Python 2
 
-Legacy Python.  Still used for widely.
+Legacy Python. Still used for widely.
 
-### PyPy
+### PyPy3
 
 PyPy is the fastest Python implementation with JIT.
 
-There is PyPy's Python 3 implementation (PyPy3), but it is not so tuned like PyPy2.
-So we don't use it for now.
+### PyPy2
 
+Legacy PyPy. Still used for widely.
 
 ## WSGI Servers
 
@@ -99,7 +99,7 @@ If your framework uses SQLAlchemy, Flask may be enough to know performance of SQ
 
 ### Interpreter
 
-Consider Python 3 first. -- Python 3 will be mainstream for web development soon.
+Consider Python 3 first. -- Python 3 is mainstream for web development.
 
 ### Server
 

+ 4 - 4
frameworks/Python/bottle/benchmark_config.json

@@ -49,8 +49,8 @@
       "notes": "CPython 3",
       "versus": "wsgi"
     },
-    "pypy": {
-      "setup_file": "setup_pypy",
+    "pypy2": {
+      "setup_file": "setup_pypy2",
       "json_url": "/json",
       "db_url": "/db",
       "query_url": "/queries?queries=",
@@ -63,14 +63,14 @@
       "database": "MySQL",
       "framework": "bottle",
       "language": "Python",
-      "flavor": "PyPy",
+      "flavor": "PyPy2",
       "orm": "Full",
       "platform": "Tornado",
       "webserver": "None",
       "os": "Linux",
       "database_os": "Linux",
       "display_name": "Bottle",
-      "notes": "PyPy",
+      "notes": "PyPy2",
       "versus": "wsgi"
     },
     "mysql-raw": {

+ 0 - 7
frameworks/Python/bottle/setup_pypy.sh

@@ -1,7 +0,0 @@
-#!/bin/bash
-
-fw_depends mysql pypy
-
-pip install --install-option="--prefix=${PYPY_ROOT}" -r $TROOT/requirements-pypy.txt
-
-gunicorn app:app -c gunicorn_conf.py &

+ 7 - 0
frameworks/Python/bottle/setup_pypy2.sh

@@ -0,0 +1,7 @@
+#!/bin/bash
+
+fw_depends mysql pypy2
+
+pip install --install-option="--prefix=${PYPY2_ROOT}" -r $TROOT/requirements-pypy.txt
+
+gunicorn app:app -c gunicorn_conf.py &

+ 4 - 4
frameworks/Python/falcon/benchmark_config.json

@@ -41,8 +41,8 @@
       "notes": "CPython 3",
       "versus": "wsgi"
     },
-    "pypy": {
-      "setup_file": "setup_pypy",
+    "pypy2": {
+      "setup_file": "setup_pypy2",
       "json_url": "/json",
       "plaintext_url": "/plaintext",
       "port": 8080,
@@ -51,14 +51,14 @@
       "database": "None",
       "framework": "Falcon",
       "language": "Python",
-      "flavor": "PyPy",
+      "flavor": "PyPy2",
       "orm": "Raw",
       "platform": "None",
       "webserver": "Tornado",
       "os": "Linux",
       "database_os": "Linux",
       "display_name": "Falcon",
-      "notes": "PyPy",
+      "notes": "PyPy2",
       "versus": "wsgi"
     }
   }]

+ 0 - 7
frameworks/Python/falcon/setup_pypy.sh

@@ -1,7 +0,0 @@
-#!/bin/bash
-
-fw_depends pypy
-
-pip install --install-option="--prefix=${PYPY_ROOT}" -r $TROOT/requirements-pypy.txt
-
-gunicorn app:app -c gunicorn_conf.py &

+ 7 - 0
frameworks/Python/falcon/setup_pypy2.sh

@@ -0,0 +1,7 @@
+#!/bin/bash
+
+fw_depends pypy2
+
+pip install --install-option="--prefix=${PYPY2_ROOT}" -r $TROOT/requirements-pypy.txt
+
+gunicorn app:app -c gunicorn_conf.py &

+ 8 - 8
frameworks/Python/flask/benchmark_config.json

@@ -71,8 +71,8 @@
       "notes": "CPython 3.4",
       "versus": "wsgi"
     },
-    "pypy": {
-      "setup_file": "setup_pypy",
+    "pypy2": {
+      "setup_file": "setup_pypy2",
       "json_url": "/json",
       "db_url": "/dbs",
       "query_url": "/db?queries=",
@@ -85,18 +85,18 @@
       "database": "MySQL",
       "framework": "flask",
       "language": "Python",
-      "flavor": "PyPy",
+      "flavor": "PyPy2",
       "orm": "Full",
       "platform": "None",
       "webserver": "Tornado",
       "os": "Linux",
       "database_os": "Linux",
       "display_name": "Flask",
-      "notes": "PyPy 2.5",
+      "notes": "PyPy2",
       "versus": "wsgi"
     },
-    "pypy-mysql-raw": {
-      "setup_file": "setup_pypy",
+    "pypy2-mysql-raw": {
+      "setup_file": "setup_pypy2",
       "db_url": "/dbsraw",
       "query_url": "/dbraw?queries=",
       "fortune_url": "/fortunesraw",
@@ -107,14 +107,14 @@
       "database": "MySQL",
       "framework": "flask",
       "language": "Python",
-      "flavor": "PyPy",
+      "flavor": "PyPy2",
       "orm": "Raw",
       "platform": "Tornado",
       "webserver": "None",
       "os": "Linux",
       "database_os": "Linux",
       "display_name": "Flask-raw",
-      "notes": "PyPy 2.5",
+      "notes": "PyPy2",
       "versus": "wsgi"
     },
     "nginx-uwsgi": {

+ 0 - 7
frameworks/Python/flask/setup_pypy.sh

@@ -1,7 +0,0 @@
-#!/bin/bash
-
-fw_depends mysql pypy
-
-pip install --install-option="--prefix=${PYPY_ROOT}" -r $TROOT/requirements-pypy.txt
-
-gunicorn app:app -c gunicorn_conf.py &

+ 7 - 0
frameworks/Python/flask/setup_pypy2.sh

@@ -0,0 +1,7 @@
+#!/bin/bash
+
+fw_depends mysql pypy2
+
+pip install --install-option="--prefix=${PYPY2_ROOT}" -r $TROOT/requirements-pypy.txt
+
+gunicorn app:app -c gunicorn_conf.py &

+ 3 - 3
frameworks/Python/tornado/benchmark_config.json

@@ -25,8 +25,8 @@
       "notes": "",
       "versus": "tornado"
     },
-    "pypy": {
-      "setup_file": "setup_pypy",
+    "pypy2": {
+      "setup_file": "setup_pypy2",
       "json_url": "/json",
       "db_url": "/db",
       "query_url": "/queries?queries=",
@@ -39,7 +39,7 @@
       "database": "MongoDB",
       "framework": "None",
       "language": "Python",
-      "flavor": "Pypy",
+      "flavor": "PyPy2",
       "orm": "Raw",
       "platform": "None",
       "webserver": "Tornado",

+ 0 - 7
frameworks/Python/tornado/setup_pypy.sh

@@ -1,7 +0,0 @@
-#!/bin/bash
-
-fw_depends mongodb pypy
-
-pip install --install-option="--prefix=${PYPY_ROOT}" -r $TROOT/requirements_mongo.txt
-
-pypy server_py2.py --port=8080 --mongo=$DBHOST --logging=error &

+ 7 - 0
frameworks/Python/tornado/setup_pypy2.sh

@@ -0,0 +1,7 @@
+#!/bin/bash
+
+fw_depends mongodb pypy2
+
+pip install --install-option="--prefix=${PYPY2_ROOT}" -r $TROOT/requirements_mongo.txt
+
+pypy server_py2.py --port=8080 --mongo=$DBHOST --logging=error &

+ 5 - 4
frameworks/Python/weppy/benchmark_config.json

@@ -47,8 +47,8 @@
       "notes": "CPython 3.4",
       "versus": "wsgi"
     },
-    "pypy": {
-      "setup_file": "setup_pypy",
+    "pypy2": {
+      "setup_file": "setup_pypy2",
       "json_url": "/json",
       "db_url": "/db",
       "query_url": "/queries?queries=",
@@ -61,13 +61,14 @@
       "database": "Postgres",
       "framework": "weppy",
       "language": "Python",
+      "flavor": "PyPy2",
       "orm": "Full",
       "platform": "Tornado",
       "webserver": "None",
       "os": "Linux",
       "database_os": "Linux",
-      "display_name": "weppy-PyPy",
-      "notes": "PyPy 2.5",
+      "display_name": "weppy-PyPy2",
+      "notes": "PyPy2",
       "versus": "wsgi"
     },
     "nginx-uwsgi": {

+ 0 - 7
frameworks/Python/weppy/setup_pypy.sh

@@ -1,7 +0,0 @@
-#!/bin/bash
-
-fw_depends postgresql pypy
-
-pip install --install-option="--prefix=${PYPY_ROOT}" -r $TROOT/requirements-pypy.txt
-
-gunicorn app:app -c gunicorn_conf.py &

+ 7 - 0
frameworks/Python/weppy/setup_pypy2.sh

@@ -0,0 +1,7 @@
+#!/bin/bash
+
+fw_depends postgresql pypy2
+
+pip install --install-option="--prefix=${PYPY2_ROOT}" -r $TROOT/requirements-pypy.txt
+
+gunicorn app:app -c gunicorn_conf.py &

+ 1 - 1
toolset/benchmark/framework_test.py

@@ -963,7 +963,7 @@ def validate_test(test_name, test_keys, directory):
       ]
     },
     'platform': {
-      'help': ('platform', 'Name of the platform this framework runs on, e.g. Node.js, Pypy, hhvm, JRuby ...')
+      'help': ('platform', 'Name of the platform this framework runs on, e.g. Node.js, PyPy, hhvm, JRuby ...')
     },
     'framework': {
       # Guranteed to be here and correct at this point

+ 0 - 19
toolset/setup/linux/languages/pypy.sh

@@ -1,19 +0,0 @@
-#!/bin/bash
-
-fw_installed pypy && return 0
-  
-PYPY_ROOT=$IROOT/pypy
-PYPY_VERSION=5.7.1
-
-fw_get -o pypy2-v${PYPY_VERSION}-linux64.tar.bz2 https://bitbucket.org/pypy/pypy/downloads/pypy2-v${PYPY_VERSION}-linux64.tar.bz2
-fw_untar pypy2-v${PYPY_VERSION}-linux64.tar.bz2
-mv pypy2-v${PYPY_VERSION}-linux64 pypy
-
-$PYPY_ROOT/bin/pypy -m ensurepip
-$PYPY_ROOT/bin/pip install -U pip setuptools wheel
-
-echo "export PYPY_ROOT=${PYPY_ROOT}" > $IROOT/pypy.installed
-echo "export PYTHONHOME=${PYPY_ROOT}" >> $IROOT/pypy.installed
-echo -e "export PATH=${PYPY_ROOT}/bin:\$PATH" >> $IROOT/pypy.installed
-  
-source $IROOT/pypy.installed

+ 19 - 0
toolset/setup/linux/languages/pypy2.sh

@@ -0,0 +1,19 @@
+#!/bin/bash
+
+fw_installed pypy2 && return 0
+  
+PYPY2_ROOT=$IROOT/pypy2
+PYPY2_VERSION=5.8.0
+
+fw_get -o pypy2-v${PYPY2_VERSION}-linux64.tar.bz2 https://bitbucket.org/pypy/pypy/downloads/pypy2-v${PYPY2_VERSION}-linux64.tar.bz2
+fw_untar pypy2-v${PYPY2_VERSION}-linux64.tar.bz2
+mv pypy2-v${PYPY2_VERSION}-linux64 pypy2
+
+$PYPY2_ROOT/bin/pypy -m ensurepip
+$PYPY2_ROOT/bin/pip install -U pip setuptools wheel
+
+echo "export PYPY_ROOT=${PYPY2_ROOT}" > $IROOT/pypy2.installed
+echo "export PYTHONHOME=${PYPY2_ROOT}" >> $IROOT/pypy2.installed
+echo -e "export PATH=${PYPY2_ROOT}/bin:\$PATH" >> $IROOT/pypy2.installed
+  
+source $IROOT/pypy2.installed

+ 19 - 0
toolset/setup/linux/languages/pypy3.sh

@@ -0,0 +1,19 @@
+#!/bin/bash
+
+fw_installed pypy3 && return 0
+  
+PYPY3_ROOT=$IROOT/pypy3
+PYPY3_VERSION=5.8.0
+
+fw_get -o pypy3-v${PYPY_VERSION}-linux64.tar.bz2 https://bitbucket.org/pypy/pypy/downloads/pypy3-v${PYPY_VERSION}-linux64.tar.bz2
+fw_untar pypy3-v${PYPY_VERSION}-linux64.tar.bz2
+mv pypy3-v${PYPY_VERSION}-linux64 pypy3
+
+$PYPY_ROOT/bin/pypy3 -m ensurepip
+$PYPY_ROOT/bin/pip install -U pip setuptools wheel
+
+echo "export PYPY3_ROOT=${PYPY3_ROOT}" > $IROOT/pypy3.installed
+echo "export PYTHONHOME=${PYPY3_ROOT}" >> $IROOT/pypy3.installed
+echo -e "export PATH=${PYPY3_ROOT}/bin:\$PATH" >> $IROOT/pypy3.installed
+  
+source $IROOT/pypy3.installed

+ 1 - 1
toolset/setup/linux/languages/python3.sh

@@ -3,7 +3,7 @@
 fw_installed py3 && return 0
   
 PY3_ROOT=$IROOT/py3
-PY3_VERSION=3.6.0
+PY3_VERSION=3.6.1
 
 fw_get -O http://www.python.org/ftp/python/${PY3_VERSION}/Python-${PY3_VERSION}.tar.xz
 fw_untar Python-${PY3_VERSION}.tar.xz