Skip to content

Commit d22ec2c

Browse files
committed
more copier
1 parent c823c50 commit d22ec2c

File tree

5 files changed

+59
-7
lines changed

5 files changed

+59
-7
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-g989d612
2+
_commit: v0.0.15
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."

extensions/context.py

Lines changed: 1 addition & 1 deletion
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"

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

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)