Skip to content
Open
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
4 changes: 4 additions & 0 deletions docs/scheduler/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,8 @@ to the repository.
| include_autopep8 | `--include-autopep8` | flag | Include autopep8 formatter workflow | `false` | — |
| include_fix_pep8 | `--include-fix-pep8` | flag | Include fix-pep8 command workflow | `false` | — |
| include_pypi | `--include-pypi` | flag | Include PyPI publish workflow | `false` | — |
| include_ruff | `--include-ruff` | flag | Include Ruff linter and formatter workflow | `false` | — |
| use_uv | `--use-uv` | flag | Use uv instead of pip for dependency installation in workflows | `false` | — |
| python_versions | `--python-versions` | list | Python versions to test against | `[3.9, 3.10]` | — |
| pep8_tool | `--pep8-tool` | str | Tool to use for PEP 8 checking | `flake8` | `flake8`, `pylint` |
| use_poetry | `--use-poetry` | flag | Use Poetry for packaging | `false` | — |
Expand All @@ -159,3 +161,5 @@ to the repository.
| include_codecov | `--include-codecov` | flag | Include Codecov coverage step in unit tests workflow | `true` | — |
| validate_paper | `--validate-paper` | flag | Check whether the experiments proposed in an attached research paper can be reproduced using the selected repository | `false` | — |
| validate_doc | `--validate-doc` | flag | Check whether the experiments proposed in an attached documentation file can be reproduced using the selected repository | `false` | — |

**Note:** Enabling both `--include-ruff` and `--include-black` generates CI jobs that may produce conflicting formatting results, since Ruff's formatter and Black apply different style rules. Prefer one formatter per project.
2 changes: 2 additions & 0 deletions osa_tool/config/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,8 @@ class WorkflowSettings(BaseModel):
include_autopep8: bool = Field(default=False, description="Include autopep8 formatter workflow.")
include_fix_pep8: bool = Field(default=False, description="Include fix-pep8 command workflow.")
include_pypi: bool = Field(default=False, description="Include PyPI publish workflow.")
include_ruff: bool = Field(default=False, description="Include Ruff linter and formatter workflow.")
use_uv: bool = Field(default=False, description="Use uv instead of pip for dependency installation in workflows.")

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Apply use_uv to PyPI publishing workflows

When include_pypi=True, use_poetry=False, and use_uv=True, all three backends still generate their existing bare pip install step for build and publishing dependencies because none of the generate_pypi_publish() calls receive or honor this setting. This contradicts the new flag's workflow-wide dependency-install behavior and prevents users from obtaining an all-uv workflow; propagate the setting into the publishing generators and emit the corresponding setup/bootstrap step.

Useful? React with 👍 / 👎.

