Skip to main content

The GMU PyPi template repository.

Project description

The GMU PyPi Template

Authors:Mybrid Wonderful, Gregg Yearwood


The GMU PyPi Template s a general Python project layout to create a PYPI project and is used for all PYPI Python projects at The Gregg & Mybrid Upgrade, Inc. (The GMU). The Makefile provided can immediately publish a package file to, assuming you have an account.

Feel free to clone the source code to make this your own:

git clone

‘fun_stuff’ Sample Instructions

# Create /tmp/fun_stuff sample project
# 1. Create a Python3 virtualenv.
mkdir -p /tmp/venv
python3 -m venv /tmp/venv/py3_fun_stuff

# 3. Activate the Python3 virtualenv.
. /tmp/venv/py3_fun_stuff/bin/activate

# 2. Create an empty Python3 project directory.
mkdir -p /tmp/git/fun_stuff

# 5. Change directory into the empty Python3 project directory.
cd  /tmp/git/fun_stuff

# 4. Install thegmu-pypi-template.
# TEST: pip install --index-url thegmu-pypi-template
pip install thegmu-pypi-template

# 6. Run the install script to install the files into the current directory.

# 7. Activate the PYPI environment from directory /tmp/fun_stuff
. bin/activate-fun-stuff

# 8. Validate the fun-stuff configuration by running the following make commands.
make init
make test
make dist
make test-dist

# 9. Repeat the above for your new project configuration your development environment.
#     Follow the same steps above but:
#     Replace '/tmp/venv/fun_stuff' with your Python development virtualenv root directory and project name, i.e. "$HOME/venv/py3_my_project".
#     Replace '/tmp/git/fun_stuff' with your development source code repository root directory, i.e. "$HOME/workspace/git/my_project".
#     Create a new activation file and update the environment variables.
#     cp bin/activate-fun-stuff bin/activate-my-projectname
#     replace '. bin/activate-fun-stuff' with '. bin/activate-my-projectname'

# 10. To make Sphinx documentation.
make backup-docs # Create backup to compare your files with.
make destroy-docs # Delete everything under docs/
make docs # Runs the Sphinx wizard to initialize the file and then 'make html'.
# Open HTML index file in browser: docs/_build/html/index.html


  1. Encourage Python standards are followed for packaging and source.
  2. Pylint for validating PEP8 standards of code.
  3. Sphinx documentation to integrate with
  4. Test automation in the dedicated tests directory.
  5. PyPi package deployment.
  6. ReadTheDocs documentation deployment.


  1. autopep8: pep8 code beautifier
  2. pylint: coding standards
  3. pytest: test source
  4. public documentation using sphinx
  5. sphinx: html documentation
  6. tox: test the source as installed package
  7. twine: deploy the package to,
  8. Makefile: run the tools

Configuration files:

  1. .gitignore: ignore pylint, pytest, tox and build files as well .settings, .project, and .pydevproject directories from Eclipse.
  2. .pylintrc: The GMU specific PEP8 suppression.

Makefile Options

make <option>

Same as help.
Create a temp directory, ‘docs.tmp.XXX’, using mktemp and copy the docs directory to it.
Removes Python compiled files, pytest files, and tox test files. See clean-pyc and clean-tox.
Removes Python packaging files.
Removes sphinx documentation build files. Configuration files are not removed.
Removes Python compiled files and pytest files.
Removes tox test files.
Removes all sphinx config and manually edited document files as well as all generated files. See clean-docs. See backup-docs.
Creates source and binary Python packages suitable for PyPi.
Build the the HTML documentation files in docs/_build.
Displays this file.
  1. Install Python tools used by this Makefile.
  2. Run project-init, see project-init.
Run autopep8 and update all the project and test files in place with white space changes.
  2. test/ import of project name updated.
  3. tox.ini: envlist updated
  1. Publish the package to production ‘’.
  2. User name and password prompt are given.
Publish the package to test ‘’. User name and password prompt are given.
Run pylint and output results. No other action is taken. See pep8 option to fix white space problems.
Python ‘pip’ packages for the tools.
Run the tests from source using pytest.
Run the tests from virtual envinorments using tox. Builds the package and then run the test as packages in temporary Python virtualenv environments.
Upgrade Python ‘pip’ packages for the tools.

The reasonable person adapts themself to the world; the unreasonable one persists in trying to adapt the world to themself. Therefore all progress depends on the unreasonable person. –George Bernard Shaw

The End

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

thegmu-pypi-template-1.3.0.tar.gz (7.9 kB view hashes)

Uploaded source

Built Distribution

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page