Skip to content

Repository files navigation

python template

Current Release In Development
Code
User Guide
API Docs
Test Coverage tests tests
Linting lint lint

userguide api ![lint][lint_badge] test-coverage version

Go to home page

Getting Started

To use the features of this template, you will need to modify several aspects after import, including:

  • Update pyproject.toml to reflect the name of your project ("python_template" for this repo) and include dependencies. This will also affect paths for command line entry points near the bottom of the .toml file
  • Modify the name of the subdirectory in src/ to match the name of your project ("python_template" for this repo). The included CI/CD configuration expect the standard src layout employed by the template and will not work otherwise.
  • Modify the imports for test files to point to the name of your project ("python_template" for this repo). Only an example function in the "sum" module is included as a test.
  • Update links for the badges above here in the readme. Badges will not render correctly until the above other changes are made and the CI pipeline runs successfully.

Installing a pacakge

  • setup your git keys
  • install python to make sure you have a working version
python --version
python3 --version
python3 -m pip install --upgrade pip setuptools #global upgrade
  • setup proxy stuff
  • create virtual environment
python3 -m venv .venv #make venv
  • activate the environment
source .venv/bin/activate       # for bash shell
source .venv/bin/activate.csh   # for c shell
source .venv/bin/activate.fish  # for fish shell
.\.venv\Scripts\activate        # for powershell
  • install the package with pip
pip install -e .[dev]  # install in dev mode, with editable

#Package Notes

pytest --cov=src --cov-report=xml:coverage_reports/coverage.xml --cov-report=html:coverage_reports/htmlcov --cov-report=term tests/
  • mdbook
mdbook serve ./docs/userguide/ --open # server view
mdbook build ./docs/userguide/        # build the book
  • api docs
env:
  PROJECT_NAME: python_template
echo "Project Name: $PROJECT_NAME"
pdoc ./src/$PROJECT_NAME/  -o ./docs/api
pdoc ./src/python_template/  -o ./docs/api

About

template for python projects

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages