Skip to content

Commit

Permalink
(fix PXP-9174): add gen3users cli
Browse files Browse the repository at this point in the history
  • Loading branch information
george42-ctds committed Nov 17, 2023
1 parent c41412e commit cecf256
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 24 deletions.
2 changes: 2 additions & 0 deletions gen3/cli/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import gen3.cli.objects as objects
import gen3.cli.file as file
import gen3.cli.drs_pull as drs_pull
import gen3.cli.users as users
import gen3
from gen3 import logging as sdklogging
from gen3.cli import nih
Expand Down Expand Up @@ -139,4 +140,5 @@ def main(
main.add_command(drs_pull.drs_pull)
main.add_command(file.file)
main.add_command(nih.nih)
main.add_command(users.users)
main()
39 changes: 39 additions & 0 deletions gen3/cli/users.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import click

# Temp for local import
# import sys
# sys.path.append('../')
# import gen3users.gen3users.main as users_cli

# Use this after gen3users merge
from gen3users import main as users_cli

# import gen3users as users_cli


# Do we need these?
try:
from importlib.metadata import entry_points
except ImportError:
from importlib_metadata import entry_points


@click.group()
def main():
"""Gen3 Command Line Interface"""
pass


@click.group()
def users():
"""Commands for working with gen3users"""
pass


# for command in users_cli.main.commands:
for command in users_cli.main.commands:
users.add_command(users_cli.main.get_command(ctx=None, cmd_name=command))

# load plug-ins from entry_points
for ep in entry_points().get("gen3.plugins", []):
ep.load()
41 changes: 17 additions & 24 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ urllib3 = ">2.0.0"
httpx = "*"
xmltodict = "^0.13.0"
pyyaml = ">=6.0.1"
gen3users = ">=1.0.2"

# A list of all of the optional dependencies, some of which are included in the
# below `extras`. They can be opted into by apps.
Expand Down

0 comments on commit cecf256

Please sign in to comment.