Skip to content

Commit 1bbc1df

Browse files
committed
Add support for py35, pypy with cryptography>=1.0
Add support and testing for: - CPython 3.5 - cryptography>=1.0 on PyPy 2.6.0. PyPy 2.6 isn't available by default on Travis CI. Only PyPy 2.5 is, but that is incompatible with cryptography>=1.0 [1]. Borrow some of the Travis CI setup from the PyCA's cryptography project [2], which installs pyenv [3] in order to bootstrap an installation for PyPy 2.6. [1] <travis-ci/travis-ci#4756> [2] <https://github.com/pyca/cryptography/tree/master/.travis> [3] <https://github.com/yyuu/pyenv>
1 parent fd6d22b commit 1bbc1df

File tree

9 files changed

+131
-28
lines changed

9 files changed

+131
-28
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ var/
2727
*.egg
2828
MANIFEST
2929
.eggs/
30+
.pyenv/
31+
.venv/
3032

3133
# PyInstaller
3234
# Usually these files are written by a python script from a template

.travis.yml

Lines changed: 31 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,39 @@
11
sudo: false
22
language: python
3-
python: 2.7
4-
env:
5-
- TOX_ENV=py26
6-
- TOX_ENV=py27
7-
- TOX_ENV=py33
8-
- TOX_ENV=py34
9-
- TOX_ENV=pypy
10-
- TOX_ENV=pep8
11-
- TOX_ENV=pylint
12-
- TOX_ENV=coverage
3+
4+
cache:
5+
directories:
6+
- $HOME/.cache/pip
7+
8+
before_cache:
9+
- rm -r -f $HOME/.cache/pip/log
10+
11+
matrix:
12+
include:
13+
- python: 2.6
14+
env: TOX_ENV=py26
15+
- python: 2.7
16+
env: TOX_ENV=py27
17+
- python: 3.3
18+
env: TOX_ENV=py33
19+
- python: 3.4
20+
env: TOX_ENV=py34
21+
- python: 3.5
22+
env: TOX_ENV=py35
23+
- python: pypy
24+
env: TOX_ENV=pypy
25+
- python: 2.7
26+
env: TOX_ENV=pep8
27+
- python: 2.7
28+
env: TOX_ENV=pylint
29+
- python: 2.7
30+
env: TOX_ENV=coverage
31+
1332
# commands to install dependencies
1433
install:
15-
- pip install tox --use-mirrors
34+
- ./.travis/install.sh
1635
# commands to run
1736
script:
18-
- tox -e $TOX_ENV
37+
- ./.travis/run.sh
1938
after_success:
2039
- if [ "-x$TOX_ENV" = "xcoverage" ]; then coveralls; fi

.travis/install.sh

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
#!/bin/bash
2+
3+
# Originally from
4+
# <https://github.com/pyca/cryptography/blob/d93aa99636b06d5d403130425098b2f0cc1b516e/.travis/install.sh>.
5+
6+
set -e
7+
set -x
8+
set -o pipefail
9+
10+
git clean -f -d -X
11+
rm -r -f $PWD/.pyenv # Apparently `git-clean` won't remove other repositories.
12+
13+
if [[ "$(uname -s)" == 'Darwin' ]]; then
14+
brew update || brew update
15+
brew install pyenv
16+
brew outdated pyenv || brew upgrade pyenv
17+
18+
if which -s pyenv; then
19+
rm -r -f $HOME/.pyenv
20+
eval "$(pyenv init -)"
21+
fi
22+
23+
case "${TOX_ENV}" in
24+
py26)
25+
curl -O https://bootstrap.pypa.io/get-pip.py
26+
python get-pip.py --user
27+
;;
28+
py27)
29+
curl -O https://bootstrap.pypa.io/get-pip.py
30+
python get-pip.py --user
31+
;;
32+
py33)
33+
pyenv install 3.3.6
34+
pyenv global 3.3.6
35+
;;
36+
py34)
37+
pyenv install 3.4.2
38+
pyenv global 3.4.2
39+
;;
40+
py35)
41+
pyenv install 3.5.0
42+
pyenv global 3.5.0
43+
;;
44+
pypy)
45+
pyenv install pypy-2.6.0
46+
pyenv global pypy-2.6.0
47+
;;
48+
esac
49+
pyenv rehash
50+
python -m pip install -U --user virtualenv
51+
else
52+
# temporary pyenv installation to get pypy-2.6 before container infra upgrade
53+
if [[ "${TOX_ENV}" == "pypy" ]]; then
54+
git clone https://github.com/yyuu/pyenv.git $PWD/.pyenv
55+
export PYENV_ROOT="$PWD/.pyenv"
56+
export PATH="$PYENV_ROOT/bin:$PATH"
57+
eval "$(pyenv init -)"
58+
pyenv install pypy-2.6.0
59+
pyenv global pypy-2.6.0
60+
fi
61+
pip install -U virtualenv
62+
fi
63+
64+
python -m virtualenv $PWD/.venv
65+
source $PWD/.venv/bin/activate
66+
pip install -U tox

