This is an example project which uses micromamba-devcontainer. The .devcontainer
folder was created using Cruft with cookiecutter-micromamba-devcontainer.
.devcontainer
folderInstall Cruft (also manages updates) or Cookiecutter.
Create .devcontainer
in the project root by running the command
cruft create https://github.com/maresb/cookiecutter-micromamba-devcontainer
or
cookiecutter https://github.com/maresb/cookiecutter-micromamba-devcontainer
You will be asked values for the following variables, which are stored in .devcontainer/.cruft.json
:
package_name
: The name of the main package of your project, as you would import
it from Python.timezone
: The timezone to configure in the devcontainer.packages_dir
: The directory where package_name
is located (often src
), or .
for the project root.The project root should contain the subdirectory [packages_dir]/[package_name]
, and moreover this subdirectory should contain an __init__.py
file.
Customize .devcontainer/dev-conda-environment.yaml
with your desired Conda development packages.
Customize .devcontainer/dev.Dockerfile
to install (a skeleton of) your project, preferrably in editable mode (e.g. pip install -e .
). This way the project dependencies will be installed in the devcontainer.
Customize the extensions
and settings
in .devcontainer/devcontainer.json
.
Press Ctrl+Shift+P and select "Remote-Containers: Rebuild and Reopen in Container", and if all goes well, this will load successfully.
For more information, see micromamba-devcontainer.