Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

♻️ Refactor CLI #60

Merged
merged 7 commits into from
Oct 18, 2018
Merged

♻️ Refactor CLI #60

merged 7 commits into from
Oct 18, 2018

Conversation

znatty22
Copy link
Member

@znatty22 znatty22 commented Oct 17, 2018

Refactor CLI to use a CLI framework in preparation for implementing additional extract, transform, load subcommands (#37)

@znatty22 znatty22 added the refactor Something needs to be done better label Oct 17, 2018
@znatty22 znatty22 self-assigned this Oct 17, 2018
@znatty22 znatty22 requested a review from fiendish October 17, 2018 15:17
@znatty22 znatty22 changed the title ♻️Refactor CLI ♻️ Refactor CLI Oct 17, 2018
Replace main.py with Click CLI module - cli.py
Change invokation of ingest so that you can do:

    $ kidsfirst <cmd> <args> <options>
Copy link
Contributor

@fiendish fiendish left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

side note: If I python setup.py install and then try to run kidsfirst, I get:

Traceback (most recent call last):
  File "/Users/kelmana/Documents/kids-first/kf-lib-data-ingest/venv/bin/kidsfirst", line 11, in <module>
    load_entry_point('kf-lib-data-ingest==0.1', 'console_scripts', 'kidsfirst')()
  File "/Users/kelmana/Documents/kids-first/kf-lib-data-ingest/venv/lib/python3.7/site-packages/pkg_resources/__init__.py", line 484, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/Users/kelmana/Documents/kids-first/kf-lib-data-ingest/venv/lib/python3.7/site-packages/pkg_resources/__init__.py", line 2707, in load_entry_point
    return ep.load()
  File "/Users/kelmana/Documents/kids-first/kf-lib-data-ingest/venv/lib/python3.7/site-packages/pkg_resources/__init__.py", line 2325, in load
    return self.resolve()
  File "/Users/kelmana/Documents/kids-first/kf-lib-data-ingest/venv/lib/python3.7/site-packages/pkg_resources/__init__.py", line 2331, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
ModuleNotFoundError: No module named 'cli'

Why does that fail but pip install -e . works?

.gitignore Outdated
@@ -105,3 +105,6 @@ venv.bak/

# mypy
.mypy_cache/

# Visual studio
.vscode/
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please put a newline at the end of the file so that this ugly screen shot 2018-10-17 at 11 53 20 am symbol goes away, lol

src/cli.py Outdated
"""
A CLI utility for ingesting study data into the Kids First ecosystem.

This method not need to be implemented. cli is the root group that all
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
This method not need to be implemented. cli is the root group that all
This method does not need to be implemented. cli is the root group that all

src/cli.py Outdated
A CLI utility for ingesting study data into the Kids First ecosystem.

This method not need to be implemented. cli is the root group that all
subcommands will implicitly be part of
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
subcommands will implicitly be part of
subcommands will implicitly be part of.

Copy link
Contributor

@fiendish fiendish left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(ignore this comment)

@znatty22
Copy link
Member Author

@fiendish It looks like the failure of python setup.py install has to do with the issues here. If you click the "exhaustive tests" link on that issue page and find your way into documentation on namespace packaging, there is some info on how to make the package installable via both setup.py and pip, but do we really need to support both? I think we just need to support pip..

@fiendish
Copy link
Contributor

good to go

@fiendish fiendish merged commit 92f5a9f into master Oct 18, 2018
@fiendish fiendish deleted the better-cli branch October 18, 2018 18:22
@znatty22 znatty22 mentioned this pull request Apr 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactor Something needs to be done better
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants