-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
088e037
commit dda46e4
Showing
2 changed files
with
12 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,17 @@ | ||
"""Main file to call from command line and GitHub workflows.""" | ||
import asv | ||
import argparse | ||
|
||
from .simple_formatter import SimpleFormatter | ||
from .tabulate_formatter import TabulateFormatter | ||
|
||
|
||
def parse_asv_version(): | ||
parser = argparse.ArgumentParser("lf_asv_formatter") | ||
parser.add_argument("--asv_version", help="Version of asv", type=str, required=True) | ||
return parser.parse_args().asv_version | ||
|
||
|
||
if __name__ == "__main__": | ||
if asv.__version__ >= "0.6.0": | ||
SimpleFormatter().rewrite_file() | ||
else: | ||
TabulateFormatter().rewrite_file() | ||
asv_version = parse_asv_version() | ||
formatter = SimpleFormatter() if asv_version >= "0.6.0" else TabulateFormatter() | ||
formatter.rewrite_file() | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters