Skip to content

Commit 7454dd9

Browse files
authored
Merge pull request #222 from epics-containers/5.0.0-dev
5.0.0 changes see epics-containers/ec-helm-charts#84
2 parents 6ed12be + 223fc6f commit 7454dd9

File tree

29 files changed

+1620
-216
lines changed

29 files changed

+1620
-216
lines changed

.copier-answers.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
11
# Changes here will be overwritten by Copier
2-
_commit: 2.6.0
2+
_commit: 5.0.0a3
33
_src_path: gh:DiamondLightSource/python-copier-template
44
author_email: [email protected]
55
author_name: Giles Knap
66
description: CLI for deploying and managing epics containers IOCs and services
77
distribution_name: edge-containers-cli
88
docker: true
9+
docker_debug: false
910
docs_type: README
1011
git_platform: github.com
1112
github_org: epics-containers
1213
package_name: edge_containers_cli
1314
pypi: true
1415
repo_name: edge-containers-cli
16+
strict_typing: false
1517
type_checker: pyright

.devcontainer/devcontainer.json

Lines changed: 36 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,23 @@
77
},
88
"remoteEnv": {
99
// Allow X11 apps to run inside the container
10-
"DISPLAY": "${localEnv:DISPLAY}"
10+
"DISPLAY": "${localEnv:DISPLAY}",
11+
// 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}"
1114
},
1215
"customizations": {
1316
"vscode": {
1417
// Set *default* container specific settings.json values on container create.
1518
"settings": {
16-
"python.defaultInterpreterPath": "/venv/bin/python"
19+
// Use the container's python by default
20+
"python.defaultInterpreterPath": "/workspaces/${localWorkspaceFolderBasename}/.venv/bin/python",
21+
// Don't activate the venv as it is already in the PATH
22+
"python.terminal.activateEnvInCurrentTerminal": false,
23+
"python.terminal.activateEnvironment": false,
24+
// Workaround to prevent garbled python REPL in the terminal
25+
// https://github.com/microsoft/vscode-python/issues/25505
26+
"python.terminal.shellIntegration.enabled": false
1727
},
1828
// Add the IDs of extensions you want installed when the container is created.
1929
"extensions": [
@@ -27,20 +37,37 @@
2737
]
2838
}
2939
},
30-
"features": {
31-
// add in eternal history and other bash features
32-
"ghcr.io/diamondlightsource/devcontainer-features/bash-config:1": {}
33-
},
34-
// Create the config folder for the bash-config feature
35-
"initializeCommand": "mkdir -p ${localEnv:HOME}/.config/bash-config",
40+
// 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",
3644
"runArgs": [
3745
// Allow the container to access the host X11 display and EPICS CA
3846
"--net=host",
3947
// Make sure SELinux does not disable with access to host filesystems like tmp
4048
"--security-opt=label=disable"
4149
],
50+
"mounts": [
51+
// Mount in the user terminal config folder so it can be edited
52+
{
53+
"source": "${localEnv:HOME}/.config/terminal-config",
54+
"target": "/user-terminal-config",
55+
"type": "bind"
56+
},
57+
// Keep a persistent cross container cache for uv
58+
{
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",
66+
"type": "volume"
67+
}
68+
],
4269
// Mount the parent as /workspaces so we can pip install peers as editable
4370
"workspaceMount": "source=${localWorkspaceFolder}/..,target=/workspaces,type=bind",
4471
// After the container is created, install the python project in editable form
45-
"postCreateCommand": "pip install $([ -f dev-requirements.txt ] && echo '-c dev-requirements.txt') -e '.[dev]' && pre-commit install"
72+
"postCreateCommand": "uv sync && uv run pre-commit install --install-hooks"
4673
}

.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/2.6.0/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.0a3/how-to.html).

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ assignees: ''
77

88
---
99

10-
Describe the bug, including a clear and concise description of the expected behavior, the actual behavior and the context in which you encountered it (ideally include details of your environment).
10+
Describe the bug, including a clear and concise description of the expected behaviour, the actual behavior and the context in which you encountered it (ideally include details of your environment).
1111

1212
## Steps To Reproduce
1313
Steps to reproduce the behavior:

.github/actions/install_requirements/action.yml

Lines changed: 0 additions & 34 deletions
This file was deleted.

.github/dependabot.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ updates:
1313
actions:
1414
patterns:
1515
- "*"
16+
commit-message:
17+
prefix: "chore"
1618

1719
- package-ecosystem: "pip"
1820
directory: "/"
@@ -22,3 +24,5 @@ updates:
2224
dev-dependencies:
2325
patterns:
2426
- "*"
27+
commit-message:
28+
prefix: "chore"

.github/workflows/_check.yml

Lines changed: 0 additions & 27 deletions
This file was deleted.

.github/workflows/_container.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
on:
22
workflow_call:
3+
inputs:
4+
publish:
5+
type: boolean
6+
description: If true, pushes image to container registry
37

48
jobs:
59
build:
@@ -47,7 +51,7 @@ jobs:
4751
type=raw,value=latest
4852
4953
- name: Push cached image to container registry
50-
if: github.ref_type == 'tag'
54+
if: inputs.publish && github.ref_type == 'tag'
5155
uses: docker/build-push-action@v6
5256
env:
5357
DOCKER_BUILD_RECORD_UPLOAD: false

.github/workflows/_dist.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,13 @@ jobs:
1212
# Need this to get version number from last tag
1313
fetch-depth: 0
1414

15+
- name: Install uv
16+
uses: astral-sh/setup-uv@v6
17+
1518
- name: Build sdist and wheel
1619
run: >
1720
export SOURCE_DATE_EPOCH=$(git log -1 --pretty=%ct) &&
18-
pipx run build
21+
uvx --from build pyproject-build
1922
2023
- name: Upload sdist and wheel as artifacts
2124
uses: actions/upload-artifact@v4
@@ -24,12 +27,10 @@ jobs:
2427
path: dist
2528

2629
- name: Check for packaging errors
27-
run: pipx run twine check --strict dist/*
30+
run: uvx twine check --strict dist/*
2831

2932
- name: Install produced wheel
30-
uses: ./.github/actions/install_requirements
31-
with:
32-
pip-install: dist/*.whl
33+
run: python -m pip install dist/*.whl
3334

3435
- name: Test module --version works using the installed wheel
3536
# If more than one module in src/ replace with module name to test

.github/workflows/_release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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@c95fe1489396fe8a9eb87c0abf8aa5b2ef267fda # v2.2.1
26+
uses: softprops/action-gh-release@da05d552573ad5aba039eaac05058a918a7bf631 # v2.2.2
2727
with:
2828
prerelease: ${{ contains(github.ref_name, 'a') || contains(github.ref_name, 'b') || contains(github.ref_name, 'rc') }}
2929
files: "*"

0 commit comments

Comments
 (0)