banksalad / python Goto Github PK
View Code? Open in Web Editor NEW๐ช ๐ Use this template if you love Python
License: MIT License
๐ช ๐ Use this template if you love Python
License: MIT License
mypy.ini
์ถ๊ฐ.gitignore
์ .mypy_cache/
์ถ๊ฐMakefile
์
๋ฐ์ดํธpre-push
์
๋ฐ์ดํธrequirements-dev
์
๋ฐ์ดํธ๋๋์ง ์๋๋์ง ๋ฆฌ์์น ํ์ -> choice variables๋ก ์ฌ์ฉ ๊ฐ๋ฅ mypy - hard mode
, mypy - easy mode
mypy.ini
์ญ์ ํ๋ ์คํฌ๋ฆฝํธ ์ถ๊ฐFlask๋ฅผ ์ฌ์ฉํ ๋์ ํ ํ๋ฆฟ, Sanic์ ์ฌ์ฉํ ๋์ ํ ํ๋ฆฟ, ๊ธฐํ ๋ฑ๋ฑ์ ํ ํ๋ฆฟ ๋ฑ ๋ค์ํ ์ ์ฆ ์ผ์ด์ค์ ๋ง๋ ํ๋ก์ ํธ ๊ธฐ๋ณธ ๊ตฌ์กฐ๋ฅผ ์์ฑํ๋ ค ํ ๋ ์ด๋ฅผ ์ด๋ค ๋ฐฉ์์ผ๋ก ๊ตฌํ ํ๋๊ฐ์ ๋ํ ๋ ผ์์ ๋๋ค.
์๊ฐํด ๋ดค์ ๋ ํฌ๊ฒ 3๊ฐ์ง๊ฐ ์์ ๊ฒ ๊ฐ์๋ฐ ์ด ์ค์์ ์ ์ ํ๋ค ์๊ฐ๋๋ ์ ๋ต์ ๊ณจ๋ผ์ฃผ์ ๋ ์ข๊ณ ๋ค๋ฅธ ๋ฐฉ๋ฒ์ ์ ์ํด ์ฃผ์ ๋ ์ข์ต๋๋ค.
GitHub branch๋ก ๋ถ๋ฆฌํ ํ cookiecutter gh:rainist/python --checkout sanic
ํํ๋ก ์ฌ์ฉ
๋ด๋ถ์ {{cookiecutter.package_name}}-sanic
๋ฑ์ ํด๋๋ก ๊ตฌ๋ถ ํ ์ต์
์ ์
๋ ฅ๋ฐ์ hooks/post_gen_project.py
์์ ์ ํ๋ ํจํด์ด ์ ์ฉ๋ ํด๋์ ์ด๋ฆ์ {{cookiecutter.package_name}}
๋ก ์์ ํ ๋๋จธ์ง ์ ํ๋์ง ์์ ํด๋๋ฅผ ์ญ์
pytest.ini
๋ฅผ ์ฌ์ฉํ์ง๋ง flask ํจํด์์ pytest.ini
๋ฅผ ์ฌ์ฉํ์ง ์๊ณ .coveragerc
๋ฅผ ์ฌ์ฉํ๋ ๋ฑ๋ฑ๊ฐ use case์ ๋ง๋ ํ ํ๋ฆฟ ๋ ํฌ๋ฅผ ๊ทธ๋๊ทธ๋ ์์ฑํ๋ค.
Rainist/python-sanic
, Rainist/python-flask
๋๋ฌด ๋ง์์ง๋ค.์ฝ๋์ค๋๋ก @jungwinter @sunghyunzz @sean-ahn ์ถ๊ฐ๋ฅผ ์ ์ํฉ๋๋ค.
.github/CODEOWNERS
* @JungWinter @sunghyunzz @sean-ahn
๊ธฐ๋ณธ์ผ๋ก ์์ฑ๋๋ README.md
ํ์ผ์ ๊ธฐ๋ณธ์ ์ธ ๊ณจ๊ฒฉ์ ์ข ๋ ์ก์๋์ด, ์ถ๊ฐ ๋ฌธ์ ์์
์ด ์ฉ์ดํ๋๋ก ๊ฐ์ ํ๋ฉด ์ข์ ๊ฒ ๊ฐ์ต๋๋ค. ๊ทธ๋ฆฌ๊ณ ํ-ํ ๋ฐฐ์ง๋ค๋ ๊ธฐ๋ณธ์ผ๋ก ๋ฃ์ด๋๋ฉด ์ข๊ฒ .. ๐
black
์ ์ฌ์ฉํ ๋ double quote๋ฅผ ์ฌ์ฉํ๋ค๋ฉด black
์์ -S
์ต์
(double quote์ธ์ง single quote์ธ์ง ์ ๊ฒฝ ์์ฐ๊ฒ ๋ค๋ ์ต์
, black
์ ๊ธฐ๋ณธ์ ์ผ๋ก double quote๋ก ๋ค ํต์ผ์์ผ๋ฒ๋ฆผ)์ด ์์ด์ ธ๋ ๋จ
double quote: black -l 79 .
single quote: black -S -l 79 .
์ด ๋ ํฌ์ template์ ์ด๋ป๊ฒ ์ด์ฉํ ์ ์๋์ง ๋ฑ ๊ธฐ๋ณธ์ ์ธ ๊ฐ์ด๋ ๋ด์ฉ์ด ๋ฌธ์๋ก ์ถ๊ฐ๋๋ฉด ์ข์ ๊ฒ ๊ฐ์ต๋๋ค.
[mypy]
python_version = 3.7
ignore_missing_imports = Truecheck_untyped_defs = True
disallow_untyped_defs = True
disallow_any_generics = True
warn_no_return = True
no_implicit_optional = True
mypy expert ์ค์ ์ ์ค๋ฐ๊ฟ์ด ๋์ง ์์ต๋๋ค.
.travis.yml
with python version![Build Status](https://api.travis-ci.com/Rainist/private-repo.svg?token=travis-token&branch=develop)
(์ด๋ฏธ์ง๋ฅผ ๊ฐ์ธ๋ ๋งํฌ๋ ์๋ตํ์ต๋๋ค)![Build Status](https://travis-ci.com/Rainist/private-repo.svg)
@sunghyunzz
pipenv install
์ด ์๋ pipenv sync
๋ฅผ ์ฌ์ฉํด์ผํฉ๋๋ค.
pipenv install -r requirements.txt
์ฒ๋ผ ์ฌ์ฉํด์ผํฉ๋๋ค.pipenv sync
๋ฅผ ์ฌ์ฉํ๊ธฐ ์ํด Pipfile.lock
๋ ํ๋ก์ ํธ์ ํฌํจํด์ผํฉ๋๋ค.make requirements
์ถ๊ฐ
requirements.txt
๋ฅผ exportํ ์ ์๋ ๊ธฐ๋ฅ์
๋๋ค.make coverage
์ xml ์ถ๊ฐ.travis.yml
์ after_success
์ make coverage
ํ๋ ๋ถ๋ถ ์ถ๊ฐ
Pipfile
์ถ๊ฐ -> pytest, pylint ๋ฑPipfile.lock
์ถ๊ฐ -> ๊ตณ์ด ์ถ๊ฐํด์ผํ๋ ์ถ๊ธฐ๋?post_gen_template.py
์์ if ๋ฌธ์ผ๋ก pipenv๊ฐ n ์ด๋ฉด rm
์ผ๋ก Pipfile
, Pipfile.lock
์ญ์ ํด์ผํจ.gitattributes
์ถ๊ฐ -> git diff, git add
๋ฑ์์ ์กํ์ง ์์. GitHub์์ ์กํMakefile
์ pipenv run make format
๋ฑ์ผ๋ก ๋ณ๊ฒฝ
black
์ ๋ฒ์ ์ ==19.3b0
์ผ๋ก ์
๋ฐ์ดํธ์ด์ ๋ฐ PR ํ ํ๋ฆฟ ์์ฑ
์ฐธ๊ณ : github blog
.editorconfig
๋ฅผ ์์ ํด์ผํฉ๋๋ค.docker ๋ฅผ ์ฌ์ฉํ ์ ์๋ ํ๊ฒฝ์์๋ ๋ถํ์ํด์
Dockerfile ์์ฑ์ ์ ํํ ์ ์์ผ๋ฉด ์ข์๊ฒ ๊ฐ๋ค์
package/__main__.py
์ ์คํ์ํค๋ ๊ฐ๋จํ Dockerfile์ ์ถ๊ฐํ๋ฉด ์ข์ ๊ฒ ๊ฐ์ต๋๋ค.
ํํนํ ์ค๋ช ์ด ์์ผ๋ฉด ์ข๊ฒ ์ต๋๋ค. ๐ถ
๐ช ๐ Rainist python project template using cookiecutter
๊ฐ์?
Rainist์ ๋ค๋ฅธ public repo์ ๊ด๋ก๋ฅผ ๋ณด๋ฉด ์ฃผ๋ก MIT ๋ผ์ด์ผ์ค๋ฅผ ์ฌ์ฉํ๋ ๊ฒ ๊ฐ์๋ฐ ์ ํํ ๊ฒฐ์ ํ LICENSE
ํ์ผ์ ์ถ๊ฐํด์ผํฉ๋๋ค.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.