Skip to main content

Example project for demonstrating proprietary PyPI packages

Project description

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 --format wheel 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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

cython_packages-0.1.4-cp39-cp39-manylinux_2_31_x86_64.whl (36.0 kB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.31+ x86-64

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page