Skip to content

Commit

Permalink
Update workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
charlesbvll committed Sep 13, 2024
1 parent 7157efc commit e3e69d2
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 18 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/framework.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@ jobs:
with:
python-version: ${{ matrix.python }}
- name: Install dependencies (mandatory only)
run: python -m poetry install --all-extras
run: |
python -m poetry install --all-extras
python -m pip install dev
- name: Check if protos need recompilation
run: ./dev/check-protos.sh
- name: Lint + Test (isort/black/docformatter/mypy/pylint/flake8/pytest)
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/pr_check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,6 @@ jobs:
python-version: 3.11
poetry-skip: 'true'
- name: Check PR title format
run: python ./dev/check_pr_title.py "${{ github.event.pull_request.title }}"
run: |
python -m pip install dev
flwr-dev check-title "${{ github.event.pull_request.title }}"
2 changes: 1 addition & 1 deletion dev/build-docs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ cd $ROOT
./dev/build-baseline-docs.sh

cd $ROOT
python dev/build-example-docs.py
flwr-dev build-examples

cd $ROOT
./datasets/dev/build-flwr-datasets-docs.sh
Expand Down
11 changes: 1 addition & 10 deletions dev/flwr_dev/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
# ==============================================================================
"""Flower command line interface."""

from typing import Annotated
import typer
from typer.main import get_command
from flwr_dev.check_pr_title import check_title
Expand All @@ -35,15 +34,7 @@
no_args_is_help=True,
)


def check_title_app(
title: Annotated[str, typer.Argument(help="Title of the PR to check")]
):
"""Check validity of a PR title."""
check_title(title)


cli.command()(check_title_app)
cli.command()(check_title)
cli.command()(build_examples)
cli.command()(build_images)
cli.command()(check_copyrights)
Expand Down
7 changes: 6 additions & 1 deletion dev/flwr_dev/check_pr_title.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,16 @@
import re
import sys
import tomllib
from typing import Annotated

import typer

from flwr_dev.common import get_git_root


def check_title(pr_title):
def check_title(
pr_title: Annotated[str, typer.Argument(help="Title of the PR to check")]
):
"""Check if the title of a PR is valid."""
# Load the YAML configuration
with (pathlib.Path(get_git_root()) / "dev" / "changelog_config.toml").open(
Expand Down
4 changes: 2 additions & 2 deletions dev/format.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ set -e
cd "$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"/../

# Python
python -m flwr_tool.check_copyright src/py/flwr
python -m flwr_tool.init_py_fix src/py/flwr
flwr-dev check-copyrights src/py/flwr
flwr-dev fix-init src/py/flwr
python -m isort --skip src/py/flwr/proto src/py
python -m black -q --exclude src/py/flwr/proto src/py
python -m docformatter -i -r src/py/flwr -e src/py/flwr/proto
Expand Down
4 changes: 2 additions & 2 deletions dev/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ python -m black --exclude "src\/py\/flwr\/proto" --check src/py/flwr benchmarks
echo "- black: done"

echo "- init_py_check: start"
python -m flwr_tool.init_py_check src/py/flwr src/py/flwr_tool
flwr-dev check-init src/py/flwr src/py/flwr_tool
echo "- init_py_check: done"

echo "- docformatter: start"
Expand Down Expand Up @@ -59,7 +59,7 @@ echo "- All Markdown checks passed"
echo "- Start license checks"

echo "- copyright: start"
python -m flwr_tool.check_copyright src/py/flwr
flwr-dev check-copyrights src/py/flwr
echo "- copyright: done"

echo "- licensecheck: start"
Expand Down

0 comments on commit e3e69d2

Please sign in to comment.