This template repository provides a ready-to-use Python development environment leveraging Docker and VS Code Dev Containers.
Make sure you have installed:
Set the following environment variables on your system before proceeding:
If the git username and email you need to use is different from one on the global settings, use: Linux / macOS:
export GIT_USER_NAME="Your Git Username"
export GIT_USER_EMAIL="Your Git Email"Optionally, you can add them to your ~/.bashrc, ~/.zshrc, or similar:
echo 'export GIT_USER_NAME="Your Git Username"' >> ~/.bashrc
echo 'export GIT_USER_EMAIL="Your Git Email"' >> ~/.bashrc
source ~/.bashrcelsewere, all exports can be replaced with:
export GIT_USER_NAME=$(git config --get user.name)
export GIT_USER_EMAIL=$(git config --get user.email)-
Create Repository from Template:
- Go to the template repository.
- Click the "Use this template" button and create your own repository.
- Now you can check if github action went correct, if not need to do the step in after repo clonning.
-
Clone Your New Repository:
git clone https://github.com/your-username/your-new-repo.git
cd your-new-repo-
Open in VS Code with Dev Containers:
-
Ensure Docker is running.
-
Open VS Code, use
Ctrl+Shift+P(orCmd+Shift+Pon Mac), and selectRemote-Containers: Reopen in Container. -
If the GitHub Action did not run successfully, please execute the
run_me_first.shscript and remove the.github/workflows/initial_setup.ymlfile. This issue may arise depending on your github configuration.
-
-
Initial Setup (Automatic):
- On creating your first branch, GitHub Actions will automatically run a renaming script to customize your repository.
- No manual interaction is needed at this stage.
.
├── .devcontainer
│ ├── Dockerfile
│ ├── devcontainer.json
│ └── setup_git.sh
├── main.py
└── pyproject.toml
Run the provided Python script to confirm everything is set up correctly:
python main.pyExpected output:
Hello from your-new-repo!
If you see the above message, your setup is successful.
- Python
3.11
Included libraries:
- numpy
- pandas
- plotly
- uvicorn
- ipykernel
Development dependencies:
- ruff
- pyright
- Python
- Pylance
- Ruff
- ESLint
- Jupyter
- YAML Formatter
- Markdown All-in-One
- Prettier
- Shell-format
- Even Better TOML
- Formatting and linting configured via
ruff(Google docstring style).
If the Dev Container does not start or environment variables are missing, ensure:
- Docker is running.
- Environment variables
GIT_USER_NAMEandGIT_USER_EMAILare correctly set. - The Dev Containers extension in VS Code is installed and active.
Modify pyproject.toml and other configuration files to add dependencies and adjust settings as needed for your project.
Feel free to suggest improvements or open issues in the original repository.
Happy Coding! 🚀