Skip to content

Commit

Permalink
Updates
Browse files Browse the repository at this point in the history
  • Loading branch information
cthoyt committed Nov 18, 2020
1 parent 4b6df44 commit 09d1822
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 12 deletions.
4 changes: 2 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ Download the latest stable code from `PyPI <https://pypi.org/project/bio2bel>`_

.. code-block:: sh
$ python3 -m pip install bio2bel
$ python -m pip install bio2bel
or get the latest from GitHub with:

.. code-block:: sh
$ git clone https://github.com/bio2bel/bio2bel.git
$ cd bio2bel
$ python3 -m pip install -e .
$ python -m pip install -e .
or check the `installation instructions <http://bio2bel.readthedocs.io/en/latest/#installation>`_.

Expand Down
6 changes: 4 additions & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
[metadata]
name = bio2bel
version = 0.3.9-dev
description = A package for converting biological data sources to BEL
description = A framework for converting biological data sources to BEL
long_description = file: README.rst

# URLs associated with the project
Expand Down Expand Up @@ -34,6 +34,8 @@ classifiers =
License :: OSI Approved :: MIT License
Operating System :: OS Independent
Programming Language :: Python
Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.7
Programming Language :: Python :: 3 :: Only
Topic :: Scientific/Engineering :: Bio-Informatics
Expand All @@ -54,7 +56,7 @@ install_requires =
pandas
tqdm
easy_config
pybel<0.16.0
pybel>=0.15.0<0.16.0
bel_resources>=0.0.3
pyobo>=0.2.2

Expand Down
3 changes: 2 additions & 1 deletion src/bio2bel/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@
commands = {}
for name, manager_cls in MANAGERS.items():
commands[name] = manager_cls.get_cli()
commands[name].help = f'*Manage {name}'
# can not use single asterick, causes documentation build failure
commands[name].help = f'# Manage {name}'

main = click.Group(commands=commands)
main.help = f'Bio2BEL Command Line Utilities on {sys.executable}\nBio2BEL v{get_version()}'
Expand Down
4 changes: 2 additions & 2 deletions src/bio2bel/io/automate.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from contextlib import redirect_stdout
from typing import Any, Mapping, Optional, Tuple

from pybel import BELGraph, from_nodelink_gz, to_nodelink_gz, to_tsv
from pybel import BELGraph, from_nodelink_gz, to_nodelink_gz, to_triples_file
from ..manager.bel_manager import BELManagerMixin
from ..utils import get_data_dir

Expand Down Expand Up @@ -42,7 +42,7 @@ def ensure_tsv(name: str, *, manager_kwargs: Optional[Mapping[str, Any]] = None)
if os.path.exists(path):
return path
graph = ensure_graph(name, manager_kwargs=manager_kwargs)
to_tsv(graph, path)
to_triples_file(graph, path)
return path


Expand Down
9 changes: 4 additions & 5 deletions src/bio2bel/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
from urllib.request import urlretrieve

import requests
from botocore.client import BaseClient
from pkg_resources import UnknownExtra, VersionConflict, iter_entry_points

from .constants import BIO2BEL_DIR, config
Expand All @@ -29,8 +30,6 @@

logger = logging.getLogger(__name__)

S3Client = 'botocore.client.BaseClient'


def get_data_dir(module_name: str) -> str:
"""Ensure the appropriate Bio2BEL data directory exists for the given module, then returns the file path.
Expand Down Expand Up @@ -63,7 +62,7 @@ def ensure_path(
use_requests: bool = False,
force: bool = False,
bucket: Optional[str] = None,
s3_client: Optional[S3Client] = None,
s3_client: Optional[BaseClient] = None,
) -> str:
"""Download a file if it doesn't exist.
Expand Down Expand Up @@ -109,7 +108,7 @@ def _get_s3_key(prefix: str, path: str) -> str:
return os.path.join(prefix, path.name)


def _has_file(s3_client: S3Client, *, bucket: str, key: str) -> bool:
def _has_file(s3_client: BaseClient, *, bucket: str, key: str) -> bool:
from botocore.errorfactory import ClientError

try:
Expand All @@ -120,7 +119,7 @@ def _has_file(s3_client: S3Client, *, bucket: str, key: str) -> bool:
return True


def _ensure_s3_client(s3_client: Optional[S3Client]) -> S3Client:
def _ensure_s3_client(s3_client: Optional[BaseClient]) -> BaseClient:
if s3_client is None:
import boto3
s3_client = boto3.client('s3')
Expand Down

0 comments on commit 09d1822

Please sign in to comment.