Skip to content

Commit fea3f2e

Browse files
authored
opentrons module raises exception if python version is not 3.5 (#158)
* opentrons module raises exception if python version is not 3.5 * ups travis and appveyor to python 3.5 * adds tests for coverage * pylama
1 parent db2e183 commit fea3f2e

File tree

4 files changed

+21
-4
lines changed

4 files changed

+21
-4
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
sudo: false
22
language: python
33
python:
4-
- '3.4'
4+
- '3.5'
55
before_install:
66
- openssl aes-256-cbc -K $encrypted_f176ff9ac49f_key -iv $encrypted_f176ff9ac49f_iv -in .pypirc.enc -out $HOME/.pypirc -d
77
install:

appveyor.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ environment:
66
CMD_IN_ENV: "cmd /E:ON /V:ON /C .\\appveyor\\run_with_env.cmd"
77

88
matrix:
9-
- PYTHON: "C:\\Python34-x64"
10-
PYTHON_VERSION: "3.4.x" # currently 3.4.3
9+
- PYTHON: "C:\\Python35-x64"
10+
PYTHON_VERSION: "3.5.x" # currently 3.4.3
1111
PYTHON_ARCH: "64"
1212

1313
- PYTHON: "C:\\Python35-x64"

opentrons/__init__.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,21 @@
1+
import sys
2+
13
from opentrons.robot.robot import Robot
24
from opentrons.robot.command import Command
35

6+
from ._version import get_versions
7+
8+
9+
version = sys.version_info[0:2]
10+
if version != (3, 5):
11+
raise RuntimeError(
12+
'opentrons requires Python 3.5, this is {0}.{1}'.format(
13+
version[0], version[1]))
14+
415
robot = Robot()
516

617
__all__ = [Robot, Command, robot]
718

8-
from ._version import get_versions
19+
920
__version__ = get_versions()['version']
1021
del get_versions

tests/opentrons/util/test_vector.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,12 @@ def test_init(self):
1616
self.assertEqual(v3, (1, 2, 3))
1717
self.assertEqual(v4, Vector(1, 0, 0))
1818

19+
self.assertRaises(ValueError, Vector)
20+
21+
def test_repr(self):
22+
v1 = Vector(1, 2, 3)
23+
self.assertEquals(str(v1), '(x=1.00, y=2.00, z=3.00)')
24+
1925
def test_add(self):
2026
v1 = Vector(1, 2, 3)
2127
v2 = Vector(4, 5, 6)

0 commit comments

Comments
 (0)