From afefc07ca1722a94f448e4c39bb935234feabe3d Mon Sep 17 00:00:00 2001 From: Andrew Halberstadt Date: Fri, 30 Aug 2024 15:45:43 -0400 Subject: [PATCH] fix(python): update template for Taskgraph 7+ The template was still setting things up with the old file structure. --- reps/hooks.py | 6 ------ .../{{cookiecutter.__project_slug}}/.taskcluster.yml | 2 +- .../taskcluster/{ci => }/config.yml | 0 .../taskcluster/{ci => kinds}/codecov/kind.yml | 0 .../taskcluster/{ci => kinds}/docker-image/kind.yml | 0 .../taskcluster/{ci => kinds}/fetch/kind.yml | 0 .../taskcluster/{ci => kinds}/test/kind.yml | 0 .../taskcluster/requirements.in | 1 - test/test_template_python.py | 12 +++++------- 9 files changed, 6 insertions(+), 15 deletions(-) rename reps/templates/python/{{cookiecutter.__project_slug}}/taskcluster/{ci => }/config.yml (100%) rename reps/templates/python/{{cookiecutter.__project_slug}}/taskcluster/{ci => kinds}/codecov/kind.yml (100%) rename reps/templates/python/{{cookiecutter.__project_slug}}/taskcluster/{ci => kinds}/docker-image/kind.yml (100%) rename reps/templates/python/{{cookiecutter.__project_slug}}/taskcluster/{ci => kinds}/fetch/kind.yml (100%) rename reps/templates/python/{{cookiecutter.__project_slug}}/taskcluster/{ci => kinds}/test/kind.yml (100%) delete mode 100644 reps/templates/python/{{cookiecutter.__project_slug}}/taskcluster/requirements.in diff --git a/reps/hooks.py b/reps/hooks.py index 4b2e22e..0c911f6 100644 --- a/reps/hooks.py +++ b/reps/hooks.py @@ -142,12 +142,6 @@ def pre_commit_autoupdate(items: CookiecutterContext): run(["pre-commit", "autoupdate"]) -@hook("post-gen-py") -@hook("post-gen-base") -def lock_taskgraph_requirements(items: CookiecutterContext): - run(["pip-compile", "requirements.in", "--generate-hashes"], cwd="taskcluster") - - @hook("post-gen-base") def taskgraph_init(items: CookiecutterContext): run(["taskgraph", "init"]) diff --git a/reps/templates/python/{{cookiecutter.__project_slug}}/.taskcluster.yml b/reps/templates/python/{{cookiecutter.__project_slug}}/.taskcluster.yml index 206df7a..23573ab 100644 --- a/reps/templates/python/{{cookiecutter.__project_slug}}/.taskcluster.yml +++ b/reps/templates/python/{{cookiecutter.__project_slug}}/.taskcluster.yml @@ -223,7 +223,7 @@ tasks: features: taskclusterProxy: true - image: mozillareleases/taskgraph:decision-f19bfa3ae9dbc19190149445bfc38ad966b713336e44342c7643b3f7f1e0b023@sha256:ddcc7348db272885e8ea32825f698bfafa4727401099531cd8239d3d458b39aa + image: mozillareleases/taskgraph:decision-latest maxRunTime: 1800 command: diff --git a/reps/templates/python/{{cookiecutter.__project_slug}}/taskcluster/ci/config.yml b/reps/templates/python/{{cookiecutter.__project_slug}}/taskcluster/config.yml similarity index 100% rename from reps/templates/python/{{cookiecutter.__project_slug}}/taskcluster/ci/config.yml rename to reps/templates/python/{{cookiecutter.__project_slug}}/taskcluster/config.yml diff --git a/reps/templates/python/{{cookiecutter.__project_slug}}/taskcluster/ci/codecov/kind.yml b/reps/templates/python/{{cookiecutter.__project_slug}}/taskcluster/kinds/codecov/kind.yml similarity index 100% rename from reps/templates/python/{{cookiecutter.__project_slug}}/taskcluster/ci/codecov/kind.yml rename to reps/templates/python/{{cookiecutter.__project_slug}}/taskcluster/kinds/codecov/kind.yml diff --git a/reps/templates/python/{{cookiecutter.__project_slug}}/taskcluster/ci/docker-image/kind.yml b/reps/templates/python/{{cookiecutter.__project_slug}}/taskcluster/kinds/docker-image/kind.yml similarity index 100% rename from reps/templates/python/{{cookiecutter.__project_slug}}/taskcluster/ci/docker-image/kind.yml rename to reps/templates/python/{{cookiecutter.__project_slug}}/taskcluster/kinds/docker-image/kind.yml diff --git a/reps/templates/python/{{cookiecutter.__project_slug}}/taskcluster/ci/fetch/kind.yml b/reps/templates/python/{{cookiecutter.__project_slug}}/taskcluster/kinds/fetch/kind.yml similarity index 100% rename from reps/templates/python/{{cookiecutter.__project_slug}}/taskcluster/ci/fetch/kind.yml rename to reps/templates/python/{{cookiecutter.__project_slug}}/taskcluster/kinds/fetch/kind.yml diff --git a/reps/templates/python/{{cookiecutter.__project_slug}}/taskcluster/ci/test/kind.yml b/reps/templates/python/{{cookiecutter.__project_slug}}/taskcluster/kinds/test/kind.yml similarity index 100% rename from reps/templates/python/{{cookiecutter.__project_slug}}/taskcluster/ci/test/kind.yml rename to reps/templates/python/{{cookiecutter.__project_slug}}/taskcluster/kinds/test/kind.yml diff --git a/reps/templates/python/{{cookiecutter.__project_slug}}/taskcluster/requirements.in b/reps/templates/python/{{cookiecutter.__project_slug}}/taskcluster/requirements.in deleted file mode 100644 index 18b93f7..0000000 --- a/reps/templates/python/{{cookiecutter.__project_slug}}/taskcluster/requirements.in +++ /dev/null @@ -1 +0,0 @@ -taskcluster-taskgraph diff --git a/test/test_template_python.py b/test/test_template_python.py index 0a269f8..822714f 100644 --- a/test/test_template_python.py +++ b/test/test_template_python.py @@ -28,15 +28,13 @@ def test_generated_files(reps_new): "pyproject.toml", "poetry.lock", f"src/{name}/__init__.py", - "taskcluster/ci/codecov/kind.yml", - "taskcluster/ci/config.yml", - "taskcluster/ci/docker-image/kind.yml", - "taskcluster/ci/fetch/kind.yml", - "taskcluster/ci/test/kind.yml", + "taskcluster/config.yml", "taskcluster/docker/fetch/Dockerfile", "taskcluster/docker/python/Dockerfile", - "taskcluster/requirements.in", - "taskcluster/requirements.txt", + "taskcluster/kinds/codecov/kind.yml", + "taskcluster/kinds/docker-image/kind.yml", + "taskcluster/kinds/fetch/kind.yml", + "taskcluster/kinds/test/kind.yml", "taskcluster/scripts/codecov-upload.py", "taskcluster/scripts/pyenv-setup", "taskcluster/scripts/poetry-setup",