|
6 | 6 | import subprocess |
7 | 7 | from typing import TYPE_CHECKING |
8 | 8 |
|
9 | | -import ghp_import # type: ignore |
| 9 | +import ghp_import # type: ignore[import-untyped] |
10 | 10 | from packaging import version |
11 | 11 |
|
12 | 12 | import properdocs |
@@ -43,8 +43,7 @@ def _get_current_sha(repo_path) -> str: |
43 | 43 | ) |
44 | 44 |
|
45 | 45 | stdout, _ = proc.communicate() |
46 | | - sha = stdout.decode('utf-8').strip() |
47 | | - return sha |
| 46 | + return stdout.decode('utf-8').strip() |
48 | 47 |
|
49 | 48 |
|
50 | 49 | def _get_remote_url(remote_name: str) -> tuple[str, str] | tuple[None, None]: |
@@ -78,7 +77,9 @@ def _check_version(branch: str) -> None: |
78 | 77 |
|
79 | 78 | stdout, _ = proc.communicate() |
80 | 79 | msg = stdout.decode('utf-8').strip() |
81 | | - m = re.search(r'\d+(\.\d+)+((a|b|rc)\d+)?(\.post\d+)?(\.dev\d+)?', msg, re.X | re.I) |
| 80 | + m = re.search( |
| 81 | + r'\d+(\.\d+)+((a|b|rc)\d+)?(\.post\d+)?(\.dev\d+)?', msg, re.VERBOSE | re.IGNORECASE |
| 82 | + ) |
82 | 83 | previousv = version.parse(m.group()) if m else None |
83 | 84 | currentv = version.parse(properdocs.__version__) |
84 | 85 | if not previousv: |
@@ -163,7 +164,6 @@ def gh_deploy( |
163 | 164 | log.info('Your documentation should be available shortly.') |
164 | 165 | else: |
165 | 166 | username, repo = path.split('/', 1) |
166 | | - if repo.endswith('.git'): |
167 | | - repo = repo[: -len('.git')] |
| 167 | + repo = repo.removesuffix('.git') |
168 | 168 | url = f'https://{username}.github.io/{repo}/' |
169 | 169 | log.info(f"Your documentation should shortly be available at: {url}") |
0 commit comments