/py-pkg-template

Python package project template.

Primary LanguageShellMIT LicenseMIT

Python Package Template

Python package project template.

Steps

  1. Clone this project and rename.

    git clone git@github.com:takelushi/py-pkg-template.git
    mv py-pkg-template <YOUR_REPOSITORY_NAME>
  2. Setup repository.

    # Create pyproject.toml
    bash setup.bash pyproject
    vi pyproject.toml
    
    # Name project.
    bash setup.bash name
    
    # Install packages
    vi dev-requirements.txt
    vi requirements.txt
    bash setup.bash package
    
    # Clean repository.
    bash setup.bash clean
    rm setup.bash
  3. Integrate to CircleCI. (If you want)

Development

  • Requirements: poetry, pyenv
# Setup
poetry install

# Lint & Test
mkdir -p report
poetry run flake8 --format=html --htmldir=report/flake-report .
mypy src/ tests/ --html-report report/mypy
poetry run pytest \
   --html=report/pytest/index.html\
   --cov-report html:report/coverage

# Build and publish
poetry build
poetry publish