Repository: falconry/falcon
Pull request #1437 (2019-02-11 20:20:44)

chore: add official support for CPython 3.7
Addresses https://github.com/falconry/falcon/issues/1405

For the reference: I am leaving Hug tests at CPython 3.6, it seems that Hug's pinned build requirements fail to install under 3.7.
Filed as: https://github.com/timothycrosley/hug/issues/725

codecov[bot]: # [Codecov](https://codecov.io/gh/falconry/falcon/pull/1437?src=pr&el=h1) Report
> Merging [#1437](https://codecov.io/gh/falconry/falcon/pull/1437?src=pr&el=desc) into [master](https://codecov.io/gh/falconry/falcon/commit/14b482a568298ade230a3ff103e8f20cddd3272f?src=pr&el=desc) will **not change** coverage.
> The diff coverage is `n/a`.

[![Impacted file tree graph](https://codecov.io/gh/falconry/falcon/pull/1437/graphs/tree.svg?width=650&token=zOtkfNQ3h6&height=150&src=pr)](https://codecov.io/gh/falconry/falcon/pull/1437?src=pr&el=tree)

```diff
@@          Coverage Diff           @@
##           master   #1437   +/-   ##
======================================
  Coverage     100%    100%           
======================================
  Files          39      39           
  Lines        2565    2565           
  Branches      396     396           
======================================
  Hits         2565    2565
```



------

[Continue to review full report at Codecov](https://codecov.io/gh/falconry/falcon/pull/1437?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/falconry/falcon/pull/1437?src=pr&el=footer). Last update [14b482a...5c75d04](https://codecov.io/gh/falconry/falcon/pull/1437?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).

codecov[bot]: # [Codecov](https://codecov.io/gh/falconry/falcon/pull/1437?src=pr&el=h1) Report
> Merging [#1437](https://codecov.io/gh/falconry/falcon/pull/1437?src=pr&el=desc) into [master](https://codecov.io/gh/falconry/falcon/commit/14b482a568298ade230a3ff103e8f20cddd3272f?src=pr&el=desc) will **not change** coverage.
> The diff coverage is `n/a`.

[![Impacted file tree graph](https://codecov.io/gh/falconry/falcon/pull/1437/graphs/tree.svg?width=650&token=zOtkfNQ3h6&height=150&src=pr)](https://codecov.io/gh/falconry/falcon/pull/1437?src=pr&el=tree)

```diff
@@          Coverage Diff           @@
##           master   #1437   +/-   ##
======================================
  Coverage     100%    100%           
======================================
  Files          39      39           
  Lines        2565    2565           
  Branches      396     396           
======================================
  Hits         2565    2565
```



------

[Continue to review full report at Codecov](https://codecov.io/gh/falconry/falcon/pull/1437?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/falconry/falcon/pull/1437?src=pr&el=footer). Last update [14b482a...5c75d04](https://codecov.io/gh/falconry/falcon/pull/1437?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).


Patch:
diff --git a/.travis.yml b/.travis.yml
index 68b60f6..97bc0a3 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,7 +1,6 @@
 language: python
 
 dist: xenial
-sudo: false
 
 install: pip install tox coveralls
 cache:
@@ -20,8 +19,6 @@ matrix:
           env: TOXENV=pep8-examples
         - python: 2.7
           env: TOXENV=py27
-        - python: 2.7
-          env: TOXENV=py27_ujson
         - python: 2.7
           env: TOXENV=py27_smoke
         - python: 2.7
@@ -34,12 +31,14 @@ matrix:
           env: TOXENV=py35
         - python: 3.6
           env: TOXENV=py36
-        - python: 3.6
-          env: TOXENV=py36_cython
-        - python: 3.6
-          env: TOXENV=py36_smoke
-        - python: 3.6
-          env: TOXENV=py36_smoke_cython
+        - python: 3.7
+          env: TOXENV=py37
+        - python: 3.7
+          env: TOXENV=py37_cython
+        - python: 3.7
+          env: TOXENV=py37_smoke
+        - python: 3.7
+          env: TOXENV=py37_smoke_cython
         - python: 2.7
           env: TOXENV=docs
         # TODO(kgriffs): Re-enable once we have mitigated the stream_len
@@ -59,6 +58,8 @@ notifications:
     on_failure: always
 
 before_install:
+  - sudo apt-get update
+  - sudo apt-get install -y libunwind-dev
   - pip install codecov
 
 after_success:
diff --git a/CHANGES.rst b/CHANGES.rst
index 6686672..8449a45 100644
--- a/CHANGES.rst
+++ b/CHANGES.rst
@@ -37,6 +37,8 @@ Breaking Changes
 Changes to Supported Platforms
 ------------------------------
 
+- CPython 3.7 is now fully supported.
+
 New & Improved
 --------------
 
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index d5bf3b1..7b83d2e 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -27,19 +27,19 @@ Please note that all contributors and maintainers of this project are subject to
 
 Before submitting a pull request, please ensure you have added or updated tests as appropriate, and that all existing tests still pass with your changes on both Python 2 and Python 3. Please also ensure that your coding style follows PEP 8.
 
-You can check all this by running the following from within the Falcon project directory (requires Python 2.7 and Python 3.6 to be installed on your system):
+You can check all this by running the following from within the Falcon project directory (requires Python 2.7 and Python 3.7 to be installed on your system):
 
 ```bash
 $ pip install tox
-$ tox -e py27,py36,pep8
+$ tox -e py27,py37,pep8
 ```
 
-You may also use Python 3.4 or 3.5 if you don't have 3.6 installed on your system. This is just a quick sanity check to verify that your patch works across both Python 2 and Python 3.
+You may also use Python 3.5 or 3.6 if you don't have 3.7 installed on your system. This is just a quick sanity check to verify that your patch works across both Python 2 and Python 3.
 
 If you are using pyenv and get an error along the lines of "failed to get version_info", you will need to activate all the Python versions required by tox before trying again. For example:
 
 ```bash
-$ pyenv shell 2.7.14 3.6.4
+$ pyenv shell 2.7.14 3.7.2
 ```
 
 #### Reviews
@@ -101,8 +101,8 @@ $ tox -e py27_bench -- -b falcon -i 20000
 Alternatively, you may run falcon-bench directly by creating a new virtual environment and installing falcon directly in development mode. In this example we use pyenv with pyenv-virtualenv from within a falcon source directory:
 
 ```bash
-$ pyenv virtualenv 3.6.2 falcon-sandbox-36
-$ pyenv shell falcon-sandbox-36
+$ pyenv virtualenv 3.7.2 falcon-sandbox-37
+$ pyenv shell falcon-sandbox-37
 $ pip install -r requirements/bench
 $ pip install -e .
 $ falcon-bench
diff --git a/docker/Makefile b/docker/Makefile
index fdf2198..8b9b976 100644
--- a/docker/Makefile
+++ b/docker/Makefile
@@ -3,14 +3,14 @@ all: build-benchmark-images
 build-benchmark-images:
 	sudo docker pull python:2.7-slim
 	sudo docker pull python:2.7
-	sudo docker pull python:3.6-slim
-	sudo docker pull python:3.6
+	sudo docker pull python:3.7-slim
+	sudo docker pull python:3.7
 	sudo docker pull pypy:2-slim
 	sudo docker pull pypy:3-slim
 
 	sudo docker build -t falconry/falcon-bench:py27 -f bench_py27.Dockerfile ./
 	sudo docker build -t falconry/falcon-bench:py27-cython -f bench_py27_cython.Dockerfile ./
-	sudo docker build -t falconry/falcon-bench:py36 -f bench_py36.Dockerfile ./
-	sudo docker build -t falconry/falcon-bench:py36-cython -f bench_py36_cython.Dockerfile ./
+	sudo docker build -t falconry/falcon-bench:py37 -f bench_py37.Dockerfile ./
+	sudo docker build -t falconry/falcon-bench:py37-cython -f bench_py37_cython.Dockerfile ./
 	sudo docker build -t falconry/falcon-bench:pypy2 -f bench_pypy2.Dockerfile ./
 	sudo docker build -t falconry/falcon-bench:pypy3 -f bench_pypy3.Dockerfile ./
diff --git a/docker/bench_py27_cython.Dockerfile b/docker/bench_py27_cython.Dockerfile
index 0cb5875..786902d 100644
--- a/docker/bench_py27_cython.Dockerfile
+++ b/docker/bench_py27_cython.Dockerfile
@@ -4,7 +4,7 @@ MAINTAINER Falcon Framework Maintainers
 RUN pip install cython
 
 # We don't currently benchmark JSON deserialization, but in the future we might
-RUN pip install ujson
+# RUN pip install ujson
 
 RUN pip install -v --no-cache-dir --no-binary :all: falcon
 RUN pip install --no-cache-dir bottle "django<2" flask
diff --git a/docker/bench_py36.Dockerfile b/docker/bench_py37.Dockerfile
similarity index 89%
rename from docker/bench_py36.Dockerfile
rename to docker/bench_py37.Dockerfile
index ba9e9ed..43a4c6a 100644
--- a/docker/bench_py36.Dockerfile
+++ b/docker/bench_py37.Dockerfile
@@ -1,4 +1,4 @@
-FROM python:3.6-slim
+FROM python:3.7-slim
 MAINTAINER Falcon Framework Maintainers
 
 RUN pip install --no-cache-dir falcon
diff --git a/docker/bench_py36_cython.Dockerfile b/docker/bench_py37_cython.Dockerfile
similarity index 88%
rename from docker/bench_py36_cython.Dockerfile
rename to docker/bench_py37_cython.Dockerfile
index 11169b1..f7656fa 100644
--- a/docker/bench_py36_cython.Dockerfile
+++ b/docker/bench_py37_cython.Dockerfile
@@ -1,10 +1,10 @@
-FROM python:3.6
+FROM python:3.7
 MAINTAINER Falcon Framework Maintainers
 
 RUN pip install cython
 
 # We don't currently benchmark JSON deserialization, but in the future we might
-RUN pip install ujson
+# RUN pip install orjson
 
 RUN pip install -v --no-cache-dir --no-binary :all: falcon
 RUN pip install --no-cache-dir bottle "django<2" flask
diff --git a/docs/changes/2.0.0.rst b/docs/changes/2.0.0.rst
index 433d5be..e50d2e5 100644
--- a/docs/changes/2.0.0.rst
+++ b/docs/changes/2.0.0.rst
@@ -39,6 +39,8 @@ Breaking Changes
 Changes to Supported Platforms
 ------------------------------
 
+- CPython 3.7 is now fully supported.
+
 New & Improved
 --------------
 
diff --git a/setup.py b/setup.py
index c4bc99d..07cc66c 100644
--- a/setup.py
+++ b/setup.py
@@ -118,6 +118,7 @@ setup(
         'Programming Language :: Python :: 3.4',
         'Programming Language :: Python :: 3.5',
         'Programming Language :: Python :: 3.6',
+        'Programming Language :: Python :: 3.7',
     ],
     keywords='wsgi web api framework rest http cloud',
     author='Kurt Griffiths',
diff --git a/tox.ini b/tox.ini
index 56304a6..24e9cd8 100644
--- a/tox.ini
+++ b/tox.ini
@@ -2,7 +2,7 @@
 
 # --------------------------------------------------------------------
 #
-# NOTE(kgriffs): The py27, and py36 envs are required when
+# NOTE(kgriffs): The py27, and py37 envs are required when
 # checking combined coverage. To check coverage:
 #
 #   $ tools/mintest.sh
@@ -10,7 +10,7 @@
 # Which is equivalent to:
 #
 #   $ rm -f .coverage.*
-#   $ tox -e py27,py36,pep8 && tools/testing/combine_coverage.sh
+#   $ tox -e py27,py37,pep8 && tools/testing/combine_coverage.sh
 #
 # You can then drill down into coverage details by opening the HTML
 # report at ".coverage_html/index.html".
@@ -20,12 +20,12 @@
 # the python version required by tox before trying again. For
 # example:
 #
-#   $ pyenv shell 2.7.13 3.6.2
+#   $ pyenv shell 2.7.13 3.7.2
 #
 # --------------------------------------------------------------------
 
 envlist = py27,
-          py36,
+          py37,
           pep8,
           docs
 
@@ -115,6 +115,10 @@ deps = {[with-cython]deps}
 basepython = python3.6
 deps = {[with-cython]deps}
 
+[testenv:py37_cython]
+basepython = python3.7
+deps = {[with-cython]deps}
+
 # --------------------------------------------------------------------
 # Smoke testing with a sample app
 # --------------------------------------------------------------------
@@ -133,13 +137,13 @@ deps = -r{toxinidir}/requirements/bench
        cython
 commands = {[smoke-test]commands}
 
-[testenv:py36_smoke]
-basepython = python3.6
+[testenv:py37_smoke]
+basepython = python3.7
 deps = -r{toxinidir}/requirements/bench
 commands = {[smoke-test]commands}
 
-[testenv:py36_smoke_cython]
-basepython = python3.6
+[testenv:py37_smoke_cython]
+basepython = python3.7
 deps = -r{toxinidir}/requirements/bench
        cython
 commands = {[smoke-test]commands}
@@ -204,8 +208,8 @@ basepython = python2.7
 deps = gunicorn
 commands = gunicorn -b localhost:8000 tests.dump_wsgi
 
-[testenv:py36_dump_gunicorn]
-basepython = python3.6
+[testenv:py37_dump_gunicorn]
+basepython = python3.7
 deps = gunicorn
 commands = gunicorn -b localhost:8000 tests.dump_wsgi
 
@@ -218,8 +222,8 @@ commands = waitress-serve --listen=localhost:8000 tests.dump_wsgi:application
 basepython = python2.7
 commands = python tests/dump_wsgi.py
 
-[testenv:py36_dump_wsgiref]
-basepython = python3.6
+[testenv:py37_dump_wsgiref]
+basepython = python3.7
 commands = python tests/dump_wsgi.py
 
 # --------------------------------------------------------------------
@@ -270,6 +274,17 @@ deps = -r{toxinidir}/requirements/bench
        cython
 commands = falcon-bench []
 
+[testenv:py37_bench]
+basepython = python3.7
+deps = -r{toxinidir}/requirements/bench
+commands = falcon-bench []
+
+[testenv:py37_bench_cython]
+basepython = python3.7
+deps = -r{toxinidir}/requirements/bench
+       cython
+commands = falcon-bench []
+
 [testenv:pypy_bench]
 basepython = pypy
 deps = -r{toxinidir}/requirements/bench


Test patch:
diff --git a/tools/mintest.sh b/tools/mintest.sh
index f386747..3ed7c98 100755
--- a/tools/mintest.sh
+++ b/tools/mintest.sh
@@ -1,4 +1,4 @@
 #!/usr/bin/env bash
 
 rm -f .coverage.*
-tox -e py27,py36,pep8 && tools/testing/combine_coverage.sh
+tox -e py27,py37,pep8 && tools/testing/combine_coverage.sh