Skip to content

nelsg/vscode-python-project-template

Repository files navigation

VSCode Python Project Template

Template for my python (version 3) projects with vscode

Commands

  • Init space (with bash) : source _initial_setup.sh
  • Create virtualenv virtualenv : virtualenv -p python3 .venv
  • Load/Source virtuelenv : source .venv/bin/activate
  • Install requirements : pip install -r requirements.txt
  • Install test requirements : pip install -r tests/requirements.txt
  • Launch unitary tests : python3 -m pytest tests -v
  • Launch coverage tests : python3 -m pytest --cov-report xml:cov.xml --cov my_module tests -v

Tools choices

Extensions

Usefull extensions :

Tasks

  • Unitary tests with code coverage

Use it

  • Clone this repo as a new vscode workspace
  • Create virtualenv and install requirements (see Commands)
  • Rename folder my_module with your module name
  • In .vscode/tasks.json, replace my_module by your module name
  • Fix module import in main.py and ./tests/test_my_module.yy if needed
  • Try everything by:
    • Launching unitary tests
    • Launching task
    • Launching configurations
    • Debugging with a breakpoint

Sources

About

Python project template

Resources

Stars

Watchers

Forks

Packages

No packages published