diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index e0c3f73..bbfa499 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -4,7 +4,7 @@ repos: - repo: https://github.com/psf/black - rev: 22.1.0 + rev: 22.3.0 hooks: - id: black - repo: https://github.com/asottile/pyupgrade @@ -12,7 +12,7 @@ repos: hooks: - id: pyupgrade - repo: https://github.com/pre-commit/mirrors-prettier - rev: v2.6.0 + rev: v2.6.2 hooks: - id: prettier - repo: https://github.com/pre-commit/pre-commit-hooks @@ -38,10 +38,10 @@ repos: - --max-line-length=100 - --per-file-ignores=files/packit.wsgi:F401,E402 - repo: https://github.com/pre-commit/mirrors-mypy - rev: v0.941 + rev: v0.942 hooks: - id: mypy - args: [--no-strict-optional, --ignore-missing-imports] + args: [--ignore-missing-imports] additional_dependencies: [types-pkg_resources] - repo: https://github.com/packit/pre-commit-hooks rev: 3bf9afc5ede12a4ee26e9451f306edf255749396 diff --git a/hardly/__init__.py b/hardly/__init__.py index 903cbd6..afdb8ac 100644 --- a/hardly/__init__.py +++ b/hardly/__init__.py @@ -7,4 +7,4 @@ __version__ = get_distribution(__name__).version except DistributionNotFound: # package is not installed - __version__ = None + __version__ = "" diff --git a/hardly/handlers/distgit.py b/hardly/handlers/distgit.py index 732157b..2a606e2 100644 --- a/hardly/handlers/distgit.py +++ b/hardly/handlers/distgit.py @@ -41,15 +41,15 @@ def __init__( job_config=job_config, event=event, ) - self.mr_identifier = event.get("identifier") - self.mr_title = event.get("title") - self.mr_description = event.get("description") - self.mr_url = event.get("url") - self.source_project_url = event.get("source_project_url") + self.mr_identifier = event["identifier"] + self.mr_title = event["title"] + self.mr_description = event["description"] + self.mr_url = event["url"] + self.source_project_url = event["source_project_url"] self.target_repo = ( - event.get("target_repo_namespace") + "/" + event.get("target_repo_name") + f"{event['target_repo_namespace']}/{event['target_repo_name']}" ) - self.target_repo_branch = event.get("target_repo_branch") + self.target_repo_branch = event["target_repo_branch"] def run(self) -> TaskResults: """ @@ -84,7 +84,7 @@ def run(self) -> TaskResults: dg_mr_info = f"""###### Info for package maintainer This MR has been automatically created from [this source-git MR]({self.mr_url}).""" - if getenv("PROJECT") and getenv("PROJECT").startswith("stream"): + if getenv("PROJECT", "").startswith("stream"): dg_mr_info += """ Please review the contribution and once you are comfortable with the content, you should trigger a CI pipeline run via `Pipelines → Run pipeline`."""