Skip to content

Commit

Permalink
Merge pull request #1287 from nsoranzo/type_annots
Browse files Browse the repository at this point in the history
Add type annotations to ``planemo.glob`` and ``planemo.virtualenv``
  • Loading branch information
nsoranzo committed Oct 6, 2022
2 parents e92b34b + 09b5db1 commit 475b0ce
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 3 additions & 1 deletion planemo/glob.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from typing import List

NO_GLOB_2 = "glob2 library unavailabile, please install with pip install glob2."

try:
Expand All @@ -6,7 +8,7 @@
_glob = None


def glob(*args, **kwds):
def glob(*args, **kwds) -> List[str]:
if _glob is None:
raise Exception(NO_GLOB_2)
return _glob(*args, **kwds)
Expand Down
3 changes: 2 additions & 1 deletion planemo/virtualenv.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@

import os
import sys
from typing import Optional

from galaxy.util.commands import which

DEFAULT_PYTHON_VERSION = os.environ.get("PLANEMO_DEFAULT_PYTHON_VERSION", "3")


def create_command(virtualenv_path, galaxy_python_version=None):
def create_command(virtualenv_path: str, galaxy_python_version: Optional[str] = None) -> str:
"""If virtualenv is on Planemo's path use it, otherwise use the planemo
subcommand virtualenv to create the virtualenv.
"""
Expand Down

0 comments on commit 475b0ce

Please sign in to comment.