Skip to main content

Example boilerplate for a simple Python project

Project description

Example Python project

Tests status PyPI publishing status PyPI version OSI license

Generate cool badges with badgen, shields, or the standard GitHub workflow badges.

This repo contains boilerplate configs for python projects, including:

  • vanilla setup.py to bundle and install a python package;
  • publishing package to PyPI on CI;
  • running tests on CI;
  • general folder structure.

Publishing to PyPI locally

Python reference here, and twine reference here.

  1. Install necessary dependencies.
pip3 install setuptools twine build
  1. Generate distribution archives (bundle package).
python3 -m build
  1. Upload the distribution archives to test-pypi as follows.
python3 -m twine upload --repository testpypi dist/*
  1. If everything looks OK, upload the distribution archives to the official PyPI repo.
python3 -m twine upload dist/*

Note When prompted for credentials use __token__ for the username and your generated api token as the password.

Installing

After publishing your project, you can now install it with pip as follows (optionally, add the test-pypi url):

pip3 install my-project-andre [--index-url https://test.pypi.org/simple/]

Substitute my-project-andre with whatever unique project name you chose in setup.py.

Project details


Download files

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

Source Distribution

my-project-andre-0.1.0.tar.gz (15.6 kB view hashes)

Uploaded Source

Built Distribution

my_project_andre-0.1.0-py3-none-any.whl (15.3 kB view hashes)

Uploaded Python 3

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