Skip to content

Commit

Permalink
BREAK: rename requirements workflow to update lock
Browse files Browse the repository at this point in the history
  • Loading branch information
redeboer committed Oct 16, 2024
1 parent 211c47a commit 1b0c31b
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 11 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Requirements
name: Update lock files

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand All @@ -18,7 +18,7 @@ on:
workflow_dispatch:

jobs:
requirements:
lock:
uses: ComPWA/actions/.github/workflows/lock.yml@v2
secrets:
token: ${{ secrets.PAT }}
16 changes: 8 additions & 8 deletions src/compwa_policy/check_dev_files/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
setuptools_scm,
toml,
tox,
update_pip_constraints,
update_lock,
uv,
vscode,
)
Expand Down Expand Up @@ -117,11 +117,11 @@ def main(argv: Sequence[str] | None = None) -> int:
do(pyupgrade.main, precommit_config, args.no_ruff)
if not args.no_ruff:
do(ruff.main, precommit_config, has_notebooks, args.imports_on_top)
if args.pin_requirements != "no":
if args.update_lock_files != "no":
do(
update_pip_constraints.main,
update_lock.main,
precommit_config,
frequency=args.pin_requirements,
frequency=args.update_lock_files,
)
do(readthedocs.main, package_manager, dev_python_version)
do(remove_deprecated_tools, precommit_config, args.keep_issue_templates)
Expand Down Expand Up @@ -304,12 +304,12 @@ def _create_argparse() -> ArgumentParser:
type=str,
)
parser.add_argument(
"--pin-requirements",
choices=update_pip_constraints.Frequency.__args__, # type:ignore[attr-defined]
"--update-lock-files",
choices=update_lock.Frequency.__args__, # type:ignore[attr-defined]
default="no",
help=(
"Add a script to pin developer requirements to a constraint file."
" Argument is the frequency of the cron job"
"Add a workflow to update lock files, like uv.lock, .pre-commit-config.yml, "
"and pip .constraints/ files. The argument is the frequency of the cron job"
),
type=str,
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,8 @@ def overwrite_workflow(workflow_file: str) -> None:
update_workflow(yaml, expected_data, workflow_path)

with Executor() as do:
do(overwrite_workflow, "requirements.yml")
do(overwrite_workflow, "lock.yml")
do(remove_workflow, "requirements.yml")
do(remove_workflow, "requirements-cron.yml")
do(remove_workflow, "requirements-pr.yml")

Expand Down

0 comments on commit 1b0c31b

Please sign in to comment.