├── .gitignore ├── tox.ini ├── .pre-commit-config.yaml ├── .travis.yml └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | /.tox 2 | -------------------------------------------------------------------------------- /tox.ini: -------------------------------------------------------------------------------- 1 | [tox] 2 | skipsdist = true 3 | 4 | [testenv] 5 | commands = 6 | python --version --version 7 | -------------------------------------------------------------------------------- /.pre-commit-config.yaml: -------------------------------------------------------------------------------- 1 | repos: 2 | - repo: https://github.com/pre-commit/pre-commit-hooks 3 | rev: v2.1.0 4 | hooks: 5 | - id: trailing-whitespace 6 | - id: end-of-file-fixer 7 | - id: check-yaml 8 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: python 2 | matrix: 3 | include: 4 | # others still work and don't install python3.7 5 | - env: TOXENV=py36 6 | python: 3.6 7 | - env: TOXENV=py37 8 | python: 3.7 9 | dist: xenial 10 | - env: TOXENV=py37 11 | dist: xenial 12 | addons: 13 | apt: 14 | sources: 15 | - deadsnakes 16 | packages: 17 | - python3.7-dev 18 | install: pip install tox 19 | script: tox 20 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [![Build Status](https://travis-ci.org/deadsnakes/travis-ci-python3.7-example.svg?branch=master)](https://travis-ci.org/deadsnakes/travis-ci-python3.7-example) 2 | 3 | travis-ci-python3.7-example 4 | =========================== 5 | 6 | _2018-07-01_: nearly all travis-ci VMs run Ubuntu trusty which ships with 7 | openssl 1.0.1. python3.7 [dropped][python3.7-pr] support for end-of-lifed 8 | openssl versions. 9 | 10 | travis-ci has a `xenial` distribution which can be enabled with `dist: xenial`. 11 | The `python: 3.7-dev` virtualenv provided by travis-ci for trusty is still 12 | 3.7a4 which is quite a bit different from 3.7.0 final. 13 | 14 | deadsnakes provides a backport of python3.7 for ubuntu xenial which can be 15 | enabled using the [travis-ci apt addon][travis-ci-apt-addon]. 16 | 17 | This repository contains a sample `.travis.yml` which installs python3.7 from 18 | deadsnakes and invokes `tox`. 19 | 20 | The tl;dr magic to enable this: 21 | 22 | ```yaml 23 | dist: xenial 24 | addons: 25 | apt: 26 | sources: 27 | - deadsnakes 28 | packages: 29 | - python3.7-dev 30 | ``` 31 | 32 | It is suggested to use the [travis-ci matrix][travis-ci-matrix] feature to 33 | only install `python3.7` once as the `apt` add on adds a significant amount of 34 | time to the build. The example `.travis.yml` does this. 35 | 36 | ### update (2018-07-03) 37 | 38 | travis-ci has enabled `python: 3.7` on `dist: xenial` so deadsnakes is no 39 | longer necessary: 40 | 41 | ```yaml 42 | - env: TOXENV=py37 43 | python: 3.7 44 | dist: xenial 45 | ``` 46 | 47 | _update 2018-10-15_: `sudo: required` is no longer necessary 48 | 49 | 50 | [python3.7-pr]: https://github.com/python/cpython/pull/3462 51 | [travis-ci-apt-addon]: https://docs.travis-ci.com/user/installing-dependencies#Installing-Packages-with-the-APT-Addon 52 | [travis-ci-matrix]: https://docs.travis-ci.com/user/customizing-the-build#Explicitly-Including-Jobs 53 | --------------------------------------------------------------------------------