Skip to content

This is intended to be a repository to serve as a template to my own, and others projects using Python.

License

Notifications You must be signed in to change notification settings

ninja-asa/template-python-project

Repository files navigation

template-python-project 📄

Run Tests Coverage Badge License: MIT

This is intended to be a repository to serve as a template to my own, and others projects using Python.

Contents

  • .github/workflows/: contains the GitHub Actions workflows.
  • .vscode/: contains the settings for Visual Studio Code.
  • .devcontainer/: contains the settings for the development container and the development Dockerfile.
  • app/: contains the source code of the project.
  • tests/: contains the tests of the project.

Getting Started

This template relies on using Docker for development and using Visual Studio Code as the IDE.

Pre-requisites

Step by Step

To start developing in any repository using this template:

  • Clone the repository
  • Open the repository in VSCode
  • Setup intended Python version in the Dockerfile.dev
  • Press F1 and type Remote-Containers: Reopen in Container
  • Start developing 🚀

During this setup, suggested extensions will be installed in the container, and the Python environment will be created, with pytest, coverage, poetry and black installed.

Configuration

  • Github Action: details needed configuration for the GitHub Actions workflows.

Useful links:

Common Issues

Dev Container Cannot Start - Issue with communicating with Docker Enginer

Repro steps:

  • Ensure docker enginer is running
  • Have the required base docker image stored cached
  • Attempt to Open in Container or Rebuild and Open in Container in repository

Issue:

  • Visual Studio Code gets stuck
  • Dev Containers extension Logs we can see an issue of Visual Studio Code server communicating with docker engine: whenever a docker command is called, an error with the API is reported

Attempts:

  • Restart Visual Studio Code
  • Restarted Docker
  • Restart computer

Solution:

  • Updated Docker

Dev Container Cannot Start - Network issue

Repro steps:

  • Ensure docker enginer is running
  • Attempt to Open in Container or Rebuild and Open in Container in repository

Issue:

  • Dev container cannot start building

Solution:

  • Have no internet connectivity to get docker image from remote registry

About

This is intended to be a repository to serve as a template to my own, and others projects using Python.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages