Skip to content

Commit 1a9726f

Browse files
committed
Add encrypted API key to .travis.yml
1 parent 1f9bbb0 commit 1a9726f

3 files changed

Lines changed: 10 additions & 2 deletions

File tree

.travis.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ python:
44
- "2.7"
55
- "3.4"
66

7+
env:
8+
secure: "cEIvnra5uFYph1v32vkpwRf1nxzCsSWfOtkjPSg0z6szLg3IJN7bhg/5A1S3DRRi0YLZ4CEJYLcCCcnj6OUwMotaVphFwJZ/Y3gGo1BXNHlrOmQL1vUR8LgJC+FN2PIFk4rAUM/Zq6oxldxkW8YtJx4l/RCcams8GRHKWtO+IR4="
9+
710
before_install:
811
- sudo apt-get install -q libatlas3gf-base libatlas-dev liblapack-dev gfortran
912

openml/apiconnector.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -994,7 +994,7 @@ def _read_url(self, url, add_authentication=False, data=None, filePath=None):
994994
def _read_url(self, url, data=None, file_path=None):
995995
if data is None:
996996
data = {}
997-
data['session_hash'] = self.config.get('FAKE_SECTION', 'apikey')
997+
data['api_key'] = self.config.get('FAKE_SECTION', 'apikey')
998998

999999
if file_path is not None:
10001000
if os.path.isabs(file_path):

tests/test_apiconnector.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,13 @@ def setUp(self):
4444
os.chdir(self.workdir)
4545

4646
self.cached = True
47+
48+
try:
49+
apikey = os.environ['OPENML_APIKEY']
50+
except:
51+
apikey = None
4752
self.connector = APIConnector(cache_directory=self.workdir,
48-
apikey='test')
53+
apikey=apikey)
4954

5055
def tearDown(self):
5156
os.chdir(self.cwd)

0 commit comments

Comments
 (0)