python small tools for ci and team cooperation
TRANSCRIPT
![Page 1: python small tools for CI and team cooperation](https://reader035.vdocuments.mx/reader035/viewer/2022062523/58ed86f51a28ab3f1c8b4587/html5/thumbnails/1.jpg)
協同開發的補助工具4 H R 開發小工具
![Page 2: python small tools for CI and team cooperation](https://reader035.vdocuments.mx/reader035/viewer/2022062523/58ed86f51a28ab3f1c8b4587/html5/thumbnails/2.jpg)
WHO AM I
• GliaCloud founder• 社群好朋友• Google Cloud Developer Expert
• 最近利用有空時寫了一些小工具– 但又要沒時間了 T__T
![Page 3: python small tools for CI and team cooperation](https://reader035.vdocuments.mx/reader035/viewer/2022062523/58ed86f51a28ab3f1c8b4587/html5/thumbnails/3.jpg)
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://reader035.vdocuments.mx/reader035/viewer/2022062523/58ed86f51a28ab3f1c8b4587/html5/thumbnails/4.jpg)
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](https://reader035.vdocuments.mx/reader035/viewer/2022062523/58ed86f51a28ab3f1c8b4587/html5/thumbnails/5.jpg)
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](https://reader035.vdocuments.mx/reader035/viewer/2022062523/58ed86f51a28ab3f1c8b4587/html5/thumbnails/6.jpg)
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 7: python small tools for CI and team cooperation](https://reader035.vdocuments.mx/reader035/viewer/2022062523/58ed86f51a28ab3f1c8b4587/html5/thumbnails/7.jpg)
AUTOCOV• https://github.com/lucemia/autocov• DEMO
– https://github.com/livingbio/op/pull/151– https://github.com/livingbio/op/blob/master/.travis.yml
![Page 8: python small tools for CI and team cooperation](https://reader035.vdocuments.mx/reader035/viewer/2022062523/58ed86f51a28ab3f1c8b4587/html5/thumbnails/8.jpg)
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](https://reader035.vdocuments.mx/reader035/viewer/2022062523/58ed86f51a28ab3f1c8b4587/html5/thumbnails/9.jpg)
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](https://reader035.vdocuments.mx/reader035/viewer/2022062523/58ed86f51a28ab3f1c8b4587/html5/thumbnails/10.jpg)
FLAKE8 -H
Tox.ini[flake8]ignore = E501,F401,F841,F403
![Page 11: python small tools for CI and team cooperation](https://reader035.vdocuments.mx/reader035/viewer/2022062523/58ed86f51a28ab3f1c8b4587/html5/thumbnails/11.jpg)
SAMPLE COOP
• https://github.com/pycontw/pycontw2016
https://github.com/pycontw/pycontw2016
![Page 12: python small tools for CI and team cooperation](https://reader035.vdocuments.mx/reader035/viewer/2022062523/58ed86f51a28ab3f1c8b4587/html5/thumbnails/12.jpg)
LIFE CYCLE
Coding
Testing
Deployment
Execution
Coding
Testing
Deployment
Execution
Automation
![Page 13: python small tools for CI and team cooperation](https://reader035.vdocuments.mx/reader035/viewer/2022062523/58ed86f51a28ab3f1c8b4587/html5/thumbnails/13.jpg)
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](https://reader035.vdocuments.mx/reader035/viewer/2022062523/58ed86f51a28ab3f1c8b4587/html5/thumbnails/14.jpg)
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