Skip to content

Commit

Permalink
feat: travis CI support for Python 3.7 (aws#679)
Browse files Browse the repository at this point in the history
  • Loading branch information
sriram-mv authored and jfuss committed Oct 9, 2018
1 parent 5188e8e commit e074fb3
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 6 deletions.
7 changes: 7 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@ python:
- "2.7"
- "3.6"

# Enable 3.7 without globally enabling sudo and dist: xenial for other build jobs
matrix:
include:
- python: 3.7
dist: xenial
sudo: true

install:
# Install the code requirements
- make init
Expand Down
13 changes: 8 additions & 5 deletions DEVELOPMENT_GUIDE.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Environment Setup

1. Install Python Versions
~~~~~~~~~~~~~~~~~~~~~~~~~~
We support both Python 2.7 and 3.6 versions.
We support Python 2.7, 3.6 and 3.7 versions.
Follow the idioms from this `excellent cheatsheet`_ to make sure your code is compatible with both Python versions.
Our CI/CD pipeline is setup to run unit tests against both Python versions. So make sure you test it with both
versions before sending a Pull Request. `pyenv`_ is a great tool to easily setup multiple Python versions.
Expand All @@ -24,16 +24,19 @@ versions before sending a Pull Request. `pyenv`_ is a great tool to easily setup
#. Install PyEnv - ``curl -L https://github.com/pyenv/pyenv-installer/raw/master/bin/pyenv-installer | bash``
#. ``pyenv install 2.7.14``
#. ``pyenv install 3.6.4``
#. Make both Python versions available in the project: ``pyenv local 3.6.4 2.7.14``
#. ``pyenv install 3.7.0``
#. Make Python versions available in the project: ``pyenv local 3.6.4 2.7.14 3.7.0``


2. Activate Virtualenv
~~~~~~~~~~~~~~~~~~~~~~
Virtualenv allows you to install required libraries outside of the Python installation. A good practice is to setup
a different virtualenv for each project. `pyenv`_ comes with a handy plugin that can create virtualenv.

#. Create new virtualenv if it does not exist: ``pyenv virtualenv 2.7.14 samcli27`` and ``pyenv virtualenv 3.6.4 samcli36``
#. ``pyenv activate samcli27`` for Python2.7 or ``pyenv activate samcli36`` for Python3.6
Depending on the python version, the following commands would change to be the appropriate python version.

#. ``pyenv virtualenv 3.7.0 samcli36``
#. ``pyenv activate samcli37`` for Python3.7


3. Install dev version of SAM CLI
Expand All @@ -42,7 +45,7 @@ We will install a development version of SAM CLI from source into the virtualenv
make changes. We will install in a command called ``samdev`` to keep it separate from a global SAM CLI installation,
if any.

#. Activate Virtualenv: ``pyenv activate samcli27`` or ``pyenv activate samcli36``
#. Activate Virtualenv: ``pyenv activate samcli37``
#. Install dev CLI: ``make init``
#. Make sure installation succeeded: ``which samdev``

Expand Down
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ def read_version():
'Programming Language :: Python',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Topic :: Internet',
'Topic :: Software Development :: Build Tools',
'Topic :: Utilities',
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# and then run "tox" from this directory.

[tox]
envlist = py27, py36
envlist = py27, py36, py37

[testenv]
whitelist_externals = make
Expand Down

0 comments on commit e074fb3

Please sign in to comment.