Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BREAK: rename requirements workflow to update lock #435

Merged
merged 1 commit into from
Oct 16, 2024
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
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
Loading