Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions .github/workflows/reusable-python-ci.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
name: Reusable - Complete Python CI

on:
pull_request:
workflow_call:
inputs:
python-version:
Expand All @@ -19,6 +18,11 @@ on:
required: false
type: string
default: 'pip install -e ".[dev]"'
test-install-command:
description: 'Command to install project dependencies for tests'
required: false
type: string
default: ''
skip-commit-check:
description: 'Skip commit message check'
required: false
Expand Down Expand Up @@ -59,6 +63,9 @@ on:
required: false
type: number
default: 500
secrets:
proton_samples_token:
required: false

jobs:
pr-size-check:
Expand Down Expand Up @@ -105,4 +112,6 @@ jobs:
uses: ./.github/workflows/reusable-tests.yml
with:
python-version: ${{ inputs.python-version || '3.11' }}
install-command: ${{ inputs.install-command || 'pip install -e ".[dev]"' }}
install-command: ${{ inputs.test-install-command || inputs.install-command || 'pip install -e ".[dev]"' }}
secrets:
proton_samples_token: ${{ secrets.proton_samples_token }}
8 changes: 8 additions & 0 deletions .github/workflows/reusable-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ on:
required: false
type: boolean
default: true
secrets:
proton_samples_token:
required: false

jobs:
comprehensive-tests:
Expand All @@ -43,6 +46,11 @@ jobs:
python-version: ${{ inputs.python-version }}

- name: Install dependencies
env:
GIT_CONFIG_COUNT: ${{ secrets.proton_samples_token != '' && '1' || '0' }}
GIT_CONFIG_KEY_0: 'url.https://x-access-token:${{ secrets.proton_samples_token }}@github.com/IS-Model-Framework/ProtonSamples.insteadOf'
GIT_CONFIG_VALUE_0: 'https://github.com/IS-Model-Framework/ProtonSamples'
GIT_TERMINAL_PROMPT: '0'
run: |
python -m pip install --upgrade pip
${{ inputs.install-command }}
Expand Down
4 changes: 2 additions & 2 deletions scripts/check_mr_logs.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
def get_commit_log(commit_hash):
try:
result = subprocess.run(
["git", "show", "-s", f"--format=%B%nAuthor: %an <%ae>", commit_hash],
["git", "show", "-s", "--format=%B%nAuthor: %an <%ae>", commit_hash],
capture_output=True,
text=True,
check=True,
Expand All @@ -49,7 +49,7 @@ def check_header(commit_msg):
if not header_match:
return (
False,
f"Invalid header format. Should be: <type>[<SCOPE>]: <short-summary>",
"Invalid header format. Should be: <type>[<SCOPE>]: <short-summary>",
)

return True, ""
Expand Down
2 changes: 1 addition & 1 deletion scripts/code_format_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class FormatArgs:
verbose: bool = True

def __init__(self, args: Optional[argparse.Namespace] = None) -> None:
if not args is None:
if args is not None:
self.start_rev = args.start_rev
self.end_rev = args.end_rev
self.changed_files = args.changed_files
Expand Down
4 changes: 2 additions & 2 deletions scripts/typing_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class TypingArgs:
verbose: bool = True

def __init__(self, args: Optional[argparse.Namespace] = None) -> None:
if not args is None:
if args is not None:
self.changed_files = args.changed_files


Expand Down Expand Up @@ -142,5 +142,5 @@ def typing_run(self, changed_files: List[str], args: TypingArgs) -> bool:
sys.exit(1)

if not helper.run(changed_files, args):
print(f"error: static typing for python failed")
print("error: static typing for python failed")
sys.exit(1)