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
2 changes: 1 addition & 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.32
_commit: v0.0.36
_src_path: gh:LabAutomationAndScreening/copier-base-template.git
description: Copier template for creating Python libraries and executables
python_ci_versions:
Expand Down
4 changes: 2 additions & 2 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
"ruff.nativeServer": "on",
// TODO: see if there's a way to specify different configurations for different folders
"ruff.configuration": "/workspaces/copier-python-package-template/ruff-test.toml", // use the test configuration since it's less restrictive and won't show false positives and underline things
"[jsonc][json][javascript][typescript][graphql]": {
"[jsonc][json][javascript][typescript][graphql][css][scss][html][vue]": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true
}
Expand All @@ -59,5 +59,5 @@
"initializeCommand": "sh .devcontainer/initialize-command.sh",
"onCreateCommand": "sh .devcontainer/on-create-command.sh",
"postStartCommand": "sh .devcontainer/post-start-command.sh"
// Devcontainer context hash (do not manually edit this, it's managed by a pre-commit hook): 2308a2ae # spellchecker:disable-line
// Devcontainer context hash (do not manually edit this, it's managed by a pre-commit hook): 53debcd8 # spellchecker:disable-line
}
4 changes: 2 additions & 2 deletions .devcontainer/install-ci-tooling.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ curl -LsSf https://astral.sh/uv/0.6.17/install.sh | sh
uv --version
# TODO: add uv autocompletion to the shell https://docs.astral.sh/uv/getting-started/installation/#shell-autocompletion

# Ensure that uv won't use the default system Python
default_version="3.12.7"
# Set to the system version of Python3 by default
default_version=$(python3 -c "import sys; print ('.'.join((str(x) for x in sys.version_info[:3])))")

# Use the input argument if provided, otherwise use the default value
input="${1:-$default_version}"
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/install_deps_uv/install-ci-tooling.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ if ($args.Count -eq 0) {
}


$env:UV_PYTHON = "$input"
$env:UV_PYTHON = "$input_arg"
$env:UV_PYTHON_PREFERENCE="only-system"

& uv tool install 'copier==9.6.0' --with 'copier-templates-extensions==0.3.0'
Expand Down
26 changes: 26 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
version: 2
updates:
- package-ecosystem: "uv"
directories:
- "/"
schedule:
interval: "weekly"
day: "sunday"
time: "16:00"
open-pull-requests-limit: 5
ignore:
- dependency-name: "*"
update-types:
- "version-update:semver-patch"

groups:
prod-dependencies:
dependency-type: "production"
update-types:
- "minor"
- "patch"
dev-dependencies:
dependency-type: "development"
update-types:
- "minor"
- "patch"
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ repos:

# Reformatting (should generally come before any file format or other checks, because reformatting can change things)
- repo: https://github.com/crate-ci/typos
rev: 15ff058881549e16b0edb975a9b0b0d0cccd612c # frozen: v1
rev: 6cb49915af2e93e61f5f0d0a82216e28ad5c7c18 # frozen: v1
hooks:
- id: typos
- repo: https://github.com/pre-commit/pre-commit-hooks
Expand Down Expand Up @@ -189,7 +189,7 @@ repos:
description: Runs hadolint to lint Dockerfiles

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: e84319e627902e1b348574ecf3238dc511933dc7 # frozen: v0.11.7
rev: f0fe93c067104b76ffb58852abe79673a8429bd1 # frozen: v0.11.8
hooks:
- id: ruff
name: ruff-src
Expand All @@ -202,7 +202,7 @@ repos:
- id: ruff-format

- repo: https://github.com/pylint-dev/pylint
rev: 7ac5a4d4f77576df3a00e63f86ca86e0e1780b47 # frozen: v3.3.6
rev: f798a4a3508bcbb8ad0773ae14bf32d28dcfdcbe # frozen: v3.3.7
hooks:
- id: pylint
name: pylint
Expand Down
77 changes: 77 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/).

---

## [Unreleased]

### Added
- Describe new features added in this version.

### Changed
- Describe changes in existing functionality.

### Deprecated
- List features that are still available but will be removed in future versions.

### Removed
- List features that have been removed.

### Fixed
- List any bug fixes.

### Security
- Describe security fixes or improvements.

---

## [0.1.0] - 2024-12-18

### Added
- Project setup.
- Initial functionality implemented.

---

### How to Use This Changelog

- **Added:** For new features.
- **Changed:** For changes in existing functionality.
- **Deprecated:** For features that will soon be removed.
- **Removed:** For features that have been removed.
- **Fixed:** For bug fixes.
- **Security:** In case of vulnerabilities addressed.

