Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
mrhlpr
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
postmarketOS
mrhlpr
Commits
4961d738
Verified
Commit
4961d738
authored
5 months ago
by
Newbyte
Browse files
Options
Downloads
Patches
Plain Diff
mrhlpr, mrtest: Add more type hints
parent
bdad67c8
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!57
Misc fixes
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
mrhlpr/mr.py
+4
-2
4 additions, 2 deletions
mrhlpr/mr.py
mrtest/frontend.py
+3
-3
3 additions, 3 deletions
mrtest/frontend.py
mrtest/select_package.py
+3
-3
3 additions, 3 deletions
mrtest/select_package.py
with
10 additions
and
8 deletions
mrhlpr/mr.py
+
4
−
2
View file @
4961d738
...
...
@@ -130,7 +130,9 @@ def get_status(
)
def
get_pipeline_metadata
(
mr_id
,
no_cache
:
bool
,
origin
:
gitlab
.
GitLabOrigin
)
->
PipelineMetadata
:
def
get_pipeline_metadata
(
mr_id
:
int
,
no_cache
:
bool
,
origin
:
gitlab
.
GitLabOrigin
)
->
PipelineMetadata
:
# Get the latest pipeline (without cache so we don't miss newer ones)
url_mr
=
"
/projects/{}/merge_requests/{}
"
.
format
(
origin
.
api_project_id
,
mr_id
)
api
=
gitlab
.
download_json
(
origin
,
url_mr
,
no_cache
=
True
)
...
...
@@ -447,7 +449,7 @@ def commits_are_signed(commits: list[str]) -> bool:
def
run_git_filter_branch
(
script
:
str
,
from_ref
:
str
,
mr_id
:
Optional
[
int
]
=
None
,
label
:
Optional
[
str
]
=
None
):
)
->
None
:
script
=
os
.
path
.
realpath
(
os
.
path
.
realpath
(
__file__
)
+
f
"
/../data/
{
script
}
"
)
env
=
os
.
environ
.
copy
()
env
[
"
FILTER_BRANCH_SQUELCH_WARNING
"
]
=
"
1
"
...
...
This diff is collapsed.
Click to expand it.
mrtest/frontend.py
+
3
−
3
View file @
4961d738
...
...
@@ -18,7 +18,7 @@ except ImportError:
pass
def
arguments_add
(
sub
)
->
None
:
def
arguments_add
(
sub
:
argparse
.
_SubParsersAction
)
->
None
:
"""
:param sub: argparser
'
s subparser
"""
parser
=
sub
.
add_parser
(
"
add
"
,
help
=
"
install packages from an MR
"
)
parser
.
add_argument
(
...
...
@@ -27,7 +27,7 @@ def arguments_add(sub) -> None:
parser
.
add_argument
(
"
mr_id
"
,
type
=
int
,
help
=
"
merge request ID
"
)
def
arguments_upgrade
(
sub
)
->
None
:
def
arguments_upgrade
(
sub
:
argparse
.
_SubParsersAction
)
->
None
:
"""
:param sub: argparser
'
s subparser
"""
parser
=
sub
.
add_parser
(
"
upgrade
"
,
help
=
"
upgrade to packages from an MR
"
)
parser
.
add_argument
(
...
...
@@ -42,7 +42,7 @@ def arguments_upgrade(sub) -> None:
parser
.
add_argument
(
"
mr_id
"
,
type
=
int
,
help
=
"
merge request ID
"
)
def
arguments_zap
(
sub
)
->
None
:
def
arguments_zap
(
sub
:
argparse
.
_SubParsersAction
)
->
None
:
"""
:param sub: argparser
'
s subparser
"""
sub
.
add_parser
(
"
zap
"
,
help
=
"
uninstall previously added packages
"
)
...
...
This diff is collapsed.
Click to expand it.
mrtest/select_package.py
+
3
−
3
View file @
4961d738
...
...
@@ -8,7 +8,7 @@ import zipfile
import
mrtest.apk_installed
def
get_apks_in_zip
(
zip_path
)
->
list
[
str
]:
def
get_apks_in_zip
(
zip_path
:
str
)
->
list
[
str
]:
"""
:param zip_path: downloaded artifacts zip containing the apks
:returns: list of paths inside the zip file like:
...
...
@@ -92,7 +92,7 @@ def show_commands() -> None:
print
(
"
Toggling multiple packages in one command is possible (e.g. 2 3 4 10-15 20)
"
)
def
toggle_package
(
selection
,
apks
:
list
[
str
],
ret
)
->
list
[
str
]:
def
toggle_package
(
selection
:
int
|
str
,
apks
:
list
[
str
],
ret
:
list
[
str
]
)
->
list
[
str
]:
"""
Toggle the package based on the user action.
:param selection: user input, single integer
:param apks: list of packages available for install
...
...
@@ -109,7 +109,7 @@ def toggle_package(selection, apks: list[str], ret) -> list[str]:
return
ret
def
toggle_packages
(
action
,
apks
:
list
[
str
],
ret
:
list
[
str
])
->
list
[
str
]:
def
toggle_packages
(
action
:
str
,
apks
:
list
[
str
],
ret
:
list
[
str
])
->
list
[
str
]:
"""
Toggle multiple packages based on the user action.
:param action: user input, multiple integers or range
:param apks: list of packages available for install
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment