-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* 타입 정의 파일 추가 * Travis-CI 테스트에 mypy 테스트 추가 * 배포시 pyi 포함되도록 설정 * Travis-CI에서 mypy가 지원하지 않는 pypy/2.7/3.4는 제외하도록 설정
- Loading branch information
Showing
4 changed files
with
103 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -107,6 +107,7 @@ crashlytics.properties | |
crashlytics-build.properties | ||
|
||
.pytest_cache/ | ||
.mypy_cache/ | ||
.python-version | ||
venv/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,24 @@ | ||
language: python | ||
sudo: false | ||
python: | ||
- pypy | ||
- 2.7 | ||
- 3.4 | ||
- 3.5 | ||
- 3.6 | ||
jobs: | ||
includes: | ||
- python: pypy | ||
env: RUN_MYPY=false | ||
- python: 2.7 | ||
env: RUN_MYPY=false | ||
- python: 3.4 | ||
env: RUN_MYPY=false | ||
- python: 3.5 | ||
env: RUN_MYPY=true | ||
- python: 3.6 | ||
env: RUN_MYPY=true | ||
install: | ||
- pip install tox-travis flake8 collective.checkdocs Pygments | ||
- $RUN_MYPY && pip install mypy || true | ||
script: | ||
- flake8 . | ||
- python setup.py checkdocs | ||
- tox | ||
- $RUN_MYPY && mypy iamport || true | ||
after_success: | ||
- bash <(curl -s https://codecov.io/bash) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
from typing import Any, Dict, Optional, Union | ||
|
||
import requests | ||
|
||
IAMPORT_API_URL: str = ... | ||
Amount = Union[int, float] | ||
|
||
class Iamport(object): | ||
requests_session: requests.Session | ||
|
||
def __init__(self, imp_key: str, imp_secret: str, imp_url: str = ...) -> None: ... | ||
|
||
class ResponseError(Exception): | ||
code: Any | ||
message: Any | ||
def __init__(self, code: Optional[Any] = ..., message: Optional[Any] = ...) -> None: ... | ||
|
||
class HttpError(Exception): | ||
code: Any | ||
message: Any | ||
def __init__(self, code: Optional[Any] = ..., message: Optional[Any] = ...) -> None: ... | ||
|
||
@staticmethod | ||
def get_response(response: requests.Response) -> Dict: ... | ||
|
||
def _get_token(self) -> str: ... | ||
|
||
def get_headers(self) -> Dict[str, str]: ... | ||
|
||
def _get(self, url: str, payload: Optional[Dict[str, Any]] = ...) -> Dict: ... | ||
|
||
def _post(self, url: str, payload: Optional[Dict[str, Any]] = ...) -> Dict: ... | ||
|
||
def find_by_merchant_uid(self, merchant_uid: str) -> Dict: ... | ||
|
||
def find_by_imp_uid(self, imp_uid: str) -> Dict: ... | ||
|
||
def find(self, **kwargs) -> Dict: ... | ||
|
||
def _cancel(self, payload: Dict[str, Any]) -> Dict: ... | ||
|
||
def pay_onetime(self, **kwargs) -> Dict: ... | ||
|
||
def pay_again(self, **kwargs) -> Dict: ... | ||
|
||
def customer_create(self, **kwargs) -> Dict: ... | ||
|
||
def customer_get(self, customer_uid: str) -> Dict: ... | ||
|
||
def pay_foreign(self, **kwargs) -> Dict: ... | ||
|
||
def pay_schedule(self, **kwargs) -> Dict: ... | ||
|
||
def pay_unschedule(self, **kwargs) -> Dict: ... | ||
|
||
def cancel_by_merchant_uid(self, merchant_uid: str, reason: str, **kwargs) -> Dict: ... | ||
|
||
def cancel_by_imp_uid(self, imp_uid: str, reason: str, **kwargs) -> Dict: ... | ||
|
||
def cancel(self, reason: str, **kwargs) -> Dict: ... | ||
|
||
def is_paid(self, amount: Amount, **kwargs) -> bool: ... | ||
|
||
def prepare(self, merchant_uid: str, amount: Amount) -> Dict: ... | ||
|
||
def prepare_validate(self, merchant_uid: str, amount: Amount) -> Dict: ... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters