Skip to content

Commit

Permalink
Merge branch 'main' into constrained-global-args
Browse files Browse the repository at this point in the history
  • Loading branch information
lengau authored Feb 29, 2024
2 parents 8316c77 + 44de6d7 commit ca5e5c3
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 29 deletions.
25 changes: 25 additions & 0 deletions .github/.jira_sync_config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
settings:
components:
- Craft CLI
labels:
- Bug
- Enhancement
- Spike
- Epic
# Adds a comment with the JIRA ID
add_gh_comment: true
# Reflect changes on JIRA
sync_description: true
# Comments are synced from Github to JIRA
# Nothing goes from JIRA to Github
sync_comments: true
# epic_key: "MTC-296"
jira_project_key: "CRAFT"
status_mapping:
opened: Untriaged
closed: done
label_mapping:
Enhancement: Story
Bug: Bug
Spike: Spike
Epic: Epic
17 changes: 0 additions & 17 deletions .github/workflows/issues.yaml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/release-drafter.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Release Drafter
uses: release-drafter/release-drafter@v5.25.0
uses: release-drafter/release-drafter@v6.0.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ jobs:
- name: Test with tox
run: tox run-parallel --parallel all --parallel-no-spinner --skip-pkg-install --result-json results/tox-${{ matrix.platform }}.json -m tests -- --no-header --quiet -rN
- name: Upload code coverage
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v4
with:
directory: ./results/
files: coverage*.xml
Expand Down
6 changes: 3 additions & 3 deletions craft_cli/dispatcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ def _get_requested_help( # noqa: PLR0912 (too many branches)
except KeyError:
allowed = (repr(of.name) for of in OutputFormat)
msg = f"Invalid value for --format; allowed are: {', '.join(sorted(allowed))}"
raise self._build_usage_exc(msg) # noqa: TRY200 (Use `raise from`)
raise self._build_usage_exc(msg) from None

if len(filtered_params) == 1:
# at this point the remaining parameter should be a command
Expand All @@ -355,7 +355,7 @@ def _get_requested_help( # noqa: PLR0912 (too many branches)
cmd_class = self.commands[cmdname]
except KeyError:
msg = f"command {cmdname!r} not found to provide help for"
raise self._build_usage_exc(msg) # noqa: TRY200 (Use `raise from`)
raise self._build_usage_exc(msg) from None

# instantiate the command and fill its arguments
command = cmd_class(None)
Expand Down Expand Up @@ -505,7 +505,7 @@ def pre_parse_args(self, sysargs: list[str]) -> dict[str, Any]:
self._command_class = self.commands[command]
except KeyError:
help_text = self._build_no_command_error(command)
raise ArgumentParsingError(help_text) # noqa: TRY200 (use raise from)
raise ArgumentParsingError(help_text) from None

emit.trace(f"General parsed sysargs: command={ command!r} args={cmd_args}")
return global_args
Expand Down
15 changes: 8 additions & 7 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -52,22 +52,22 @@ dev = [
"pytest-subprocess"
]
lint = [
"black==24.1.1",
"black==24.2.0",
"codespell[toml]==2.2.6",
"ruff==0.1.15",
"yamllint==1.33.0"
"ruff~=0.2.1",
"yamllint==1.34.0"
]
types = [
"mypy[reports]==1.8.0",
"pyright==1.1.349",
"pyright==1.1.350",
"types-Pygments",
"types-colorama",
"types-setuptools",
]

[build-system]
requires = [
"setuptools==69.0.3",
"setuptools==69.1.1",
"setuptools_scm[toml]>=7.1"
]
build-backend = "setuptools.build_meta"
Expand Down Expand Up @@ -126,8 +126,8 @@ exclude_also = [
pythonVersion = "3.8"
pythonPlatform = "Linux"
ignore = [
"build/*",
"docs/*",
"build/**",
"docs/**",
"craft_cli/_version.py",
]

Expand Down Expand Up @@ -212,6 +212,7 @@ extend-select = [
"ANN0", # Type annotations for arguments other than `self` and `cls`
"ANN2", # Return type annotations
"B026", # Keyword arguments must come after starred arguments
"B904", # re-raising an exception should include a `from`.
# flake8-bandit: security testing. https://github.com/charliermarsh/ruff#flake8-bandit-s
# https://bandit.readthedocs.io/en/latest/plugins/index.html#complete-test-plugin-listing
"S101", "S102", # assert or exec
Expand Down

0 comments on commit ca5e5c3

Please sign in to comment.