Skip to content

Commit 680bfcc

Browse files
chore(template): accept new copier update (#66)
Co-authored-by: wpk-nist-gov <5348008+wpk-nist-gov@users.noreply.github.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 0a72009 commit 680bfcc

9 files changed

Lines changed: 114 additions & 19 deletions

File tree

.copier-answers.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Changes here will be overwritten by Copier; NEVER EDIT MANUALLY
2-
_commit: v0.12.0-14-gf2a6973
2+
_commit: v0.12.0-26-g1c7209e
33
_src_path: https://github.com/usnistgov/cookiecutter-nist-python.git
44
command_line_interface: typer
55
conda_channel: conda-forge

.github/workflows/bump.yml

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
name: Update dependencies and pre-commit hooks
2+
on:
3+
schedule:
4+
- cron: "0 2 * * 1,3,5" # Every mon, wen, fri at 2am utc
5+
workflow_dispatch:
6+
inputs:
7+
automerge:
8+
description: "enable automerge"
9+
required: false
10+
type: boolean
11+
default: false
12+
13+
permissions:
14+
contents: write
15+
pull-requests: write
16+
17+
env:
18+
AUTOMERGE: "true"
19+
20+
jobs:
21+
update:
22+
name: Bump versions
23+
runs-on: ubuntu-latest
24+
environment: pull-request
25+
steps:
26+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
27+
with:
28+
persist-credentials: false
29+
- uses: ./.github/actions/setup-cached-uv-and-python
30+
with:
31+
python-version-file: ".python-version"
32+
cache-dependency-path: requirements/lock/uvx-tools.txt
33+
- uses: extractions/setup-just@f8a3cce218d9f83db3a2ecd90e41ac3de6cdfd9b # v3.1.0
34+
35+
- name: Update requirements
36+
run: just lock --upgrade
37+
- name: Update pre-commit hooks
38+
run: just lint-upgrade
39+
40+
- name: Git config
41+
run: |
42+
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
43+
git config --global user.name "github-actions[bot]"
44+
45+
- name: Create pull request
46+
id: cpr
47+
uses: peter-evans/create-pull-request@c0f553fe549906ede9cf27b5156039d195d2ece0 # v8.1.0
48+
with:
49+
token: ${{ secrets.PAT }}
50+
add-paths: .
51+
commit-message:
52+
"chore(deps): update dependencies and pre-commit hooks"
53+
title: "chore(deps): update dependencies and pre-commit hooks"
54+
labels: dependencies
55+
branch: prek/autoupdate
56+
delete-branch: true
57+
body: |
58+
This is an autogenerated PR. Use this to merge changes to this repository.
59+
60+
- name: Pull request info
61+
if: ${{ steps.cpr.outputs.pull-request-number }}
62+
env:
63+
NUMBER: ${{ steps.cpr.outputs.pull-request-number }}
64+
URL: ${{ steps.cpr.outputs.pull-request-url }}
65+
OPERATION: ${{ steps.cpr.outputs.pull-request-operation }}
66+
SHA: ${{ steps.cpr.outputs.pull-request-sha }}
67+
BRANCH: ${{ steps.cpr.outputs.pull-request-branch }}
68+
VERIFIED: ${{ steps.cpr.outputs.pull-request-commits-verified }}
69+
run: |
70+
echo "Pull Request Number - $NUMBER"
71+
echo "Pull Request URL - $URL"
72+
echo "Pull Request Operation - $OPERATION"
73+
echo "Pull Request SHA - $SHA"
74+
echo "Pull Request BRANCH - $BRANCH"
75+
echo "Pull Request VERIFIED - $VERIFIED"
76+
77+
- name: automerge
78+
if:
79+
${{ (inputs.automerge || env.AUTOMERGE == 'true') &&
80+
steps.cpr.outputs.pull-request-number }}
81+
env:
82+
NUMBER: ${{ steps.cpr.outputs.pull-request-number }}
83+
# Need PAT if want to start other actions. Use GITHUB_TOKEN if not.
84+
GH_TOKEN: ${{ secrets.PAT }}
85+
run: |
86+
gh pr merge -m --auto "$NUMBER"

.github/workflows/update-copier.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: Update repo with copier
22
on:
33
schedule:
4-
- cron: "0 2 * * 1" # Every Monday at 2am
4+
- cron: "0 6 * * 1" # Every Monday at 6am
55
workflow_dispatch:
66
inputs:
77
automerge:

.pre-commit-config.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
ci:
66
autoupdate_commit_msg: "chore(deps): update pre-commit hooks"
77
autofix_commit_msg: "style: pre-commit fixes"
8-
autoupdate_schedule: "weekly"
8+
autoupdate_schedule: "quarterly"
99
skip:
1010
- uv-lock
1111
- pip-compile
@@ -99,13 +99,13 @@ repos:
9999

100100
# Just
101101
- repo: https://github.com/wpk-nist-gov/just-pre-commit
102-
rev: v1.48.1
102+
rev: v1.49.0
103103
hooks:
104104
- id: justfile-format
105105

106106
# * Linting
107107
- repo: https://github.com/astral-sh/ruff-pre-commit
108-
rev: v0.15.9
108+
rev: v0.15.10
109109
hooks:
110110
- id: ruff-check
111111
alias: ruff
@@ -135,7 +135,7 @@ repos:
135135
- "--custom-command=prek run pyproject2conda-project --all-files"
136136
# ** uv
137137
- repo: https://github.com/astral-sh/uv-pre-commit
138-
rev: 0.11.4
138+
rev: 0.11.6
139139
hooks:
140140
- id: uv-lock
141141
alias: requirements

justfile

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import "tools/shared.just"
44

5-
set unstable := true
5+
set unstable
66
set shell := ["bash", "-c"]
77

88
# * Defaults
@@ -86,10 +86,13 @@ cog: (lint-manual "cog" "--verbose")
8686

8787
# update all supported additional dependencies
8888
[group("lint")]
89-
lint-upgrade:
90-
just pre-commit autoupdate
91-
-[[ -f requirements/pre-commit-additional-dependencies.txt ]] && uv run --no-project --script tools/requirements_lock.py --upgrade requirements/pre-commit-additional-dependencies.txt
92-
-just pre-commit run -v sync-pre-commit-deps -a
89+
lint-upgrade: (pre-commit "autoupdate") lint-sync-deps
90+
91+
# sync dependencies (used primarily with lint-upgrade)
92+
[group("lint")]
93+
lint-sync-deps:
94+
[[ -f requirements/pre-commit-additional-dependencies.txt ]] && uv run --no-project --script tools/requirements_lock.py --upgrade requirements/pre-commit-additional-dependencies.txt || true
95+
just pre-commit run -v sync-pre-commit-deps -a || true
9396

9497
# * User setup -----------------------------------------------------------------
9598

@@ -193,12 +196,18 @@ ty *options: (_typecheck "-cty" options)
193196
[group("typecheck")]
194197
pyrefly *options: (_typecheck "-cpyrefly" options)
195198

199+
[group("typecheck")]
200+
pyrefly-suppress-errors *options: (_typecheck "-c'pyrefly check --suppress-errors'")
201+
202+
[group("typecheck")]
203+
pyrefly-remove-unused-ignores *options: (_typecheck "-c'pyrefly check --remove-unused-ignores'")
204+
196205
# Run pylint (with optional args)
197206
[group("lint")]
198207
[group("typecheck")]
199208
pylint:
200209
#!/usr/bin/env sh
201-
set -exu
210+
set -eu
202211
possible=("src" "tests" "noxfile.py" "tools" "scripts")
203212
options=()
204213
for d in "${possible[@]}"; do

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ pytest-accept = [ "pytest-accept" ]
100100
test-extras = [
101101
{ include-group = "test" },
102102
]
103-
typecheck-runner = [ "typecheck-runner>=0.1.0; python_version>'3.9'" ]
103+
typecheck-runner = [ "typecheck-runner>=0.1.6; python_version>'3.9'" ]
104104

105105
# * uv -------------------------------------------------------------------------
106106
[tool.uv]

requirements/py314-dev.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ dependencies:
2222
- pytest-cov
2323
- pytest-sugar
2424
- pytest-xdist
25-
- typecheck-runner>=0.1.0
25+
- typecheck-runner>=0.1.6
2626
- typer
2727
- types-click
2828
- pip

requirements/uvx-tools.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,4 @@ pyright>=1.1.396
2121
rooster>=0.1.1
2222
twine>=5.0.0
2323
ty>=0.0.14
24-
typecheck-runner>=0.1.0; python_version > "3.9"
24+
typecheck-runner>=0.1.6; python_version > "3.9"

uv.lock

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)