---

### Versioning

This project uses **Semantic Versioning (MAJOR.MINOR.PATCH)**:
- **MAJOR:** Incompatible API changes.
- **MINOR:** Backward-compatible new features.
- **PATCH:** Backward-compatible bug fixes.

For example:
- `1.0.0`: Major release with breaking changes.
- `1.1.0`: New backward-compatible feature.
- `1.1.1`: Bug fix or minor change.

---

### Contributing to the Changelog

When contributing changes, ensure you update the `[Unreleased]` section of this file with a brief description of your contribution.

- Use clear, concise language.
- Categorize your change under **Added**, **Changed**, **Deprecated**, **Removed**, **Fixed**, or **Security**.

When releasing a new version:
1. Move changes from `[Unreleased]` to a new section with the version number and release date.
2. Update any relevant documentation if necessary.

---

Thank you for helping us maintain a clean and clear changelog! 🚀
13 changes: 8 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,14 @@

# Usage
To create a new repository using this template:
1. Install `copier` and `copier-templates-extensions`. An easy way to do that is to copy the `.devcontainer/install-ci-tooling.sh` script in this repository into your new repo and then run it.
2. Run copier to instantiate the template: `copier copy --trust gh:LabAutomationAndScreening/copier-python-package-template.git`
3. Run `uv lock` to generate the lock file
4. Commit the changes
5. Rebuild your new devcontainer
1. Create a basic devcontainer either using the Codespaces default or using the file `.devcontainer/devcontainer-to-instantiate-template.json` from [the base template repo](https://github.com/LabAutomationAndScreening/copier-base-template/blob/main/.devcontainer/devcontainer-to-instantiate-template.json)
1. Inside that devcontainer, run `sh .devcontainer/install-ci-tooling.sh` to install necessary tooling to instantiate the template (you can copy/paste the script from this
1. Delete all files currently in the repository. Optional...but makes it easiest to avoid git conflicts.
1. Run copier to instantiate the template: `copier copy --trust gh:LabAutomationAndScreening/copier-python-package-template.git .`
1. Run `uv lock` to generate the lock file
1. Run `python3 .github/workflows/hash_git_files.py . --for-devcontainer-config-update` to update the hash for your devcontainer file
1. Commit the changes (optional)
1. Rebuild your new devcontainer



Expand Down
2 changes: 1 addition & 1 deletion copier.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ ssh_port_number:
type: int
help: What port should the devcontainer bind SSH to?
# Pick a random port, but ensure it's not in the excluded port range on Windows (powershell: `netsh int ipv4 show excludedportrange protocol=tcp`)
default: "{{ ([p for p in range(49152, 65536) if not (49752 <= p <= 49851 or 50000 <= p <= 50059 or 50060 <= p <= 50159 or 50160 <= p <= 50259 or 50260 <= p <= 50359 or 50914 <= p <= 51013 or 51114 <= p <= 51213 or 51214 <= p <= 51313 or 51314 <= p <= 51413 or 51623 <= p <= 51722 or 51723 <= p <= 51822 or 65269 <= p <= 65368 or 65369 <= p <= 65468))] | random }}"
default: "{{ ( (range(49152, 49752) | list) + (range(49852, 50000) | list) + (range(50060, 50160) | list) + (range(50160, 50260) | list) + (range(50260, 50360) | list) + (range(50914, 51014) | list) + (range(51114, 51214) | list) + (range(51214, 51314) | list) + (range(51314, 51414) | list) + (range(51623, 51723) | list) + (range(51723, 51823) | list) + (range(65269, 65369) | list) + (range(65369, 65469) | list) ) | random }}"

use_windows_in_ci:
type: bool
Expand Down
13 changes: 9 additions & 4 deletions extensions/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def hook(self, context: dict[Any, Any]) -> dict[Any, Any]:
context["copier_version"] = "9.6.0"
context["copier_templates_extension_version"] = "0.3.0"
context["sphinx_version"] = "8.1.3"
context["pulumi_version"] = "3.163.0"
context["pulumi_version"] = "3.167.0"
context["pulumi_aws_version"] = "6.77.0"
context["pulumi_aws_native_version"] = "1.27.0"
context["pulumi_command_version"] = "1.0.2"
Expand All @@ -33,11 +33,16 @@ def hook(self, context: dict[Any, Any]) -> dict[Any, Any]:
context["strawberry_graphql_version"] = "0.264.0"
context["fastapi_version"] = "0.115.12"
context["uvicorn_version"] = "0.34.0"
context["lab_auto_pulumi_version"] = "0.1.11"
context["lab_auto_pulumi_version"] = "0.1.12"

context["nuxt_ui_version"] = "^3.0.2"
context["nuxt_version"] = "^3.16.2"
context["nuxt_ui_version"] = "^3.1.1"
context["nuxt_version"] = "^3.17.2"
context["typescript_version"] = "^5.8.2"
context["vue_version"] = "^3.5.13"
context["vue_router_version"] = "^4.5.0"
context["faker_version"] = "^9.7.0"
context["graphql_codegen_cli_version"] = "^5.0.5"
context["graphql_codegen_typescript_version"] = "^4.1.6"

context["gha_checkout"] = "v4.2.2"
context["gha_setup_python"] = "v5.5.0"
Expand Down
2 changes: 1 addition & 1 deletion template/.devcontainer/devcontainer.json.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
"ruff.nativeServer": "on",
// TODO: see if there's a way to specify different configurations for different folders
"ruff.configuration": "/workspaces/{% endraw %}{{ repo_name }}{% raw %}/ruff-test.toml", // use the test configuration since it's less restrictive and won't show false positives and underline things
"[jsonc][json][javascript][typescript][graphql]": {
"[jsonc][json][javascript][typescript][graphql][css][scss][html][vue]": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true
}
Expand Down
4 changes: 2 additions & 2 deletions template/.devcontainer/install-ci-tooling.sh.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ curl -LsSf https://astral.sh/uv/{% endraw %}{{ uv_version }}{% raw %}/install.sh
uv --version
# TODO: add uv autocompletion to the shell https://docs.astral.sh/uv/getting-started/installation/#shell-autocompletion

# Ensure that uv won't use the default system Python
default_version="{% endraw %}{{ python_version }}{% raw %}"
# Set to the system version of Python3 by default
default_version=$(python3 -c "import sys; print ('.'.join((str(x) for x in sys.version_info[:3])))")

# Use the input argument if provided, otherwise use the default value
input="${1:-$default_version}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ if ($args.Count -eq 0) {
}


$env:UV_PYTHON = "$input"
$env:UV_PYTHON = "$input_arg"
Copy link

Copilot AI May 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ensure that the variable 'input_arg' is properly defined in the script's context or update its assignment if the intended variable is still '$input', to avoid runtime errors.

Copilot uses AI. Check for mistakes.
$env:UV_PYTHON_PREFERENCE="only-system"

& uv tool install 'copier==9.6.0' --with 'copier-templates-extensions==0.3.0'
Expand Down
26 changes: 26 additions & 0 deletions template/.github/dependabot.yml.jinja
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{% raw %}version: 2
updates:
- package-ecosystem: "uv"
directories:
- "/"
schedule:
interval: "weekly"
day: "sunday"
time: "16:00"
open-pull-requests-limit: 5
ignore:
- dependency-name: "*"
update-types:
- "version-update:semver-patch"

groups:
prod-dependencies:
dependency-type: "production"
update-types:
- "minor"
- "patch"
dev-dependencies:
dependency-type: "development"
update-types:
- "minor"
- "patch"{% endraw %}
6 changes: 3 additions & 3 deletions template/.pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ repos:

# Reformatting (should generally come before any file format or other checks, because reformatting can change things)
- repo: https://github.com/crate-ci/typos
rev: 15ff058881549e16b0edb975a9b0b0d0cccd612c # frozen: v1
rev: 6cb49915af2e93e61f5f0d0a82216e28ad5c7c18 # frozen: v1
hooks:
- id: typos
- repo: https://github.com/pre-commit/pre-commit-hooks
Expand Down Expand Up @@ -189,7 +189,7 @@ repos:
description: Runs hadolint to lint Dockerfiles

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: e84319e627902e1b348574ecf3238dc511933dc7 # frozen: v0.11.7
rev: f0fe93c067104b76ffb58852abe79673a8429bd1 # frozen: v0.11.8
hooks:
- id: ruff
name: ruff-src
Expand All @@ -202,7 +202,7 @@ repos:
- id: ruff-format

- repo: https://github.com/pylint-dev/pylint
rev: 7ac5a4d4f77576df3a00e63f86ca86e0e1780b47 # frozen: v3.3.6
rev: f798a4a3508bcbb8ad0773ae14bf32d28dcfdcbe # frozen: v3.3.7
hooks:
- id: pylint
name: pylint
Expand Down
2 changes: 1 addition & 1 deletion template/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/).
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/).

---

Expand Down