python_versions: List[str] = Field(
default_factory=lambda: ["3.9", "3.10"],
description="Python versions for workflows.",
Expand Down
10 changes: 10 additions & 0 deletions osa_tool/config/settings/arguments.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,16 @@ workflow:
type: flag
description: "Include PyPI publish workflow."

include_ruff:
aliases: [ "--include-ruff" ]
type: flag
description: "Include Ruff linter and formatter workflow."

use_uv:
aliases: [ "--use-uv" ]
type: flag
description: "Use uv instead of pip for dependency installation in workflows."

python_versions:
aliases: [ "--python-versions" ]
type: list
Expand Down
2 changes: 2 additions & 0 deletions osa_tool/config/settings/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ include_pep8 = true
include_autopep8 = false
include_fix_pep8 = false
include_pypi = false
include_ruff = false
use_uv = false
python_versions = ["3.8", "3.9", "3.10"]
pep8_tool = "flake8" # "flake8" or "pylint"
use_poetry = false
Expand Down
3 changes: 2 additions & 1 deletion osa_tool/config/templates/workflow/github_gitverse/pep8.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ jobs:
uses: actions/setup-python@v4
with:
python-version: {python_version}
{uv_setup_step}
- name: "Install dependencies"
run: "pip install {tool}"
run: "{install_command}"
- name: "Run {tool}"
run: {tool_command}
18 changes: 18 additions & 0 deletions osa_tool/config/templates/workflow/github_gitverse/ruff.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: {name}
on:
{on_section}
jobs:
ruff:
name: "Ruff Lint & Format"
runs-on: ubuntu-latest
steps:
- name: "Checkout repo"
uses: actions/checkout@v4
- name: "Run Ruff linter"
uses: astral-sh/ruff-action@v3
with:
args: "check {src}"
- name: "Run Ruff formatter"
uses: astral-sh/ruff-action@v3
with:
args: "format --check {src}"
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@ jobs:
uses: actions/setup-python@v4
with:
python-version: "${{ matrix.python-version }}"
{uv_setup_step}
- name: "Install dependencies"
run: "{dependencies_command} && pip install pytest pytest-cov"
run: "{install_command}"
- name: "Run tests"
run: "{test_command} --cov=."
{codecov_step}
run: "{test_command} --cov=."
{codecov_step}
3 changes: 2 additions & 1 deletion osa_tool/config/templates/workflow/gitlab/autopep8.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ autopep8_fix:
image: python:{python_version}
stage: fix
script:
- pip install autopep8
{uv_bootstrap}
- {install_command} autopep8
- autopep8 --in-place --recursive {src}
{branches_section}
3 changes: 2 additions & 1 deletion osa_tool/config/templates/workflow/gitlab/black.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ black_formatter:
image: python:{python_version}
stage: lint
script:
- pip install black
{uv_bootstrap}
- {install_command} black
- black {src} {black_options}
{branches_section}
3 changes: 2 additions & 1 deletion osa_tool/config/templates/workflow/gitlab/fix_pep8.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ fix_pep8:
image: python:{python_version}
stage: fix
script:
- pip install autopep8
{uv_bootstrap}
- {install_command} autopep8
- autopep8 --in-place --recursive {src}
when: manual
{branches_section}
3 changes: 2 additions & 1 deletion osa_tool/config/templates/workflow/gitlab/pep8.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ pep8_check:
image: python:{python_version}
stage: lint
script:
- pip install {tool}
{uv_bootstrap}
- {install_command} {tool}
- {tool} {src}
{branches_section}
3 changes: 2 additions & 1 deletion osa_tool/config/templates/workflow/gitlab/unit_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ unit_test:
{matrix_yaml}
image: python:${{PYTHON_VERSION}}
before_script:
- pip install -r requirements.txt pytest
{uv_bootstrap}
- {install_command} -r requirements.txt pytest
script:
- pytest {test_dir}
{branches_section}
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,10 @@ def __init__(
include_autopep8: bool = False,
include_fix_pep8: bool = False,
include_pypi: bool = False,
include_ruff: bool = False,
pep8_tool: str = "flake8",
use_poetry: bool = False,
use_uv: bool = False,
include_codecov: bool = True,
python_versions: List[str] = None,
branches: List[str] = None,
Expand All @@ -41,8 +43,10 @@ def __init__(
"include_autopep8": include_autopep8,
"include_fix_pep8": include_fix_pep8,
"include_pypi": include_pypi,
"include_ruff": include_ruff,
"pep8_tool": pep8_tool,
"use_poetry": use_poetry,
"use_uv": use_uv,
"include_codecov": include_codecov,
"python_versions": python_versions or ["3.9", "3.10"],
"branches": branches or ["main", "master"],
Expand Down Expand Up @@ -80,6 +84,8 @@ def generate(self) -> dict:
"include_autopep8": effective.get("include_autopep8"),
"include_fix_pep8": effective.get("include_fix_pep8"),
"include_pypi": effective.get("include_pypi"),
"include_ruff": effective.get("include_ruff"),
"use_uv": effective.get("use_uv"),
},
)
)
Expand Down
Loading
Loading