Git Product home page Git Product logo

k-render's Introduction

Python CI-CD Boiler Plate Project

Build Status codecov Version

This is a boiler plate project for Python packages. It includes a minimal example package, and some support scripts for making developing and updating it easier.

Features

  • Travis CI Integration.
  • Unit Tests.
  • Code Coverage.
  • Script to automatically upload package to a nexus PyPI repository on push.
  • Automatic Version Bumping (as a git hook).
  • Automatic README badges.

Getting Started

Auto Version Management

First, run this script from the root directory of the project to set up the local git hooks.

bash .support/setup.sh

This will set up the automatic version bumping. It will update the micro version string in version file, which is used by setup.py to generate the package version, and also injected into the __init__.py file of the package so that when imported, the user can use <package>.__version__ . This will be done as a git hook on every commit. Major and minor versions must be updated manually.

3rd Party Services

To use this, you will need to hook up this repository with a Travis account, a CodeCov account, and some kind of online repository, like Nexus.

Setup Config

Modify the fields at the top of setup.py:

AUTHOR = "Jakrin Juangbhanich"
EMAIL = "[email protected]"
PACKAGE_NAME = "boiler"
DESCRIPTION = "A boiler-plate project for packages."
REPO = "https://github.com/Infrarift/py-cicd-boiler"

The PACKAGE_NAME also specifies the directory which will be exported and bundled (and will be also the name of the package). Everything under that directory will be exported, and everything outside will not.

If you want to export some other packages, or have more custom control, modify this line in the setup script instead:

packages=["foo", "bar"]

Unit Tests

Unit tests should be named in the format of test_*.py and should reside in the tests directory. These tests will be run automatically by the Travis service.

In travis.yml you must change this line so that the --source points to whatever package you are testing coverage for.

script:
  - coverage run --source {YOUR_PACKAGE} -m unittest tests/test_*.py

k-render's People

Contributors

krinj avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.