.travis/run.sh

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/bin/bash
2+
3+
# Originally from
4+
# <https://github.com/pyca/cryptography/blob/d93aa99636b06d5d403130425098b2f0cc1b516e/.travis/install.sh>.
5+
6+
set -e
7+
set -x
8+
set -o pipefail
9+
10+
if [[ "$(uname -s)" == "Darwin" ]]; then
11+
eval "$(pyenv init -)"
12+
else
13+
if [[ "${TOX_ENV}" == "pypy" ]]; then
14+
export PYENV_ROOT="$PWD/.pyenv"
15+
export PATH="$PYENV_ROOT/bin:$PATH"
16+
eval "$(pyenv init -)"
17+
pyenv global pypy-2.6.0
18+
fi
19+
fi
20+
source $PWD/.venv/bin/activate
21+
tox -e $TOX_ENV -- $TOX_FLAGS

HISTORY.rst

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ Release History
66
Upcoming
77
++++++++
88

9+
- CPython 3.5 support.
10+
- Support for cryptography>=1.0 on PyPy 2.6.
11+
- Travis CI testing for CPython 3.5 and PyPy 2.6.0.
12+
913
1.2.1 (2015-07-22)
1014
++++++++++++++++++
1115

@@ -100,4 +104,4 @@ Upcoming
100104

101105
**Bugfixes**
102106

103-
- Oauth2 redirect URIs containing non-ASCII characters are now supported.
107+
- Oauth2 redirect URIs containing non-ASCII characters are now supported.

README.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -311,8 +311,8 @@ Run all tests using -
311311
312312
The tox tests include code style checks via pep8 and pylint.
313313

314-
The tox tests are configured to run on Python 2.6, 2.7, 3.3, 3.4, and
315-
PyPy.
314+
The tox tests are configured to run on Python 2.6, 2.7, 3.3, 3.4, 3.5, and
315+
PyPy 2.6.
316316

317317

318318
Support

requirements.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
cryptography>=0.9.2
2-
enum34>=1.0.4
3-
ordereddict>=1.1
42
pyjwt>=1.3.0
53
requests>=2.4.3
64
six >= 1.4.0
5+
.

setup.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
'Programming Language :: Python :: 2.7',
2121
'Programming Language :: Python :: 3.3',
2222
'Programming Language :: Python :: 3.4',
23+
'Programming Language :: Python :: 3.5',
2324
'Programming Language :: Python :: Implementation :: CPython',
2425
'Programming Language :: Python :: Implementation :: PyPy',
2526
'Operating System :: OS Independent',
@@ -52,11 +53,7 @@ def run_tests(self):
5253
def main():
5354
base_dir = dirname(__file__)
5455
install_requires = ['requests>=2.4.3', 'six>=1.4.0']
55-
jwt_requires = ['pyjwt>=1.3.0']
56-
if platform.python_implementation() == 'PyPy':
57-
jwt_requires.append('cryptography>=0.9.2, <1.0')
58-
else:
59-
jwt_requires.append('cryptography>=0.9.2')
56+
jwt_requires = ['pyjwt>=1.3.0', 'cryptography>=0.9.2']
6057
if version_info < (3, 4):
6158
install_requires.append('enum34>=1.0.4')
6259
elif version_info < (2, 7):

tox.ini

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ envlist =
99
py27,
1010
py33,
1111
py34,
12+
py35,
1213
pypy,
1314
pep8,
1415
pylint,
@@ -21,12 +22,6 @@ commands =
2122
py.test test/ {posargs}
2223
deps = -rrequirements-dev.txt
2324

24-
[testenv:pypy]
25-
deps = -rrequirements-dev.txt
26-
commands =
27-
pip install cryptography==0.9.3 --upgrade
28-
py.test test/ {posargs}
29-
3025
[testenv:rst]
3126
deps =
3227
docutils

0 commit comments

Comments
 (0)