Skip to content

Commit

Permalink
update version [skip ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
DhanshreeA authored and ersilia-bot committed Jun 4, 2024
1 parent 8927a7e commit 3382a86
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 9 deletions.
1 change: 1 addition & 0 deletions .github/workflows/airtable_to_json.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ jobs:

- name: Install dependencies
run:
pip install pyairtable
pip install airtable-python-wrapper
pip install boto3

Expand Down
2 changes: 1 addition & 1 deletion ersilia/_static_version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
version = "0.1.33"
version = "0.1.34"
13 changes: 11 additions & 2 deletions ersilia/db/hubdata/interfaces.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import requests
from pyairtable import Table
import importlib
from ... import ErsiliaBase
from ...default import AIRTABLE_MODEL_HUB_BASE_ID, AIRTABLE_MODEL_HUB_TABLE_NAME
from ...setup.requirements.pyairtable import PyAirtableRequirement

AIRTABLE_MAX_ROWS = 100000
AIRTABLE_PAGE_SIZE = 100
Expand All @@ -16,7 +17,15 @@ def __init__(self, config_json):
self.max_rows = AIRTABLE_MAX_ROWS
self.page_size = AIRTABLE_PAGE_SIZE
self.write_api_key = None
self.table = Table(self.api_key, self.base_id, self.table_name)
self.table = self._create_table()

def _create_table(self):
pyairtable_req = PyAirtableRequirement()
if not pyairtable_req.is_installed():
self.logger.debug("Installing PyAirTable from pip")
pyairtable_req.install()
pyairtable = importlib.import_module("pyairtable")
return pyairtable.Table(self.api_key, self.base_id, self.table_name)

@staticmethod
def _get_read_only_airtable_api_key():
Expand Down
2 changes: 1 addition & 1 deletion ersilia/setup/requirements/isaura.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import importlib
from ...utils.terminal import run_command


# TODO
class IsauraRequirement(object):
def __init__(self):
self.name = "isaura"
Expand Down
18 changes: 18 additions & 0 deletions ersilia/setup/requirements/pyairtable.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import importlib
import sys
from ...utils.terminal import run_command

class PyAirtableRequirement:
def __init__(self):
self.name = "pyairtable"

def is_installed(self):
try:
importlib.import_module(self.name)
return True
except:
return False

def install(self):
version = '<2' if sys.version_info.minor == 7 else '<3'
run_command(f"python -m pip install 'pyairtable{version}'")
6 changes: 1 addition & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "ersilia"
version = "0.1.33"
version = "0.1.34"
description = "A hub of AI/ML models for open source drug discovery and global health"
license = "GPLv3"
authors = ["Ersilia Open Source Initiative <[email protected]>"]
Expand Down Expand Up @@ -40,10 +40,6 @@ pandas = [
]
h5py = "^3.7.0" # For compatibility with isaura
loguru = "^0.6.0" # For compatibility with isaura
pyairtable = [
{version="<2", python="3.7.*"},
{version="<3", python=">=3.8"},
]
PyYAML = "^6.0.1"
dockerfile-parse = "^2.0.1"
tqdm = "^4.66.1"
Expand Down

0 comments on commit 3382a86

Please sign in to comment.