python small tools for ci and team cooperation

14
協協協協協 協協協協 4HR 協協協協協

Upload: chien-hsun-chen

Post on 12-Apr-2017

398 views

Category:

Software


3 download

TRANSCRIPT

Page 1: python small tools for CI and team cooperation

協同開發的補助工具4 H R 開發小工具

Page 2: python small tools for CI and team cooperation

WHO AM I

• GliaCloud founder• 社群好朋友• Google Cloud Developer Expert

• 最近利用有空時寫了一些小工具– 但又要沒時間了 T__T

Page 3: python small tools for CI and team cooperation

AUTO REQUIREMENT

• https://github.com/lucemia/autoreq• DEMO

autoreq --in-place -r ./

No versionNo despHard to maintain

Auto add version if not specifyAuto add description

A tool that automatically formats requirements

Page 4: python small tools for CI and team cooperation

https://pypi.python.org/pypi/DjangoPackage list

Package Detailhttps://pypi.python.org/pypi/autoreq

RequestsPandasBeautifulSoup

Page 5: python small tools for CI and team cooperation

AUTOREQ -Husage: autoreq [-h] [--version] [-v] [-d] [-i] [-r] [-j n] [--exclude globs] [files [files ...]]

positional arguments: files files to format or '-' for standard in

optional arguments: -h, --help show this help message and exit --version show program's version number and exit -v, --verbose print verbose messages; multiple -v result in more verbose

messages -d, --diff print the diff for the fixed source -i, --in-place make changes to files in place -r, --recursive run recursively over directories; must be used with –in-place or --

diff -j n, --jobs n number of parallel jobs; match CPU count if value is less than 1 --exclude globs exclude file/directory names that match these comma-separated

globs

Page 6: python small tools for CI and team cooperation

AUTOCOV • Generate Coverage report• Integrate with CI• Hook with github Status Check• Store report to github page

A tool that automatically generate coverage report and save to github page

Autocov –percent=30

Page 8: python small tools for CI and team cooperation

AUTOCOV -H

usage: autocov [-h] [--user USER] [--token TOKEN] [--percent PERCENT]

optional arguments: -h, --help show this help message and exit --user USER the github user --token TOKEN the github token --percent PERCENT the coverage percent requirement (optional)

Page 9: python small tools for CI and team cooperation

FLAKE8 / AUTOPEP8

Flake8 ./flake8 --ignore=E501 ./Flake8 –ignore=E501,F401

the modular source code checker: pep8, pyflakes and co

Flake8 is a wrapper around these tools:PyFlakes / pep8 / Ned Batchelder’s McCabe script

Page 10: python small tools for CI and team cooperation

FLAKE8 -H

Tox.ini[flake8]ignore = E501,F401,F841,F403

Page 11: python small tools for CI and team cooperation

SAMPLE COOP

• https://github.com/pycontw/pycontw2016

https://github.com/pycontw/pycontw2016

Page 12: python small tools for CI and team cooperation

LIFE CYCLE

Coding

Testing

Deployment

Execution

Coding

Testing

Deployment

Execution

Automation

Page 13: python small tools for CI and team cooperation

ISSUES, BRANCH, PULL REQUEST, AND CODE REVIEW• Sample:

– https://github.com/pycontw/pycontw2016/pull/139

• Git Squash or not?– https://github.com/GoogleCloudPlatform/gcloud-python/commits/master– https://github.com/GoogleCloudPlatform/gcloud-python/pulse

Page 14: python small tools for CI and team cooperation

TRAVIS

• A contineous Integration (CI) service– Define different enviornment and run the test– https://github.com/pycontw/pycontw2016/blob/master/.travis.yml

• Coverage Report, Notification, Deployment– https://codecov.io/github/pycontw/pycontw2016?

ref=a14411637a2047c6ef248945aeb3bb5f5b2a44b4