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

Uses click for cli argument processing #284

Merged
merged 2 commits into from
May 4, 2017
Merged

Uses click for cli argument processing #284

merged 2 commits into from
May 4, 2017

Conversation

lorengordon
Copy link
Member

Replaces argparse. The argparse library dependency was required to
use argparse on py26, but the libary is not actively maintained.
Argparse is actively maintained as a core python library, but only
available in py27 and later. Installing argparse from pypi can
result in some odd behavior on imports, as we may get the core
library or the pypi library (depending on platform, typically).

Using click ensures consistent behavior across all platforms and
python versions.

I looked at invoke also, but couldn't figure out how to replicate some of our option types, and felt the docs weren't quite as mature as click. This implementation with click results in identical cli usage as the prior approach with argparse.

@lorengordon
Copy link
Member Author

Opening for discussion. Still need to test on Windows.

@codecov
Copy link

codecov bot commented May 2, 2017

Codecov Report

Merging #284 into develop will increase coverage by 0.11%.
The diff coverage is 0%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop     #284      +/-   ##
===========================================
+ Coverage    18.12%   18.23%   +0.11%     
===========================================
  Files           13       13              
  Lines          822      817       -5     
  Branches        92       91       -1     
===========================================
  Hits           149      149              
+ Misses         673      668       -5
Impacted Files Coverage Δ
src/watchmaker/__init__.py 16.77% <0%> (ø) ⬆️
src/watchmaker/cli.py 0% <0%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6d8c54a...83703ef. Read the comment docs.

@codecov
Copy link

codecov bot commented May 2, 2017

Codecov Report

Merging #284 into develop will increase coverage by 0.08%.
The diff coverage is 0%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop     #284      +/-   ##
===========================================
+ Coverage    18.12%   18.21%   +0.08%     
===========================================
  Files           13       13              
  Lines          822      818       -4     
  Branches        92       91       -1     
===========================================
  Hits           149      149              
+ Misses         673      669       -4
Impacted Files Coverage Δ
src/watchmaker/cli.py 0% <0%> (ø) ⬆️
src/watchmaker/__init__.py 16.77% <0%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c4612a6...d564676. Read the comment docs.

@KevinPlus3
Copy link
Contributor

I am reading through on click currently. I certainly have no objections to switching over to a tool that is more in line with what we need for Watchmaker especially since argparse tends to cause odd behavior on installations from pypi.

Replaces argparse. The argparse library dependency was required to
use argparse on py26, but the libary is not actively maintained.
Argparse is actively maintained as a core python library, but only
available in py27 and later. Installing argparse from pypi can
result in some odd behavior on imports, as we may get the core
library _or_ the pypi library (depending on platform, typically).

Using click ensures consistent behavior across all platforms and
python versions.
@lorengordon lorengordon merged commit 44b554f into plus3it:develop May 4, 2017
@lorengordon lorengordon deleted the click branch May 4, 2017 13:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants