From eef0c97a3e86523f3675684021c26092ddfbd14b Mon Sep 17 00:00:00 2001 From: Eli Fine Date: Fri, 9 May 2025 10:36:59 +0000 Subject: [PATCH 1/4] Copier --- .copier-answers.yml | 2 +- .devcontainer/devcontainer.json | 2 +- .devcontainer/install-ci-tooling.sh | 4 +- .../install_deps_uv/install-ci-tooling.ps1 | 2 +- .pre-commit-config.yaml | 6 +- CHANGELOG.md | 77 +++++++++++++++++++ README.md | 13 ++-- copier.yml | 2 +- extensions/context.py | 13 +++- .../.devcontainer/devcontainer.json.jinja | 2 +- .../.devcontainer/install-ci-tooling.sh.jinja | 4 +- .../install_deps_uv/install-ci-tooling.ps1 | 2 +- template/.pre-commit-config.yaml | 6 +- template/CHANGELOG.md | 2 +- template/README.md.jinja | 2 +- 15 files changed, 112 insertions(+), 27 deletions(-) create mode 100644 CHANGELOG.md diff --git a/.copier-answers.yml b/.copier-answers.yml index 0dfaa61b..cc737764 100644 --- a/.copier-answers.yml +++ b/.copier-answers.yml @@ -1,5 +1,5 @@ # Changes here will be overwritten by Copier -_commit: v0.0.32 +_commit: v0.0.35 _src_path: gh:LabAutomationAndScreening/copier-base-template.git description: Copier template for creating Python libraries and executables python_ci_versions: diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index da4ca85f..a5886841 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -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 } diff --git a/.devcontainer/install-ci-tooling.sh b/.devcontainer/install-ci-tooling.sh index ccc8b050..30d480d5 100644 --- a/.devcontainer/install-ci-tooling.sh +++ b/.devcontainer/install-ci-tooling.sh @@ -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}" diff --git a/.github/actions/install_deps_uv/install-ci-tooling.ps1 b/.github/actions/install_deps_uv/install-ci-tooling.ps1 index 363e5130..3b9753c2 100644 --- a/.github/actions/install_deps_uv/install-ci-tooling.ps1 +++ b/.github/actions/install_deps_uv/install-ci-tooling.ps1 @@ -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' diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 38ff0763..85c89674 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -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 @@ -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 @@ -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 diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 00000000..04942157 --- /dev/null +++ b/CHANGELOG.md @@ -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! 🚀 diff --git a/README.md b/README.md index 7ca72f2e..9d4df24c 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/copier.yml b/copier.yml index d87f3301..97a7d790 100644 --- a/copier.yml +++ b/copier.yml @@ -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 diff --git a/extensions/context.py b/extensions/context.py index c5e91a9e..7623a061 100644 --- a/extensions/context.py +++ b/extensions/context.py @@ -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" @@ -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" diff --git a/template/.devcontainer/devcontainer.json.jinja b/template/.devcontainer/devcontainer.json.jinja index c34ef96f..1a3166ea 100644 --- a/template/.devcontainer/devcontainer.json.jinja +++ b/template/.devcontainer/devcontainer.json.jinja @@ -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 } diff --git a/template/.devcontainer/install-ci-tooling.sh.jinja b/template/.devcontainer/install-ci-tooling.sh.jinja index 6204d662..07527f67 100644 --- a/template/.devcontainer/install-ci-tooling.sh.jinja +++ b/template/.devcontainer/install-ci-tooling.sh.jinja @@ -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}" diff --git a/template/.github/actions/install_deps_uv/install-ci-tooling.ps1 b/template/.github/actions/install_deps_uv/install-ci-tooling.ps1 index 363e5130..3b9753c2 100644 --- a/template/.github/actions/install_deps_uv/install-ci-tooling.ps1 +++ b/template/.github/actions/install_deps_uv/install-ci-tooling.ps1 @@ -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' diff --git a/template/.pre-commit-config.yaml b/template/.pre-commit-config.yaml index 38ff0763..85c89674 100644 --- a/template/.pre-commit-config.yaml +++ b/template/.pre-commit-config.yaml @@ -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 @@ -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 @@ -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 diff --git a/template/CHANGELOG.md b/template/CHANGELOG.md index 06e5caf8..04942157 100644 --- a/template/CHANGELOG.md +++ b/template/CHANGELOG.md @@ -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/). --- diff --git a/template/README.md.jinja b/template/README.md.jinja index 9d256714..da722ece 100644 --- a/template/README.md.jinja +++ b/template/README.md.jinja @@ -24,4 +24,4 @@ To publish a new version of the repository, you can run the `Publish` workflow m ## Updating from the template This repository uses a copier template. To pull in the latest updates from the template, use the command: -`copier update --trust --conflict rej --defaults`{% endraw %} +`copier update --trust --conflict rej --defaults`{% endraw %} \ No newline at end of file From 817edb731373084849bb183cde88da4b1b262f8a Mon Sep 17 00:00:00 2001 From: Eli Fine Date: Fri, 9 May 2025 10:38:18 +0000 Subject: [PATCH 2/4] hash --- .devcontainer/devcontainer.json | 2 +- template/README.md.jinja | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index a5886841..94438a6e 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -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 } diff --git a/template/README.md.jinja b/template/README.md.jinja index da722ece..9d256714 100644 --- a/template/README.md.jinja +++ b/template/README.md.jinja @@ -24,4 +24,4 @@ To publish a new version of the repository, you can run the `Publish` workflow m ## Updating from the template This repository uses a copier template. To pull in the latest updates from the template, use the command: -`copier update --trust --conflict rej --defaults`{% endraw %} \ No newline at end of file +`copier update --trust --conflict rej --defaults`{% endraw %} From c1dc5eaf75e18cdf5e559f9e404768a7dc853c57 Mon Sep 17 00:00:00 2001 From: Eli Fine Date: Fri, 9 May 2025 10:39:24 +0000 Subject: [PATCH 3/4] dep --- .copier-answers.yml | 2 +- .github/dependabot.yml | 26 ++++++++++++++++++++++++++ template/.github/dependabot.yml.jinja | 26 ++++++++++++++++++++++++++ 3 files changed, 53 insertions(+), 1 deletion(-) create mode 100644 .github/dependabot.yml create mode 100644 template/.github/dependabot.yml.jinja diff --git a/.copier-answers.yml b/.copier-answers.yml index cc737764..8921813d 100644 --- a/.copier-answers.yml +++ b/.copier-answers.yml @@ -1,5 +1,5 @@ # Changes here will be overwritten by Copier -_commit: v0.0.35 +_commit: v0.0.35-1-g3248f07 _src_path: gh:LabAutomationAndScreening/copier-base-template.git description: Copier template for creating Python libraries and executables python_ci_versions: diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 00000000..e93df146 --- /dev/null +++ b/.github/dependabot.yml @@ -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" diff --git a/template/.github/dependabot.yml.jinja b/template/.github/dependabot.yml.jinja new file mode 100644 index 00000000..369b2b0a --- /dev/null +++ b/template/.github/dependabot.yml.jinja @@ -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 %} From 0a54dfef59af4b8344ba2d461f9a65834a4cadb8 Mon Sep 17 00:00:00 2001 From: Eli Fine Date: Fri, 9 May 2025 10:45:24 +0000 Subject: [PATCH 4/4] tag --- .copier-answers.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.copier-answers.yml b/.copier-answers.yml index 8921813d..76c2b3a3 100644 --- a/.copier-answers.yml +++ b/.copier-answers.yml @@ -1,5 +1,5 @@ # Changes here will be overwritten by Copier -_commit: v0.0.35-1-g3248f07 +_commit: v0.0.36 _src_path: gh:LabAutomationAndScreening/copier-base-template.git description: Copier template for creating Python libraries and executables python_ci_versions: