diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 9b350bcd..45198266 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -2,9 +2,6 @@ "name": "pallets/flask", "image": "mcr.microsoft.com/devcontainers/python:3", "customizations": { - "codespaces": { - "openFiles": [] - }, "vscode": { "settings": { "python.defaultInterpreterPath": "${workspaceFolder}/.venv", @@ -12,10 +9,9 @@ "python.terminal.launchArgs": [ "-X", "dev" - ], - "terminal.integrated.environmentChangesRelaunch": false + ] } } }, - "onCreateCommand": "sudo chmod +x .devcontainer/on-create-command.sh && .devcontainer/on-create-command.sh" + "onCreateCommand": ".devcontainer/on-create-command.sh" } diff --git a/.devcontainer/on-create-command.sh b/.devcontainer/on-create-command.sh index e4bdbaf2..deffa37b 100755 --- a/.devcontainer/on-create-command.sh +++ b/.devcontainer/on-create-command.sh @@ -3,8 +3,7 @@ set -e python3 -m venv .venv . .venv/bin/activate -pip install --upgrade pip setuptools -pip install -r requirements/dev.txt && pip install -e . -pre-commit install - -sudo cp .devcontainer/welcome-message.txt /usr/local/etc/vscode-dev-containers/first-run-notice.txt +pip install -U pip setuptools wheel +pip install -r requirements/dev.txt +pip install -e . +pre-commit install --install-hooks diff --git a/.devcontainer/welcome-message.txt b/.devcontainer/welcome-message.txt deleted file mode 100644 index 8061f73d..00000000 --- a/.devcontainer/welcome-message.txt +++ /dev/null @@ -1,7 +0,0 @@ -👋 Welcome to "Flask" in GitHub Codespaces! - -🛠️ Your environment is setup with all the required dependencies and your fork has been added as a remote. - -🚀 To start coding: - - 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 diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst index 9a029ea7..f83d40ff 100644 --- a/CONTRIBUTING.rst +++ b/CONTRIBUTING.rst @@ -70,24 +70,18 @@ Include the following in your patch: First time setup using GitHub Codespaces ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -`GitHub Codespaces`_ allow you to create an instant and dedicated -development environment. Codespaces open by default in Visual Studio -Code for the Web, but also work in the desktop app. Codespaces created -from Flask are configured with a `devcontainer`_ that installs required -dependencies for you. +`GitHub Codespaces`_ creates a development environment that is already set up for the +project. By default it opens in Visual Studio Code for the Web, but this can +be changed in your GitHub profile settings to use Visual Studio Code or JetBrains +PyCharm on your local computer. - Make sure you have a `GitHub account`_. -- From the Flask repository page, click the green "Code" button and - then "Create codespace on main". -- Wait for the codespace to load and the ``postCreateCommand`` to - finish running. -- Run the following command to activate the python virtualenv. - - .. code-block:: text - - $ . .venv/bin/activate - -- Checkout a branch and `start coding`_. +- From the project's repository page, click the green "Code" button and then "Create + codespace on main". +- The codespace will be set up, then Visual Studio Code will open. However, you'll + need to wait a bit longer for the Python extension to be installed. You'll know it's + ready when the terminal at the bottom shows that the virtualenv was activated. +- Check out a branch and `start coding`_. .. _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