linkml / linkml-project-cookiecutter

A cookiecutter for linkml projects. An equivalent of `linkml-ws new project-name`.
Creative Commons Zero v1.0 Universal
14 stars 16 forks source link

Unable to create file '.github/workflows/test_pages_build.yaml'. Error message: 'github' is undefined. #114

Closed cmungall closed 2 weeks ago

cmungall commented 2 weeks ago

cruft create https://github.com/linkml/linkml-project-cookiecutter

gives:

 Unable to create file '.github/workflows/test_pages_build.yaml'. Error message: 'github' is undefined.
➜ repos cruft create https://github.com/linkml/linkml-project-cookiecutter project_name [my-awesome-schema]: test123 github_org [my-org]: project_description [This is the project description.]: full_name [My Name]: email [my-name@my-org.org]: Select license: 1 - MIT 2 - BSD-3 3 - GNU GPL v3.0 4 - Apache Software License 2.0 Choose from 1, 2, 3, 4 [1]: main_schema_class [Person]: Select create_python_classes: 1 - Yes 2 - No Choose from 1, 2 [1]: Select use_schemasheets: 1 - No 2 - Yes Choose from 1, 2 [1]: google_sheet_id [1wVoaiFg47aT9YWNeRfTZ8tYHN8s8PAuDx5i2HUcDpvQ]: google_sheet_tabs [personinfo enums]: github_token_for_pypi_deployment [PYPI_PASSWORD]: ╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮ │ /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/cookiecutter/gener │ │ ate.py:373 in generate_files │ │ │ │ 370 │ │ │ │ │ shutil.copymode(infile, outfile) │ │ 371 │ │ │ │ │ continue │ │ 372 │ │ │ │ try: │ │ ❱ 373 │ │ │ │ │ generate_file( │ │ 374 │ │ │ │ │ │ project_dir, infile, context, env, skip_if_file_exists │ │ 375 │ │ │ │ │ ) │ │ 376 │ │ │ │ except UndefinedError as err: │ │ │ │ ╭─────────────────────────────────────────── locals ───────────────────────────────────────────╮ │ │ │ accept_hooks = True │ │ │ │ context = OrderedDict([('cookiecutter', OrderedDict([('project_name', │ │ │ │ 'test123'), ('__project_slug', 'test123'), ('github_org', │ │ │ │ 'my-org'), ('__source_path', 'src/test123/schema/test123.yaml'), │ │ │ │ ('project_description', 'This is the project description.'), │ │ │ │ ('full_name', 'My Name'), ('email', 'my-name@my-org.org'), │ │ │ │ ('__author', 'My Name '), ('license', │ │ │ │ 'MIT'), ('main_schema_class', 'Person'), │ │ │ │ ('create_python_classes', 'Yes'), ('use_schemasheets', 'No'), │ │ │ │ ('google_sheet_id', │ │ │ │ '1wVoaiFg47aT9YWNeRfTZ8tYHN8s8PAuDx5i2HUcDpvQ'), │ │ │ │ ('google_sheet_tabs', 'personinfo enums'), │ │ │ │ ('__google_sheet_module', 'personinfo_enums'), │ │ │ │ ('github_token_for_pypi_deployment', 'PYPI_PASSWORD'), │ │ │ │ ('_template', │ │ │ │ 'https://github.com/linkml/linkml-project-cookiecutter')]))]) │ │ │ │ copy_dirs = [] │ │ │ │ d = 'workflows' │ │ │ │ d_ = '.github/workflows' │ │ │ │ delete_project_on_failure = True │ │ │ │ dirs = [] │ │ │ │ env = │ │ │ │ envvars = {} │ │ │ │ f = 'test_pages_build.yaml' │ │ │ │ files = [ │ │ │ │ │ 'deploy-docs.yaml', │ │ │ │ │ 'pypi-publish.yaml', │ │ │ │ │ 'main.yaml', │ │ │ │ │ 'test_pages_build.yaml' │ │ │ │ ] │ │ │ │ infile = '.github/workflows/test_pages_build.yaml' │ │ │ │ msg = "Unable to create file │ │ │ │ '.github/workflows/test_pages_build.yaml'" │ │ │ │ output_dir = '.' │ │ │ │ output_directory_created = True │ │ │ │ overwrite_if_exists = False │ │ │ │ project_dir = '/Users/cjm/repos/test123' │ │ │ │ render_dirs = [] │ │ │ │ repo_dir = PosixPath('/var/folders/nc/m4tx21912kv1b8nk3zzx9plr0000gn/T/tmp… │ │ │ │ root = './.github/workflows' │ │ │ │ skip_if_file_exists = False │ │ │ │ template_dir = '/var/folders/nc/m4tx21912kv1b8nk3zzx9plr0000gn/T/tmpujcf_x86/{… │ │ │ │ unrendered_dir = '/Users/cjm/repos/test123/./.github/workflows' │ │ │ ╰──────────────────────────────────────────────────────────────────────────────────────────────╯ │ │ │ │ /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/cookiecutter/gener │ │ ate.py:179 in generate_file │ │ │ │ 176 │ │ │ # information about syntax error location │ │ 177 │ │ │ exception.translated = False │ │ 178 │ │ │ raise │ │ ❱ 179 │ │ rendered_file = tmpl.render(**context) │ │ 180 │ │ │ │ 181 │ │ # Detect original file newline to output the rendered file │ │ 182 │ │ # note: newline='' ensures newlines are not converted │ │ │ │ ╭─────────────────────────────────────────── locals ───────────────────────────────────────────╮ │ │ │ context = OrderedDict([('cookiecutter', OrderedDict([('project_name', │ │ │ │ 'test123'), ('__project_slug', 'test123'), ('github_org', 'my-org'), │ │ │ │ ('__source_path', 'src/test123/schema/test123.yaml'), │ │ │ │ ('project_description', 'This is the project description.'), │ │ │ │ ('full_name', 'My Name'), ('email', 'my-name@my-org.org'), │ │ │ │ ('__author', 'My Name '), ('license', 'MIT'), │ │ │ │ ('main_schema_class', 'Person'), ('create_python_classes', 'Yes'), │ │ │ │ ('use_schemasheets', 'No'), ('google_sheet_id', │ │ │ │ '1wVoaiFg47aT9YWNeRfTZ8tYHN8s8PAuDx5i2HUcDpvQ'), ('google_sheet_tabs', │ │ │ │ 'personinfo enums'), ('__google_sheet_module', 'personinfo_enums'), │ │ │ │ ('github_token_for_pypi_deployment', 'PYPI_PASSWORD'), ('_template', │ │ │ │ 'https://github.com/linkml/linkml-project-cookiecutter')]))]) │ │ │ │ env = │ │ │ │ file_name_is_empty = False │ │ │ │ infile = '.github/workflows/test_pages_build.yaml' │ │ │ │ infile_fwd_slashes = '.github/workflows/test_pages_build.yaml' │ │ │ │ outfile = '/Users/cjm/repos/test123/.github/workflows/test_pages_build.yaml' │ │ │ │ outfile_tmpl =