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
3 changes: 2 additions & 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.16
_commit: v0.0.19
_src_path: gh:LabAutomationAndScreening/copier-base-template.git
description: Copier template for creating Python libraries and executables
python_ci_versions:
Expand All @@ -9,6 +9,7 @@ python_version: 3.12.7
repo_name: copier-python-package-template
repo_org_name: LabAutomationAndScreening
ssh_port_number: 55874
template_might_want_to_install_aws_ssm_port_forwarding_plugin: false
template_uses_javascript: false
template_uses_pulumi: false
template_uses_python: true
Expand Down
1 change: 0 additions & 1 deletion .devcontainer/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
version: '3.8'
services:
devcontainer:
build:
Expand Down
2 changes: 2 additions & 0 deletions .devcontainer/install-ci-tooling.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ set -ex





curl -LsSf https://astral.sh/uv/0.6.6/install.sh | sh
uv --version
# TODO: add uv autocompletion to the shell https://docs.astral.sh/uv/getting-started/installation/#shell-autocompletion
Expand Down
54 changes: 54 additions & 0 deletions .github/reusable_workflows/build-docker-image.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Build Docker Image

on:
workflow_call:
inputs:
repository:
description: 'Docker repository'
type: string
required: true
image_name:
description: 'Docker image name'
type: string
required: true
tag:
description: 'Docker image tag'
type: string
required: true
context:
description: 'Build context path'
type: string
required: false
default: './'


jobs:
build-image:
name: Build Docker Image
runs-on: ubuntu-24.04
steps:
- name: Checkout code
uses: actions/checkout@v4.2.2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3.10.0
with:
version: v0.22.0

- name: Build Docker Image
uses: docker/build-push-action@v6.15.0
with:
context: ${{ inputs.context }}
push: false
load: true # make the image available later for the `docker save` step
tags: ${{ inputs.repository }}/${{ inputs.image_name }}:${{ inputs.tag }}

- name: Save Docker Image as tar
run: docker save -o ${{ inputs.image_name }}.tar ${{ inputs.repository }}/${{ inputs.image_name }}:${{ inputs.tag }}

- name: Upload Docker Image Artifact
uses: actions/upload-artifact@v4.6.2
with:
name: ${{ inputs.image_name }}
path: ${{ inputs.image_name }}.tar
if-no-files-found: error
5 changes: 3 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -175,10 +175,11 @@ repos:
hooks:
- id: hadolint-docker
name: Lint Dockerfiles
exclude: .*\.jinja$
description: Runs hadolint to lint Dockerfiles

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: 99abe27a5a16f301d9e0a3828181399dfbf54ebd # frozen: v0.11.0
rev: 25a8c8da6c24a3b9a1a536e2674683dd0eead5d6 # frozen: v0.11.2
hooks:
- id: ruff
name: ruff-src
Expand All @@ -191,7 +192,7 @@ repos:
- id: ruff-format

- repo: https://github.com/pylint-dev/pylint
rev: 88543500c70e3aa303b6c0861e2a7a006673f6a8
rev: 7ac5a4d4f77576df3a00e63f86ca86e0e1780b47 # frozen: v3.3.6
hooks:
- id: pylint
name: pylint
Expand Down
5 changes: 5 additions & 0 deletions extensions/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,17 @@ def hook(self, context: dict[Any, Any]) -> dict[Any, Any]:
context["fastapi_version"] = "0.115.11"
context["uvicorn_version"] = "0.34.0"

context["nuxt_ui_version"] = "^3.0.0"
context["nuxt_version"] = "^3.16.0"
context["typescript_version"] = "^5.8.2"

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.2"
context["gha_download_artifact"] = "v4.2.1"
context["gha_setup_buildx"] = "v3.10.0"
context["buildx_version"] = "v0.22.0"
context["gha_docker_build_push"] = "v6.15.0"
context["gha_configure_aws_credentials"] = "v4.1.0"
context["gha_setup_node"] = "v4.3.0"
Expand Down
2 changes: 1 addition & 1 deletion pytest.ini
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[pytest]
# Settings managed by the base template
norecursedirs = node_modules .precommit_cache .npm_cache .pipenv_cache venv .venv .history
addopts = --cov=src --cov-report html --cov-report term-missing:skip-covered
addopts = --cov=src --cov-report html --cov-report term-missing:skip-covered --cov-config=./.coveragerc

