Skip to content

Commit a77ac07

Browse files
authored
Merge pull request #201 from bluesky/copier-update
Update to copier 5.0.2
2 parents b9a07b3 + 84c7be9 commit a77ac07

File tree

14 files changed

+79
-38
lines changed

14 files changed

+79
-38
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.0a2
2+
_commit: 5.0.2
33
_src_path: gh:DiamondLightSource/python-copier-template
44
author_email: tom.cobb@diamond.ac.uk
55
author_name: Tom Cobb

.devcontainer/devcontainer.json

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,28 @@
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-
"PATH": "/workspaces/${localWorkspaceFolderBasename}/.venv/bin:${containerEnv:PATH}"
18+
"VIRTUAL_ENV": "/cache/venv-for${localWorkspaceFolder}",
19+
"PATH": "/cache/venv-for${localWorkspaceFolder}/bin:${containerEnv:PATH}"
1320
},
1421
"customizations": {
1522
"vscode": {
1623
// Set *default* container specific settings.json values on container create.
1724
"settings": {
18-
"python.defaultInterpreterPath": "/workspaces/${localWorkspaceFolderBasename}/.venv/bin/python",
25+
// Use the container's python by default
26+
"python.defaultInterpreterPath": "/cache/venv-for${localWorkspaceFolder}/bin/python",
27+
// Don't activate the venv as it is already in the PATH
1928
"python.terminal.activateEnvInCurrentTerminal": false,
2029
"python.terminal.activateEnvironment": false,
21-
"remote.autoForwardPorts": false
30+
// Workaround to prevent garbled python REPL in the terminal
31+
// https://github.com/microsoft/vscode-python/issues/25505
32+
"python.terminal.shellIntegration.enabled": false
2233
},
2334
// Add the IDs of extensions you want installed when the container is created.
2435
"extensions": [
@@ -34,7 +45,7 @@
3445
}
3546
},
3647
// Create the config folder for the bash-config feature and uv cache
37-
"initializeCommand": "mkdir -p ${localEnv:HOME}/.config/terminal-config ${localEnv:HOME}/.cache/uv",
48+
"initializeCommand": "mkdir -p ${localEnv:HOME}/.config/terminal-config",
3849
"runArgs": [
3950
// Allow the container to access the host X11 display and EPICS CA
4051
"--net=host",
@@ -48,20 +59,15 @@
4859
"target": "/user-terminal-config",
4960
"type": "bind"
5061
},
51-
// Keep a persistent cross container cache for uv
62+
// Keep a persistent cross container cache for uv, pre-commit, and the venvs
5263
{
53-
"source": "${localEnv:HOME}/.cache/uv",
54-
"target": "/root/.cache/uv",
55-
"type": "bind"
56-
},
57-
// Use a volume mount for the uv venv so it is local to the container
58-
{
59-
"target": "/workspaces/${localWorkspaceFolderBasename}/.venv",
64+
"source": "devcontainer-shared-cache",
65+
"target": "/cache",
6066
"type": "volume"
6167
}
6268
],
6369
// Mount the parent as /workspaces so we can pip install peers as editable
6470
"workspaceMount": "source=${localWorkspaceFolder}/..,target=/workspaces,type=bind",
65-
// After the container is created, install the python project in editable form
66-
"postCreateCommand": "uv sync && uv run pre-commit install --install-hooks"
71+
// After the container is created, recreate the venv then make pre-commit first run faster
72+
"postCreateCommand": "uv venv --clear && uv sync && pre-commit install --install-hooks"
6773
}

.github/CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,4 @@ It is recommended that developers use a [vscode devcontainer](https://code.visua
2424

2525
This project was created using the [Diamond Light Source Copier Template](https://github.com/DiamondLightSource/python-copier-template) for Python projects.
2626

27-
For more information on common tasks like setting up a developer environment, running the tests, and setting a pre-commit hook, see the template's [How-to guides](https://diamondlightsource.github.io/python-copier-template/5.0.0a2/how-to.html).
27+
For more information on common tasks like setting up a developer environment, running the tests, and setting a pre-commit hook, see the template's [How-to guides](https://diamondlightsource.github.io/python-copier-template/5.0.2/how-to.html).

.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/_docs.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
run: sleep 60
1212

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
@@ -20,7 +20,7 @@ jobs:
2020
run: sudo apt-get install graphviz
2121

2222
- name: Install uv
23-
uses: astral-sh/setup-uv@v5
23+
uses: astral-sh/setup-uv@v7
2424

2525
- name: Build docs
2626
run: uv run --locked tox -e docs

.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 & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,6 @@ on:
99
type: string
1010
description: The runner to run this job on
1111
required: true
12-
secrets:
13-
CODECOV_TOKEN:
14-
required: true
1512

1613
env:
1714
# https://github.com/pytest-dev/pytest/issues/2042
@@ -24,13 +21,13 @@ jobs:
2421

2522
steps:
2623
- name: Checkout
27-
uses: actions/checkout@v4
24+
uses: actions/checkout@v5
2825
with:
2926
# Need this to get version number from last tag
3027
fetch-depth: 0
3128

3229
- name: Install uv
33-
uses: astral-sh/setup-uv@v5
30+
uses: astral-sh/setup-uv@v7
3431

3532
- name: Run tests
3633
run: uv run --locked tox -e tests
@@ -40,5 +37,3 @@ jobs:
4037
with:
4138
name: ${{ inputs.python-version }}/${{ inputs.runs-on }}
4239
files: cov.xml
43-
env:
44-
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

.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)