Automatically activate venv
This commit is contained in:
parent
b533c23361
commit
8ae3ed8a1b
3 changed files with 25 additions and 5 deletions
|
|
@ -1,13 +1,23 @@
|
||||||
// For format details, see https://aka.ms/devcontainer.json
|
// For format details, see https://aka.ms/devcontainer.json
|
||||||
{
|
{
|
||||||
"name": "pallets/flask",
|
"name": "pallets/flask",
|
||||||
|
"image": "mcr.microsoft.com/vscode/devcontainers/python:3",
|
||||||
|
|
||||||
// Features to add to the devcontainer
|
// Configure tool-specific properties.
|
||||||
"features": {
|
"customizations": {
|
||||||
"ghcr.io/devcontainers/features/python:1": {}
|
// Configure properties specific to VS Code.
|
||||||
|
"vscode": {
|
||||||
|
// Set *default* container specific settings.json values on container create.
|
||||||
|
"settings": {
|
||||||
|
"python.defaultInterpreterPath": "/workspaces/flask/.venv/bin/python",
|
||||||
|
"python.linting.enabled": true,
|
||||||
|
"python.linting.pylintEnabled": true
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
// Displays a custom welcome message
|
// Displays a custom welcome message.
|
||||||
"onCreateCommand": "sudo cp .devcontainer/welcome-message.txt /usr/local/etc/vscode-dev-containers/first-run-notice.txt",
|
"onCreateCommand": "sudo cp .devcontainer/welcome-message.txt /usr/local/etc/vscode-dev-containers/first-run-notice.txt",
|
||||||
|
|
||||||
// Runs the initial setup commands after the container is created.
|
// Runs the initial setup commands after the container is created.
|
||||||
|
|
|
||||||
|
|
@ -3,5 +3,5 @@
|
||||||
🛠️ Your environment is setup with all the required dependencies and your fork has been added as a remote.
|
🛠️ Your environment is setup with all the required dependencies and your fork has been added as a remote.
|
||||||
|
|
||||||
🚀 To start coding, wait for the "postCreateCommand" to finish setting things up, then:
|
🚀 To start coding, wait for the "postCreateCommand" to finish setting things up, then:
|
||||||
- run `. .venv/bin/activate` to activate your virtualenv
|
- make sure the virtualenv is activated by running `. .venv/bin/activate`
|
||||||
- run `git checkout -b your-branch-name origin/{main-or-latest-release}` to start working on a new feature or bug fix
|
- run `git checkout -b your-branch-name origin/{main-or-latest-release}` to start working on a new feature or bug fix
|
||||||
|
|
|
||||||
|
|
@ -83,6 +83,16 @@ a `devcontainer`_ that installs required dependencies for you.
|
||||||
finish running.
|
finish running.
|
||||||
- Checkout a new branch and `start coding`_.
|
- Checkout a new branch and `start coding`_.
|
||||||
|
|
||||||
|
Note that if you reconnect to an existing codespace, you may need to
|
||||||
|
open a new terminal or run one of the following commands to activate
|
||||||
|
your python virtualenv:
|
||||||
|
|
||||||
|
- Linux/macOS
|
||||||
|
|
||||||
|
.. code-block:: text
|
||||||
|
|
||||||
|
$ . .venv/bin/activate
|
||||||
|
|
||||||
.. _GitHub Codespaces: https://docs.github.com/en/codespaces
|
.. _GitHub Codespaces: https://docs.github.com/en/codespaces
|
||||||
.. _devcontainer: https://docs.github.com/en/codespaces/setting-up-your-project-for-codespaces/adding-a-dev-container-configuration/introduction-to-dev-containers
|
.. _devcontainer: https://docs.github.com/en/codespaces/setting-up-your-project-for-codespaces/adding-a-dev-container-configuration/introduction-to-dev-containers
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue