Package: ksp-sample
OverviewThis 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 projectclone the project filesrename the ‘src/ksp_sample’ subfolder to reflect the new project nameupdate the project specific parameters in the ‘project.prop’ file in the root folderupdate the import path in the “./tests/test_version.py” script to reflect
your new project nameactivate project ontravis-ci.orglog in to the Travis CI websitehover over your avatar in the top-right corner and select ‘settings’click the “sync account” button in the left side-barrefresh your browser page to make sure your list of projects is up to datefind your project in the list and click the slider to turn on supportclick the small cog icon next to your new project to configure settingsUnder environment variables, define the following variables (needed to publish Python packages):DEPLOY_USERUser name to log in to PyPI package repositoryDEPLOY_PASSPassword for the PyPI userUnder cron set the master branch to build once a monthso long as your project has a .travisci.yml file in the root folder the build should automatically startactivate project onreadthedocs.orglog in to the ReadTheDocs websiteclick 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 loadTo import manually, click “Import Manually”Under “Name of Project” enter the name of the Github project without the URL or .git extensionUnder the “Repository URL” field, copy-paste the HTTPS URL used for cloning the Github projectCheck the “Advanced Options” check box and click “Next”Fill out the advanced properties as desiredactivate project oncoveralls.iolog in to the coveralls dashboardclick “add repo”search for new repo in the listclick the “on” button to enable coverage analysisactivate project onrequires.iolog in to the requires dashboardclick on the “repositories” button at the topwait for the project list to refresh and show your new projectclick the “Activate” button next to your repomodify 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 projectdescription of readthedocs pageDistUtils project short description in the setup.pyfirst line of the readme.rstUsing the projectto generate a package do the following:python setup.py bdist_wheeluploading of new versions to pypi is handled automatically via Travis CINOTE: 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-docsmake sure to add any new project dependencies to the project.prop file
as requirements changeTIPSmake 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 confusionmake 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 pypiall 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.Linksbadge related blog:http://thomas-cokelaer.info/blog/2014/08/1013/