Skip to content

ikasat/python-boilerplate

Repository files navigation

python-boilerplate

Please rename this package:

PACKAGE_NAME=foobar
git ls-files | xargs sed -i "s/python_boilerplate/${PACKAGE_NAME}/g"
mv python_boilerplate "$PACKAGE_NAME"
rm -rf .git

Create and activate venv

python3 -m venv .venv
source .venv/bin/activate

Install

pip install .

Upgrade

pip install -U .  # or --upgrade

Import this library

(Python)

import python_boilerplate
print(python_boilerplate.add(1, 1))  # => 2

Execute this application

python-boilerplate 1 1

Create a source distribution

python setup.py sdist

Create a wheel package

pip install wheel
python setup.py bdist_wheel

Install (for developer)

PIPENV_VENV_IN_PROJECT=true pipenv install -d

Test

pipenv run pytest

Test against multiple environments

pipenv run tox

Lint

pipenv run vet

Reformat source code

pipenv run fmt

Generate documents

pipenv run doc

Create a wheel package (for developer)

pipenv run build

About

Pythonのパッケージングのベストプラクティスについて考える2018

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages