Skip to content

Commit

Permalink
feat(CLI): Add a script to project
Browse files Browse the repository at this point in the history
Also fix --help for commands.

Co-authored-by: Wuestengecko <[email protected]>
  • Loading branch information
ewuerger and Wuestengecko committed Sep 26, 2024
1 parent ceb1efd commit c8bb0b6
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
4 changes: 2 additions & 2 deletions capella2polarion/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,10 @@ def cli(
polarion_url: str,
polarion_pat: str,
polarion_delete_work_items: bool,
capella_model: capellambse.MelodyModel,
capella_model: capellambse.MelodyModel | None,
) -> None:
"""Synchronise data from Capella to Polarion."""
if capella_model.diagram_cache is None:
if capella_model is not None and capella_model.diagram_cache is None:
logger.warning("It's highly recommended to define a diagram cache!")

capella2polarion_cli = Capella2PolarionCli(
Expand Down
2 changes: 1 addition & 1 deletion ci-templates/gitlab/render_documents.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ capella2polarion_render_documents:

script:
- pip install "capella2polarion${CAPELLA2POLARION_VERSION:+==$CAPELLA2POLARION_VERSION}"
- python -m capella2polarion render-documents
- capella2polarion render-documents
2 changes: 1 addition & 1 deletion ci-templates/gitlab/synchronise_elements.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ capella2polarion_synchronise_elements:

script:
- pip install "capella2polarion${CAPELLA2POLARION_VERSION:+==$CAPELLA2POLARION_VERSION}"
- python -m capella2polarion synchronize
- capella2polarion synchronize
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@ test = [
"pytest-cov",
]

[project.scripts]
capella2polarion = "capella2polarion.__main__:cli"

[tool.black]
line-length = 79
target-version = ["py312"]
Expand Down

0 comments on commit c8bb0b6

Please sign in to comment.