Skip to main content
Build Automation Test Coverage Python Versions Documentation Status Requirements Status Package Format Download Count GPL License

Overview

This is a template project I use for my personal projects, to remind me how to set up projects, folder structures, etc. and how to integrate the projects with Travis CI, PyPI, and other such services.

Creating a new project

  • clone the project files

  • rename the ‘src/ksp_sample’ subfolder to reflect the new project name

  • update the project specific parameters in the ‘project.prop’ file in the root folder

  • update the import path in the “./tests/test_version.py” script to reflect your new project name

  • activate project on travis-ci.org

    • log in to the Travis CI website

    • hover over your avatar in the top-right corner and select ‘settings’

    • click the “sync account” button in the left side-bar

    • refresh your browser page to make sure your list of projects is up to date

    • find your project in the list and click the slider to turn on support

    • click the small cog icon next to your new project to configure settings

    • Under environment variables, define the following variables (needed to publish Python packages):

      • DEPLOY_USER User name to log in to PyPI package repository

      • DEPLOY_PASS Password for the PyPI user

    • Under cron set the master branch to build once a month

    • so long as your project has a .travisci.yml file in the root folder the build should automatically start

  • activate project on readthedocs.org

    • log in to the ReadTheDocs website

    • click the drop-down list on your name in the top-left corner and select “My Projects”

    • click “Import a Project”

    • To import automatically, try clicking the “Refresh” button to load your Github projects, and select the one(s) to load

    • To import manually, click “Import Manually”

    • Under “Name of Project” enter the name of the Github project without the URL or .git extension

    • Under the “Repository URL” field, copy-paste the HTTPS URL used for cloning the Github project

    • Check the “Advanced Options” check box and click “Next”

    • Fill out the advanced properties as desired

  • activate project on coveralls.io

    • log in to the coveralls dashboard

    • click “add repo”

    • search for new repo in the list

    • click the “on” button to enable coverage analysis

  • activate project on requires.io

    • log in to the requires dashboard

    • click on the “repositories” button at the top

    • wait for the project list to refresh and show your new project

    • click the “Activate” button next to your repo

  • modify the ‘fail_under’ value in the .coveragerc file to a reasonable value for unit test coverage (ie: 90% say)

  • For consistency, set the following to the same ‘short descriptive’ text for the project:

    • title on GitHub project

    • description of readthedocs page

    • DistUtils project short description in the setup.py

    • first line of the readme.rst

Using the project

  • to generate a package do the following: python setup.py bdist_wheel

  • uploading of new versions to pypi is handled automatically via Travis CI

    • NOTE: After tagging a new release, you will need to enable the docs for the release on readthedocs.org. Log in, locate the project in question, click on settings -> versions and make sure the check box labelled “active” is checked for the new version.

  • Updating the API docs and generating sample HTML output is done as follows: tox -e py3-docs

  • make sure to add any new project dependencies to the project.prop file as requirements change

TIPS

  • make sure your project name doesn’t use underscores in the name because pypi packages will convert them to dashes when being published which creates a subtle discrepancy between the module name and the package name, which can lead to confusion

  • make sure your project name doesn’t use dashes in the name because you’ll need to name your module with the dash for consistency but then the project will fail the PEP8 validation check because the name doesn’t satisfy the snake-case naming requirements.

  • to make some of the badges work you’ll need to upload a version to pypi

  • all development work should be done in a local virtual environment under a ./venv subfolder (ie: virtualenv -p python3 ./venv && . ./venv/bin/activate )

  • you can add PyCharm projects to the repo. Just exclude the files listed in the .gitignore file.

Release files for ksp-sample 0.0.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for ksp-sample 0.0.6
File Interpreter ABI Platform
ksp_sample-0.0.6-py2.py3-none-any.whl Python 2, Python 3 none any Details

Release files / ksp_sample-0.0.6-py2.py3-none-any.whl

Download URL ksp_sample-0.0.6-py2.py3-none-any.whl
Size 7.9 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
6aba49c90bb2df626657509bc553e96556695f6a1d572647a674c676cab67071
BLAKE2b-256 checksum
How to use checksums
500aaa96be05ce830663ebf656f62aeb6bfdebce091c6111f229b81bfdcba723
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/38.2.4 requests-toolbelt/0.9.1 tqdm/4.31.0 CPython/3.6.3

Release history Release notifications | RSS feed

This release

0.0.6 This release

1 release file

0.0.5

1 release file

0.0.4

1 release file

0.0.3

1 release file

0.0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page