Example project for demonstrating proprietary PyPI packages
Project description
Python Package Starter
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
- pyenv (for automatic installation use pyenv-installer)
- poetry
Installation
- Install pyenv.
- Install the Python versions you want to support using
pyenv
.
pyenv install 3.6.9
pyenv install 3.8.0
- Clone repo:
git clone git@github.com:vikpe/python-package-starter.git [PACKAGE_NAME]
cd [PACKAGE NAME]
- Create a virtual env:
pyenv virtualenv 3.8.0 foo38
- Activate virtual env:
pyenv activate foo38
- Install poetry:
pip install poetry
- Install dependencies:
poetry install
- 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
File details
Details for the file cython_packages-0.1.4-cp39-cp39-manylinux_2_31_x86_64.whl
.
File metadata
- Download URL: cython_packages-0.1.4-cp39-cp39-manylinux_2_31_x86_64.whl
- Upload date:
- Size: 36.0 kB
- Tags: CPython 3.9, manylinux: glibc 2.31+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.13 CPython/3.9.10 Linux/5.10.16.3-microsoft-standard-WSL2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | eda32f7d710f13fb954888f569009dfa526f7833f36060b3088a70f88997a203 |
|
MD5 | 839fea09e7097bf1a95c6b9406a75a01 |
|
BLAKE2b-256 | 6672d46d00b465fb713b628d2eb1ab3741cc3c729337304e22884589f859667f |