-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #113 from dwreeves/matrix-strategy-for-ci
Add matrix strategy for CI + fix for Click 7.x.
- Loading branch information
Showing
98 changed files
with
2,457 additions
and
30 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,22 +1,30 @@ | ||
name: Test Coverage | ||
on: | ||
push: | ||
pull_request: | ||
|
||
on: [push, pull_request] | ||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python: [3.9.x, 3.10.x, 3.11.x] | ||
click: [7.0.*, 8.0.*, 8.1.*] # Skip click 7.1 since regression coverage is strictly higher in 7.0. | ||
rich: [12.*, 13.*] | ||
steps: | ||
- name: Checkout | ||
- name: Check out the repo | ||
uses: actions/checkout@v3 | ||
|
||
- name: Setup Python | ||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.7.13" | ||
python-version: ${{ matrix.python }} | ||
|
||
- name: Install Dependencies | ||
run: pip install '.[dev]' | ||
- name: Install dependencies | ||
run: | | ||
pip install '.[dev]' | ||
pip install --upgrade "click==$CLICK_VERSION" | ||
pip install --upgrade "rich==$RICH_VERSION" | ||
env: | ||
CLICK_VERSION: ${{ matrix.click }} | ||
RICH_VERSION: ${{ matrix.rich }} | ||
|
||
- name: Run Tests | ||
- name: Run tests | ||
run: pytest --cov --cov-report xml |
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
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
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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
from distutils.version import LooseVersion | ||
|
||
import click | ||
|
||
CLICK_IS_BEFORE_VERSION_8X = LooseVersion(click.__version__) < LooseVersion("8.0.0") |
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
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
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
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
79 changes: 79 additions & 0 deletions
79
tests/expectations/test_rich_click[test arguments with rich_config]-click7.config.json
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 |
---|---|---|
@@ -0,0 +1,79 @@ | ||
{ | ||
"style_option": "bold cyan", | ||
"style_argument": "bold cyan", | ||
"style_command": "bold cyan", | ||
"style_switch": "bold green", | ||
"style_metavar": "bold yellow", | ||
"style_metavar_append": "dim yellow", | ||
"style_metavar_separator": "dim", | ||
"style_header_text": "", | ||
"style_footer_text": "", | ||
"style_usage": "yellow", | ||
"style_usage_command": "bold", | ||
"style_deprecated": "red", | ||
"style_helptext_first_line": "", | ||
"style_helptext": "dim", | ||
"style_option_help": "", | ||
"style_option_default": "dim", | ||
"style_option_envvar": "dim yellow", | ||
"style_required_short": "red", | ||
"style_required_long": "dim red", | ||
"style_options_panel_border": "dim", | ||
"align_options_panel": "left", | ||
"style_options_table_show_lines": false, | ||
"style_options_table_leading": 0, | ||
"style_options_table_pad_edge": false, | ||
"style_options_table_padding": [0, 1], | ||
"style_options_table_box": "", | ||
"style_options_table_row_styles": null, | ||
"style_options_table_border_style": null, | ||
"style_commands_panel_border": "dim", | ||
"align_commands_panel": "left", | ||
"style_commands_table_show_lines": false, | ||
"style_commands_table_leading": 0, | ||
"style_commands_table_pad_edge": false, | ||
"style_commands_table_padding": [0, 1], | ||
"style_commands_table_box": "", | ||
"style_commands_table_row_styles": null, | ||
"style_commands_table_border_style": null, | ||
"style_errors_panel_border": "red", | ||
"align_errors_panel": "left", | ||
"style_errors_suggestion": "dim", | ||
"style_aborted": "red", | ||
"max_width": 100, | ||
"color_system": null, | ||
"force_terminal": true, | ||
"header_text": null, | ||
"footer_text": null, | ||
"deprecated_string": "(Deprecated) ", | ||
"default_string": "[default: {}]", | ||
"envvar_string": "[env var: {}]", | ||
"required_short_string": "*", | ||
"required_long_string": "[required]", | ||
"range_string": " [{}]", | ||
"append_metavars_help_string": "({})", | ||
"arguments_panel_title": "Arguments", | ||
"options_panel_title": "Options", | ||
"commands_panel_title": "Commands", | ||
"errors_panel_title": "Error", | ||
"errors_suggestion": null, | ||
"errors_epilogue": null, | ||
"aborted_text": "Aborted.", | ||
"show_arguments": true, | ||
"show_metavars_column": true, | ||
"append_metavars_help": false, | ||
"group_arguments_options": false, | ||
"option_envvar_first": false, | ||
"use_markdown": false, | ||
"use_markdown_emoji": true, | ||
"use_rich_markup": false, | ||
"command_groups": {}, | ||
"option_groups": {}, | ||
"use_click_short_help": false, | ||
"highlighter": [ | ||
"(^|\\W)(?P<switch>\\-\\w+)(?![a-zA-Z0-9])", | ||
"(^|\\W)(?P<option>\\-\\-[\\w\\-]+)(?![a-zA-Z0-9])", | ||
"(?P<metavar>\\<[^\\>]+\\>)" | ||
], | ||
"legacy_windows": false | ||
} |
17 changes: 17 additions & 0 deletions
17
tests/expectations/test_rich_click[test arguments with rich_config]-click7.out
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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
|
||
Usage: cli [OPTIONS] INPUT | ||
|
||
My amazing tool does all the things. | ||
This is a minimal example based on documentation from the 'click' package. | ||
You can try using --help at the top level and also for specific group subcommands. | ||
|
||
╭─ Arguments ──────────────────────────────────────────────────────────────────────────────────────╮ | ||
│ * INPUT PATH [required] │ | ||
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯ | ||
╭─ Options ────────────────────────────────────────────────────────────────────────────────────────╮ | ||
│ --type TEXT Type of file to sync [default: files] │ | ||
│ --all Sync all the things? │ | ||
│ --debug Enable debug mode │ | ||
│ --help Show this message and exit. │ | ||
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯ | ||
|
File renamed without changes.
File renamed without changes.
Oops, something went wrong.