Skip to content

Commit 41454a2

Browse files
authored
Support py34 and py35 (#39)
- Update circle/ci config - workaround for python 3.4 - Document python 3.4 and 3.5 support
1 parent 7469069 commit 41454a2

5 files changed

Lines changed: 34 additions & 5 deletions

File tree

.circleci/config.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,30 @@ jobs:
1515
name: Run Tests
1616
command: python -m unittest discover tests
1717

18+
py34:
19+
docker:
20+
- image: circleci/python:3.4.10
21+
steps:
22+
- checkout
23+
- run:
24+
name: Install Requirements
25+
command: pip install -r requirements.txt -r requirements-dev27.txt --user
26+
- run:
27+
name: Run Tests
28+
command: python -m unittest
29+
30+
py35:
31+
docker:
32+
- image: circleci/python:3.5.7
33+
steps:
34+
- checkout
35+
- run:
36+
name: Install Requirements
37+
command: pip install -r requirements.txt -r requirements-dev27.txt --user
38+
- run:
39+
name: Run Tests
40+
command: python -m unittest
41+
1842
py36:
1943
docker:
2044
- image: circleci/python:3.6.8
@@ -56,5 +80,7 @@ workflows:
5680
run_tests:
5781
jobs:
5882
- py27
83+
- py34
84+
- py35
5985
- py36
6086
- py37

docs/contributing.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ Before submiting a pull request, check that it meets these guidelines:
100100
Put your new functionality into a function with a docstring, and add the
101101
feature to the list in [README](https://github.com/PokeAPI/pokepy/blob/master/README.md).
102102

103-
**3 .** The pull request should work for Python 2.7, 3.6, and 3.7.
103+
**3 .** The pull request should work for Python 2.7, 3.4, 3.5, 3.6, and 3.7.
104104

105105
### Tips
106106
To run a subset of tests:

pokepy/api.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -215,9 +215,10 @@ def memoize(func):
215215

216216
if disk_or_memory == 'disk':
217217
if cache_directory:
218-
# Python 2 workaround
219-
if sys.version_info[0] == 2 and not isinstance(cache_directory, str):
220-
raise TypeError('expected str')
218+
# Python 2 and 3.4 workaround
219+
if (sys.version_info[0] == 2 or sys.version_info[0:2] == (3, 4)) and \
220+
not isinstance(cache_directory, str):
221+
raise TypeError('expected str, not %s' % cache_directory.__class__.__name__)
221222

222223
_global_cache_dir = os.path.join(cache_directory, 'pokepy_cache')
223224
cache_dir = os.path.join(_global_cache_dir, str(get_methods_id[0]))

setup.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@
4141
'Programming Language :: Python :: 2',
4242
'Programming Language :: Python :: 2.7',
4343
'Programming Language :: Python :: 3',
44+
'Programming Language :: Python :: 3.4',
45+
'Programming Language :: Python :: 3.5',
4446
'Programming Language :: Python :: 3.6',
4547
'Programming Language :: Python :: 3.7',
4648
],

tox.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[tox]
2-
envlist = py27,py36,py37
2+
envlist = py27,py34,py35,py36,py37
33

44
[testenv]
55
setenv =

0 commit comments

Comments
 (0)