Skip to content

Commit 4453106

Browse files
authored
Copier update (pylint) (#16)
## Why is this change necessary? Keep up to date ## How does this change address the issue? Pulls in upstream changes ## What side effects does this change have? None ## How is this change tested? ephemeral-pulumi-deploy repo
1 parent d7f7604 commit 4453106

File tree

9 files changed

+122
-10
lines changed

9 files changed

+122
-10
lines changed

.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
2-
_commit: v0.0.14
2+
_commit: v0.0.16
33
_src_path: gh:LabAutomationAndScreening/copier-base-template.git
44
description: Copier template for creating Python libraries and executables
55
python_ci_versions:
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
#!/bin/bash
2+
3+
# If you are using a Windows host and you initially cloned the repository directly onto your hard drive, you may run into file permission issues when running copier updates. To avoid these, after initially building the devcontainer, run this from the repo root:
4+
# cp .devcontainer/windows-host-helper.sh ../
5+
# cd ..
6+
# bash windows-host-helper.sh <git-url>
7+
8+
# If you're still having issues, make sure in Windows Developer Settings that you enabled Developer Mode, and also that you set your git config to have `core.autocrlf=false` and `core.symlinks=true` globally
9+
10+
set -e # Exit immediately on error
11+
12+
if [ -z "$BASH_VERSION" ]; then
13+
echo "Error: This script must be run with bash (e.g., 'bash windows-host-helper.sh')." >&2
14+
exit 1
15+
fi
16+
17+
# Check for the git URL argument
18+
if [ -z "$1" ]; then
19+
echo "Usage: $0 <git-url>"
20+
exit 1
21+
fi
22+
23+
gitUrl="$1"
24+
25+
# Extract repository name (removes .git suffix if present)
26+
repoName=$(basename "$gitUrl" .git)
27+
28+
echo "Repo name extracted as '$repoName'"
29+
30+
# Remove any existing subfolder with the repository name and recreate it
31+
rm -rf "./$repoName" || true # sometimes deleting the .venv folder fails
32+
rm -rf "./$repoName/*.md" # for some reason, sometimes md files are left behind
33+
mkdir -p "./$repoName"
34+
35+
# Create a temporary directory for cloning
36+
tmpdir=$(mktemp -d)
37+
38+
# Clone the repository into a subfolder inside the temporary directory.
39+
# This creates "$tmpdir/$repoName" with the repository's contents.
40+
git clone "$gitUrl" "$tmpdir/$repoName"
41+
42+
# Enable dotglob so that '*' includes hidden files
43+
shopt -s dotglob
44+
45+
# Move all contents (including hidden files) from the cloned repo to the target folder
46+
mv "$tmpdir/$repoName"/* "./$repoName/"
47+
48+
# Clean up: remove the temporary directory
49+
rm -rf "$tmpdir"
50+
51+
echo "Repository '$repoName' has been updated."

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ repos:
191191
- id: ruff-format
192192

193193
- repo: https://github.com/pylint-dev/pylint
194-
rev: aaab3ccb541532d2bcdf0410ab93ff4fafc266f5 # frozen: v3.3.5
194+
rev: 88543500c70e3aa303b6c0861e2a7a006673f6a8
195195
hooks:
196196
- id: pylint
197197
name: pylint

extensions/context.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ def hook(self, context: dict[Any, Any]) -> dict[Any, Any]:
1313
context["uv_version"] = "0.6.6"
1414
context["pnpm_version"] = "10.6.3"
1515
context["pre_commit_version"] = "4.1.0"
16-
context["pyright_version"] = "1.1.396"
16+
context["pyright_version"] = "1.1.397"
1717
context["pytest_version"] = "8.3.4"
1818
context["pytest_randomly_version"] = "3.16.0"
1919
context["pytest_cov_version"] = "6.0.0"
@@ -37,7 +37,10 @@ def hook(self, context: dict[Any, Any]) -> dict[Any, Any]:
3737
context["gha_checkout"] = "v4.2.2"
3838
context["gha_setup_python"] = "v5.4.0"
3939
context["gha_cache"] = "v4.2.2"
40-
context["gha_upload_artifact"] = "v4.6.1"
40+
context["gha_upload_artifact"] = "v4.6.2"
41+
context["gha_download_artifact"] = "v4.2.1"
42+
context["gha_setup_buildx"] = "v3.10.0"
43+
context["gha_docker_build_push"] = "v6.15.0"
4144
context["gha_configure_aws_credentials"] = "v4.1.0"
4245
context["gha_setup_node"] = "v4.3.0"
4346
context["gha_mutex"] = "1ebad517141198e08d47cf72f3c0975316620a65 # v1.0.0-alpha.10"
@@ -48,6 +51,9 @@ def hook(self, context: dict[Any, Any]) -> dict[Any, Any]:
4851
context["py312_version"] = "3.12.7"
4952
context["py313_version"] = "3.13.2"
5053

54+
context["debian_release_name"] = "bookworm"
55+
context["alpine_image_version"] = "3.20"
56+
5157
# Kludge to be able to help symlinked jinja files in the child and grandchild templates
5258
context["template_uses_vuejs"] = False
5359
context["template_uses_javascript"] = False

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ dependencies = [
99
"pytest>=8.3.4",
1010
"pytest-cov>=6.0.0",
1111
"pytest-randomly>=3.16.0",
12-
"pyright[nodejs]>=1.1.396",
12+
"pyright[nodejs]>=1.1.397",
1313
"copier>=9.5.0",
1414
"copier-templates-extensions>=0.3.0"
1515

template/.devcontainer/devcontainer.json.jinja

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@
4141
{% endraw %}{% if is_child_of_copier_base_template is not defined and template_uses_vuejs is defined and template_uses_vuejs is sameas(true) %}{% raw %}
4242
// VueJS
4343
"vue.volar@2.2.8",
44+
{% endraw %}{% endif %}{% raw %}{% endraw %}{% if is_child_of_copier_base_template is not defined and template_uses_javascript is defined and template_uses_javascript is sameas(true) %}{% raw %}
45+
// All javascript
46+
"dbaeumer.vscode-eslint@3.0.13",
4447
{% endraw %}{% endif %}{% raw %}
4548

4649
// Misc file formats
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
#!/bin/bash
2+
3+
# If you are using a Windows host and you initially cloned the repository directly onto your hard drive, you may run into file permission issues when running copier updates. To avoid these, after initially building the devcontainer, run this from the repo root:
4+
# cp .devcontainer/windows-host-helper.sh ../
5+
# cd ..
6+
# bash windows-host-helper.sh <git-url>
7+
8+
# If you're still having issues, make sure in Windows Developer Settings that you enabled Developer Mode, and also that you set your git config to have `core.autocrlf=false` and `core.symlinks=true` globally
9+
10+
set -e # Exit immediately on error
11+
12+
if [ -z "$BASH_VERSION" ]; then
13+
echo "Error: This script must be run with bash (e.g., 'bash windows-host-helper.sh')." >&2
14+
exit 1
15+
fi
16+
17+
# Check for the git URL argument
18+
if [ -z "$1" ]; then
19+
echo "Usage: $0 <git-url>"
20+
exit 1
21+
fi
22+
23+
gitUrl="$1"
24+
25+
# Extract repository name (removes .git suffix if present)
26+
repoName=$(basename "$gitUrl" .git)
27+
28+
echo "Repo name extracted as '$repoName'"
29+
30+
# Remove any existing subfolder with the repository name and recreate it
31+
rm -rf "./$repoName" || true # sometimes deleting the .venv folder fails
32+
rm -rf "./$repoName/*.md" # for some reason, sometimes md files are left behind
33+
mkdir -p "./$repoName"
34+
35+
# Create a temporary directory for cloning
36+
tmpdir=$(mktemp -d)
37+
38+
# Clone the repository into a subfolder inside the temporary directory.
39+
# This creates "$tmpdir/$repoName" with the repository's contents.
40+
git clone "$gitUrl" "$tmpdir/$repoName"
41+
42+
# Enable dotglob so that '*' includes hidden files
43+
shopt -s dotglob
44+
45+
# Move all contents (including hidden files) from the cloned repo to the target folder
46+
mv "$tmpdir/$repoName"/* "./$repoName/"
47+
48+
# Clean up: remove the temporary directory
49+
rm -rf "$tmpdir"
50+
51+
echo "Repository '$repoName' has been updated."

template/.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ repos:
191191
- id: ruff-format
192192

193193
- repo: https://github.com/pylint-dev/pylint
194-
rev: aaab3ccb541532d2bcdf0410ab93ff4fafc266f5 # frozen: v3.3.5
194+
rev: 88543500c70e3aa303b6c0861e2a7a006673f6a8
195195
hooks:
196196
- id: pylint
197197
name: pylint

uv.lock

Lines changed: 5 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)