GithubHelp home page GithubHelp logo

compilerla / template-devcontainer Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 0.0 650 KB

A template repository with a minimal VS Code devcontainer setup

Home Page: https://compilerla.github.io/template-devcontainer

License: Apache License 2.0

Dockerfile 90.92% Shell 9.08%
mkdocs mkdocs-material pre-commit vscode vscode-devcontainer

template-devcontainer's People

Contributors

angela-tran avatar dependabot[bot] avatar pre-commit-ci[bot] avatar thekaveman avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

template-devcontainer's Issues

Create a python (package) variant

Create another template repository, based on this one, with a basic setup for creating a new Python package.

Features

Running list of features to build into this template

Linting

Use flake8 for python code linting:

  • configuration in .flake8
  • add to .devcontainer/requirements.txt
  • devcontainer plugin, add to devcontainer.json
  • pre-commit hook, add to .pre-commit-config.yaml

Formatting

Use black for python code formatting:

  • configuration in pyproject.toml
  • add to .devcontainer/requirements.txt
  • devcontainer plugin, add to devcontainer.json
  • pre-commit hook, add to .pre-commit-config.yaml

Testing

Use pytest for python testing

  • tests/ dir: __init__.py, conftest.py (empty)
  • tests/requirements.txt, install in devcontainer: pytest, pytest-cov, pytest-mock
  • tests/run.sh: runs tests with coverage, (re)generates coverage report
  • Serve coverage report from docs service
  • .github/workflows/pytest.yml calls tests/run.sh on every commit

Python package setup

  • package_name/ dir: __init__.py (empty)
  • .devcontainer/postAttach.sh, install the local package into the devcontainer
  • setup.py in the root, just import and call setuptools.setup() (with no args)
  • setup.cfg in the root, most configuration info about package
  • [build-system] entry in pyproject.toml

Repository setup

  • .gitignore with at least:
__pycache__/
.pytest_cache/
.coverage
.DS_Store
.egg-info/
build/

Editor settings

  • Add the following to .vscode/settings.json
"[python]": {
  "editor.defaultFormatter": "ms-python.python"
},
"python.formatting.provider": "black",
"python.languageServer": "Pylance",
"python.linting.enabled": true,
"python.linting.flake8Enabled": true,
"python.testing.pytestArgs": ["tests"],
"python.testing.pytestEnabled": true,
"python.testing.unittestEnabled": false

Docs

  • Add mkdocstrings for automatic code documentation generation

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.