diff --git a/doc/changelog.d/481.miscellaneous.md b/doc/changelog.d/481.miscellaneous.md new file mode 100644 index 000000000..3d383f2c6 --- /dev/null +++ b/doc/changelog.d/481.miscellaneous.md @@ -0,0 +1 @@ +feat: Add devcontainer config for codespaces \ No newline at end of file diff --git a/src/ansys/templates/python/solution/hooks/post_gen_project.py b/src/ansys/templates/python/solution/hooks/post_gen_project.py index 050f3e8ab..a339b5dfb 100644 --- a/src/ansys/templates/python/solution/hooks/post_gen_project.py +++ b/src/ansys/templates/python/solution/hooks/post_gen_project.py @@ -2,6 +2,7 @@ DESIRED_STRUCTURE = [ + ".devcontainer/devcontainer.json", ".github/workflows/build-release.yml", ".github/workflows/release-please.yml", ".github/workflows/label.yml", diff --git a/src/ansys/templates/python/solution/{{cookiecutter.__project_name_slug}}/.devcontainer/devcontainer.json b/src/ansys/templates/python/solution/{{cookiecutter.__project_name_slug}}/.devcontainer/devcontainer.json new file mode 100644 index 000000000..ad4310873 --- /dev/null +++ b/src/ansys/templates/python/solution/{{cookiecutter.__project_name_slug}}/.devcontainer/devcontainer.json @@ -0,0 +1,26 @@ +{ + "image": "mcr.microsoft.com/devcontainers/python:3.10", + "features": { + }, + "onCreateCommand": "pip install packaging toml && python setup_environment.py -d all -f", + "postCreateCommand": "chmod +x /workspaces/{{ cookiecutter.__project_name_slug }}/.venv/bin/activate && sed -i '$a source /workspaces/{{ cookiecutter.__project_name_slug }}/.venv/bin/activate' ~/.bashrc && sed -i '$a source /workspaces/{{ cookiecutter.__project_name_slug }}/.venv/bin/activate' ~/.zshrc", + "postAttachCommand": "tox -e style", + "customizations": { + "vscode": { + "extensions": [ + "davidanson.vscode-markdownlint", + "donjayamanne.python-environment-manager", + "donjayamanne.python-extension-pack", + "github.vscode-github-actions", + "github.vscode-pull-request-github", + "kevinrose.vsc-python-indent", + "mhutchie.git-graph", + "ms-python.debugpy", + "ms-python.python", + "ms-python.vscode-pylance", + "shd101wyy.markdown-preview-enhanced", + "vscode-icons-team.vscode-icons" + ] + } + } + } diff --git a/tests/tests_templates/test_python_templates.py b/tests/tests_templates/test_python_templates.py index e1c8472e1..fc5cdea68 100644 --- a/tests/tests_templates/test_python_templates.py +++ b/tests/tests_templates/test_python_templates.py @@ -287,6 +287,7 @@ # Structure for solution projects SOLUTION_STRUCTURE = [ + ".devcontainer/devcontainer.json", ".github/workflows/build-release.yml", ".github/workflows/release-please.yml", ".github/workflows/label.yml",