Skip to content
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
2 changes: 1 addition & 1 deletion .copier-answers.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Changes here will be overwritten by Copier
_commit: v0.0.14
_commit: v0.0.16
_src_path: gh:LabAutomationAndScreening/copier-base-template.git
description: Copier template for creating Python libraries and executables
python_ci_versions:
Expand Down
51 changes: 51 additions & 0 deletions .devcontainer/windows-host-helper.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
#!/bin/bash

# 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:
# cp .devcontainer/windows-host-helper.sh ../
# cd ..
# bash windows-host-helper.sh <git-url>

# 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

set -e # Exit immediately on error

if [ -z "$BASH_VERSION" ]; then
echo "Error: This script must be run with bash (e.g., 'bash windows-host-helper.sh')." >&2
exit 1
fi

# Check for the git URL argument
if [ -z "$1" ]; then
echo "Usage: $0 <git-url>"
exit 1
fi

gitUrl="$1"

# Extract repository name (removes .git suffix if present)
repoName=$(basename "$gitUrl" .git)

echo "Repo name extracted as '$repoName'"

# Remove any existing subfolder with the repository name and recreate it
rm -rf "./$repoName" || true # sometimes deleting the .venv folder fails
rm -rf "./$repoName/*.md" # for some reason, sometimes md files are left behind
mkdir -p "./$repoName"

# Create a temporary directory for cloning
tmpdir=$(mktemp -d)

# Clone the repository into a subfolder inside the temporary directory.
# This creates "$tmpdir/$repoName" with the repository's contents.
git clone "$gitUrl" "$tmpdir/$repoName"

# Enable dotglob so that '*' includes hidden files
shopt -s dotglob

# Move all contents (including hidden files) from the cloned repo to the target folder
mv "$tmpdir/$repoName"/* "./$repoName/"

# Clean up: remove the temporary directory
rm -rf "$tmpdir"

echo "Repository '$repoName' has been updated."
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ repos:
- id: ruff-format

- repo: https://github.com/pylint-dev/pylint
rev: aaab3ccb541532d2bcdf0410ab93ff4fafc266f5 # frozen: v3.3.5
rev: 88543500c70e3aa303b6c0861e2a7a006673f6a8
hooks:
- id: pylint
name: pylint
Expand Down
10 changes: 8 additions & 2 deletions extensions/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def hook(self, context: dict[Any, Any]) -> dict[Any, Any]:
context["uv_version"] = "0.6.6"
context["pnpm_version"] = "10.6.3"
context["pre_commit_version"] = "4.1.0"
context["pyright_version"] = "1.1.396"
context["pyright_version"] = "1.1.397"
context["pytest_version"] = "8.3.4"
context["pytest_randomly_version"] = "3.16.0"
context["pytest_cov_version"] = "6.0.0"
Expand All @@ -37,7 +37,10 @@ def hook(self, context: dict[Any, Any]) -> dict[Any, Any]:
context["gha_checkout"] = "v4.2.2"
context["gha_setup_python"] = "v5.4.0"
context["gha_cache"] = "v4.2.2"
context["gha_upload_artifact"] = "v4.6.1"
context["gha_upload_artifact"] = "v4.6.2"
context["gha_download_artifact"] = "v4.2.1"
context["gha_setup_buildx"] = "v3.10.0"
context["gha_docker_build_push"] = "v6.15.0"
context["gha_configure_aws_credentials"] = "v4.1.0"
context["gha_setup_node"] = "v4.3.0"
context["gha_mutex"] = "1ebad517141198e08d47cf72f3c0975316620a65 # v1.0.0-alpha.10"
Expand All @@ -48,6 +51,9 @@ def hook(self, context: dict[Any, Any]) -> dict[Any, Any]:
context["py312_version"] = "3.12.7"
context["py313_version"] = "3.13.2"

context["debian_release_name"] = "bookworm"
context["alpine_image_version"] = "3.20"

# Kludge to be able to help symlinked jinja files in the child and grandchild templates
context["template_uses_vuejs"] = False
context["template_uses_javascript"] = False
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ dependencies = [
"pytest>=8.3.4",
"pytest-cov>=6.0.0",
"pytest-randomly>=3.16.0",
"pyright[nodejs]>=1.1.396",
"pyright[nodejs]>=1.1.397",
"copier>=9.5.0",
"copier-templates-extensions>=0.3.0"

Expand Down
3 changes: 3 additions & 0 deletions template/.devcontainer/devcontainer.json.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@
{% 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 %}
// VueJS
"vue.volar@2.2.8",
{% 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 %}
// All javascript
"dbaeumer.vscode-eslint@3.0.13",
{% endraw %}{% endif %}{% raw %}

// Misc file formats
Expand Down
51 changes: 51 additions & 0 deletions template/.devcontainer/windows-host-helper.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
#!/bin/bash

# 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:
# cp .devcontainer/windows-host-helper.sh ../
# cd ..
# bash windows-host-helper.sh <git-url>

# 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

set -e # Exit immediately on error

if [ -z "$BASH_VERSION" ]; then
echo "Error: This script must be run with bash (e.g., 'bash windows-host-helper.sh')." >&2
exit 1
fi

# Check for the git URL argument
if [ -z "$1" ]; then
echo "Usage: $0 <git-url>"
exit 1
fi

gitUrl="$1"

# Extract repository name (removes .git suffix if present)
repoName=$(basename "$gitUrl" .git)

echo "Repo name extracted as '$repoName'"

# Remove any existing subfolder with the repository name and recreate it
rm -rf "./$repoName" || true # sometimes deleting the .venv folder fails
rm -rf "./$repoName/*.md" # for some reason, sometimes md files are left behind
mkdir -p "./$repoName"

# Create a temporary directory for cloning
tmpdir=$(mktemp -d)

# Clone the repository into a subfolder inside the temporary directory.
# This creates "$tmpdir/$repoName" with the repository's contents.
git clone "$gitUrl" "$tmpdir/$repoName"

# Enable dotglob so that '*' includes hidden files
shopt -s dotglob

# Move all contents (including hidden files) from the cloned repo to the target folder
mv "$tmpdir/$repoName"/* "./$repoName/"

# Clean up: remove the temporary directory
rm -rf "$tmpdir"

echo "Repository '$repoName' has been updated."
2 changes: 1 addition & 1 deletion template/.pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ repos:
- id: ruff-format

- repo: https://github.com/pylint-dev/pylint
rev: aaab3ccb541532d2bcdf0410ab93ff4fafc266f5 # frozen: v3.3.5
rev: 88543500c70e3aa303b6c0861e2a7a006673f6a8
hooks:
- id: pylint
name: pylint
Expand Down
9 changes: 5 additions & 4 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.