namth2302 / orm-alchemy

orm-alchemy

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Python Package Starter

test codecov Code style: black

Features

  • Multi python version support (pyenv, tox)
  • Single config using the new standardized pyproject.toml (PEP518)
  • Simple build/publish/dependency management using poetry
  • Continous integration (GitHub Actions)
  • Code coverage reporting (Codecov)
  • Code formatting (black)

Prerequisites

Installation

  1. Install pyenv.
  2. Install the Python versions you want to support using pyenv.
pyenv install 3.6.9
pyenv install 3.8.0
  1. Clone repo: git clone git@github.com:vikpe/python-package-starter.git [PACKAGE_NAME]
  2. cd [PACKAGE NAME]
  3. Create a virtual env: pyenv virtualenv 3.8.0 foo38
  4. Activate virtual env: pyenv activate foo38
  5. Install poetry: pip install poetry
  6. Install dependencies: poetry install
  7. Edit pyproject.toml, update project name, description and author and any other settings you like.

Usage

Command Description
poetry add [package] Add package to dependencies.
poetry add -D [package] Add package to dev dependencies.
poetry run pytest Run tests in local Python version.
poetry run ptw tests foo --clear Watch for file changes and run tests in local Python version.
poetry run tox Run tests in all Python versions defined in tox.ini.
poetry run black . Run black code formatter.
poetry build Build sdist and wheel to /dist.
poetry publish Publish package to PyPi.

Continous integration

GitHub Actions

Tests are run whenever there is a commit, see .github/workflows/test.yml for details.

Code coverage

Enable code coverage reporting to Codecov by creating a secret with name CODECOV_TOKEN in your repository settings (Settings -> Secrets -> New sectret) and value set to the token created by Codecov.

About

orm-alchemy

License:MIT License


Languages

Language:Python 100.0%