Skip to content

Commit cb24dcf

Browse files
committed
Update to latest uv version of copier template
1 parent 7454dd9 commit cb24dcf

File tree

8 files changed

+26
-27
lines changed

8 files changed

+26
-27
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: 5.0.0a3
2+
_commit: 5.0.0a3-3-g238de53
33
_src_path: gh:DiamondLightSource/python-copier-template
44
author_email: [email protected]
55
author_name: Giles Knap

.devcontainer/devcontainer.json

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,22 @@
88
"remoteEnv": {
99
// Allow X11 apps to run inside the container
1010
"DISPLAY": "${localEnv:DISPLAY}",
11+
// Put things that allow it in the persistent cache
12+
"PRE_COMMIT_HOME": "/cache/pre-commit",
13+
"UV_CACHE_DIR": "/cache/uv",
14+
"UV_PYTHON_CACHE_DIR": "/cache/uv-python",
15+
// Make a venv that is specific for this workspace path as the cache is shared
16+
"UV_PROJECT_ENVIRONMENT": "/cache/venv-for${localWorkspaceFolder}",
1117
// Do the equivalent of "activate" the venv so we don't have to "uv run" everything
12-
"VIRTUAL_ENV": "/workspaces/${localWorkspaceFolderBasename}/.venv",
13-
"PATH": "/workspaces/${localWorkspaceFolderBasename}/.venv/bin:${containerEnv:PATH}"
18+
"VIRTUAL_ENV": "/cache/venv-for${localWorkspaceFolder}",
19+
"PATH": "/cache/venv-for${localWorkspaceFolder}/bin:${containerEnv:PATH}"
1420
},
1521
"customizations": {
1622
"vscode": {
1723
// Set *default* container specific settings.json values on container create.
1824
"settings": {
1925
// Use the container's python by default
20-
"python.defaultInterpreterPath": "/workspaces/${localWorkspaceFolderBasename}/.venv/bin/python",
26+
"python.defaultInterpreterPath": "/cache/venv-for${localWorkspaceFolder}/bin/python",
2127
// Don't activate the venv as it is already in the PATH
2228
"python.terminal.activateEnvInCurrentTerminal": false,
2329
"python.terminal.activateEnvironment": false,
@@ -38,9 +44,7 @@
3844
}
3945
},
4046
// Create the config folder for the bash-config feature and uv cache
41-
// NOTE: The uv cache can get large, DLS users should read
42-
// https://dev-guide.diamond.ac.uk/linux-user-environment/how-tos/disk-quota-troubleshooting
43-
"initializeCommand": "mkdir -p ${localEnv:HOME}/.config/terminal-config ${localEnv:HOME}/.cache/uv",
47+
"initializeCommand": "mkdir -p ${localEnv:HOME}/.config/terminal-config",
4448
"runArgs": [
4549
// Allow the container to access the host X11 display and EPICS CA
4650
"--net=host",
@@ -54,20 +58,15 @@
5458
"target": "/user-terminal-config",
5559
"type": "bind"
5660
},
57-
// Keep a persistent cross container cache for uv
61+
// Keep a persistent cross container cache for uv, pre-commit, and the venvs
5862
{
59-
"source": "${localEnv:HOME}/.cache/uv",
60-
"target": "/root/.cache/uv",
61-
"type": "bind"
62-
},
63-
// Use a volume mount for the uv venv so it is local to the container
64-
{
65-
"target": "/workspaces/${localWorkspaceFolderBasename}/.venv",
63+
"source": "devcontainer-shared-cache",
64+
"target": "/cache",
6665
"type": "volume"
6766
}
6867
],
6968
// Mount the parent as /workspaces so we can pip install peers as editable
7069
"workspaceMount": "source=${localWorkspaceFolder}/..,target=/workspaces,type=bind",
71-
// After the container is created, install the python project in editable form
72-
"postCreateCommand": "uv sync && uv run pre-commit install --install-hooks"
70+
// After the container is created, recreate the venv then make pre-commit first run faster
71+
"postCreateCommand": "uv venv --clear && uv sync && pre-commit install --install-hooks"
7372
}

.github/workflows/_container.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111

1212
steps:
1313
- name: Checkout
14-
uses: actions/checkout@v4
14+
uses: actions/checkout@v5
1515
with:
1616
# Need this to get version number from last tag
1717
fetch-depth: 0

.github/workflows/_dist.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@ jobs:
77

88
steps:
99
- name: Checkout
10-
uses: actions/checkout@v4
10+
uses: actions/checkout@v5
1111
with:
1212
# Need this to get version number from last tag
1313
fetch-depth: 0
1414

1515
- name: Install uv
16-
uses: astral-sh/setup-uv@v6
16+
uses: astral-sh/setup-uv@v7
1717

1818
- name: Build sdist and wheel
1919
run: >

.github/workflows/_pypi.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88

99
steps:
1010
- name: Download dist artifact
11-
uses: actions/download-artifact@v4
11+
uses: actions/download-artifact@v5
1212
with:
1313
name: dist
1414
path: dist

.github/workflows/_release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ jobs:
77

88
steps:
99
- name: Download artifacts
10-
uses: actions/download-artifact@v4
10+
uses: actions/download-artifact@v5
1111
with:
1212
merge-multiple: true
1313

@@ -23,7 +23,7 @@ jobs:
2323
- name: Create GitHub Release
2424
# We pin to the SHA, not the tag, for security reasons.
2525
# https://docs.github.com/en/actions/learn-github-actions/security-hardening-for-github-actions#using-third-party-actions
26-
uses: softprops/action-gh-release@da05d552573ad5aba039eaac05058a918a7bf631 # v2.2.2
26+
uses: softprops/action-gh-release@6da8fa9354ddfdc4aeace5fc48d7f679b5214090 # v2.4.1
2727
with:
2828
prerelease: ${{ contains(github.ref_name, 'a') || contains(github.ref_name, 'b') || contains(github.ref_name, 'rc') }}
2929
files: "*"

.github/workflows/_test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,13 @@ jobs:
2424

2525
steps:
2626
- name: Checkout
27-
uses: actions/checkout@v4
27+
uses: actions/checkout@v5
2828
with:
2929
# Need this to get version number from last tag
3030
fetch-depth: 0
3131

3232
- name: Install uv
33-
uses: astral-sh/setup-uv@v5
33+
uses: astral-sh/setup-uv@v7
3434

3535
- name: Run tests
3636
run: uv run --locked tox -e tests

.github/workflows/_tox.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ jobs:
1313

1414
steps:
1515
- name: Checkout
16-
uses: actions/checkout@v4
16+
uses: actions/checkout@v5
1717

1818
- name: Install uv
19-
uses: astral-sh/setup-uv@v5
19+
uses: astral-sh/setup-uv@v7
2020

2121
- name: Run tox
2222
run: uv run --locked tox -e ${{ inputs.tox }}

0 commit comments

Comments
 (0)