log_cli = 1
log_cli_level = INFO
Expand Down
1 change: 1 addition & 0 deletions template/.devcontainer/devcontainer.json.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
{% 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",
"vitest.explorer@1.16.1",
{% 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",
Expand Down
3 changes: 1 addition & 2 deletions template/.devcontainer/docker-compose.yml.jinja
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{% raw %}version: '3.8'
services:
{% raw %}services:
devcontainer:
build:
context: .
Expand Down
7 changes: 7 additions & 0 deletions template/.devcontainer/install-ci-tooling.sh.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@
# can pass in the full major.minor.patch version of python as an optional argument
set -ex

{% endraw %}{% if is_child_of_copier_base_template is not defined and install_aws_ssm_port_forwarding_plugin is defined and install_aws_ssm_port_forwarding_plugin is sameas(true) %}{% raw %}
# Based on https://docs.aws.amazon.com/systems-manager/latest/userguide/install-plugin-debian-and-ubuntu.html
# TODO: figure out how to pin this
curl "https://s3.amazonaws.com/session-manager-downloads/plugin/latest/ubuntu_64bit/session-manager-plugin.deb" -o "/tmp/session-manager-plugin.deb"
sudo dpkg -i /tmp/session-manager-plugin.deb
session-manager-plugin --version{% endraw %}{% endif %}{% raw %}

{% endraw %}{% if template_uses_javascript is defined and template_uses_javascript is sameas(true) %}{% raw %}
npm -v
npm install -g pnpm@{% endraw %}{{ pnpm_version }}{% raw %}
Expand Down
5 changes: 3 additions & 2 deletions template/.pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -175,10 +175,11 @@ repos:
hooks:
- id: hadolint-docker
name: Lint Dockerfiles
exclude: .*\.jinja$
description: Runs hadolint to lint Dockerfiles

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: 99abe27a5a16f301d9e0a3828181399dfbf54ebd # frozen: v0.11.0
rev: 25a8c8da6c24a3b9a1a536e2674683dd0eead5d6 # frozen: v0.11.2
hooks:
- id: ruff
name: ruff-src
Expand All @@ -191,7 +192,7 @@ repos:
- id: ruff-format

- repo: https://github.com/pylint-dev/pylint
rev: 88543500c70e3aa303b6c0861e2a7a006673f6a8
rev: 7ac5a4d4f77576df3a00e63f86ca86e0e1780b47 # frozen: v3.3.6
hooks:
- id: pylint
name: pylint
Expand Down
2 changes: 1 addition & 1 deletion template/pytest.ini
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[pytest]
# Settings managed by the base template
norecursedirs = node_modules .precommit_cache .npm_cache .pipenv_cache venv .venv .history
addopts = --cov=src --cov-report html --cov-report term-missing:skip-covered
addopts = --cov=src --cov-report html --cov-report term-missing:skip-covered --cov-config=./.coveragerc

log_cli = 1
log_cli_level = INFO
Expand Down
1 change: 1 addition & 0 deletions tests/copier_data/data1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ ssh_port_number: 12345
use_windows_in_ci: false



python_package_registry: PyPI
aws_identity_center_id: d-9145c20053
aws_org_home_region: us-west-2
Expand Down
1 change: 1 addition & 0 deletions tests/copier_data/data2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ ssh_port_number: 54321
use_windows_in_ci: true



python_package_registry: AWS CodeArtifact
aws_central_infrastructure_account_id: 012321432543
core_infra_base_access_profile_name: MyAccessRole
Expand Down