Skip to content

Commit

Permalink
Python 3.7 support
Browse files Browse the repository at this point in the history
- Setup testing for python 3.7 (local tox, travis & appveyor)
- Add Ubuntu support for Vagrant (local linux VM testing)
  • Loading branch information
lowell80 committed Nov 1, 2018
1 parent 5052d01 commit 5dbfdfb
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 11 deletions.
5 changes: 5 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ matrix:
- os: linux
python: '3.6'
env: BUILD_SDIST=true
- os: linux
# Travis Python 3.7 support https://github.com/travis-ci/travis-ci/issues/9069#issuecomment-425720905
python: '3.7'
dist: xenial
sudo: true
- os: osx
language: objective-c
env: PYENV_VERSION=2.7.15
Expand Down
40 changes: 30 additions & 10 deletions Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@ Vagrant.configure("2") do |config|

# Every Vagrant development environment requires a box. You can search for
# boxes at https://vagrantcloud.com/search.

# Should work with either. Take your pick.
config.vm.box = "centos/7"
config.vm.box = "ubuntu/trusty64"

# Disable automatic box update checking. If you disable this, then
# boxes will only be checked for updates when the user runs
Expand Down Expand Up @@ -63,8 +66,18 @@ Vagrant.configure("2") do |config|

# https://gist.github.com/clozed2u/b0421d8af60e26d97372
config.vm.provision "shell", privileged: false, inline: <<-SHELL
sudo yum install -y vim
sudo yum install -y gcc gcc-c++ make git patch openssl-devel zlib-devel readline-devel sqlite-devel bzip2-devel
if [[ -x $(command -v yum ) ]]; then
echo "Using RedHat/CentOS package names..."
sudo yum install -y vim
sudo yum install -y gcc gcc-c++ make git patch openssl-devel zlib-devel readline-devel sqlite-devel bzip2-devel xz-devel libffi-devel
else
echo "Assuming debian base distro. Using 'apt'"
sudo apt install -y vim
sudo apt install -y build-essential git
sudo apt install -y libssl-dev zlib1g-dev libncurses5-dev libncursesw5-dev libreadline-dev libsqlite3-dev libgdbm-dev libdb5.3-dev libbz2-dev libexpat1-dev liblzma-dev libffi-dev
fi
git clone git://github.com/yyuu/pyenv.git ~/.pyenv --depth=20
echo 'export PATH="$HOME/.pyenv/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(pyenv init -)"' >> ~/.bashrc
Expand All @@ -74,16 +87,23 @@ Vagrant.configure("2") do |config|
echo 'GIT_PROMPT_ONLY_IN_REPO=1' >> ~/.bashrc
echo 'source ~/.bash-git-prompt/gitprompt.sh' >> ~/.bashrc
# Reload shell
source ~/.bashrc
# Prep shell
export PATH="$HOME/.pyenv/bin:$PATH"
eval "$(pyenv init -)"
# Keep python versions in just one list to reduce number of edits and typos ;-)
PYVERS="2.7.15 3.7.1 3.6.7 3.5.6 3.4.9 pypy2.7-6.0.0"
for ver in $PYVERS
do
pyenv install $ver && echo $ver >> ~/.pyver-installed-okay
done
pyenv install 2.7.15
pyenv install 3.6.5
pyenv install 3.5.5
pyenv install 3.4.8
pyenv install pypy2.7-6.0.0
# Fallback to the first version (in case any compiles fail) : pyver global ${PYVERS%% *}
pyenv global $(cat ~/.pyver-installed-okay)
pyenv global 2.7.15 3.6.5 3.5.5 3.4.8 pypy2.7-6.0.0
# Another option: (down side, priority list is different, but 2.7 is still the first. Probably be good enough)
# pyenv global $(pyenv versions --bare)
pyenv rehash
# Intall tox
Expand Down
2 changes: 2 additions & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ environment:
- PYTHON: "C:\\Python35-x64"
- PYTHON: "C:\\Python36"
- PYTHON: "C:\\Python36-x64"
- PYTHON: "C:\\Python37"
- PYTHON: "C:\\Python37-x64"

# scripts that are called at very beginning, before repo cloning
init:
Expand Down
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ def get_ver():
"Programming Language :: Python :: 3.4",
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Topic :: Utilities",
],
python_requires='>=2.7,!=3.0.*,!=3.1.*',
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, py34, py35, py36, pypy
envlist = py27, py34, py35, py36, py37, pypy

[testenv]
commands = {envpython} setup.py install
Expand Down

0 comments on commit 5dbfdfb

Please sign in to comment.